/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Routines for retrieving CTF data from a .SUNW_ctf ELF section
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <gelf.h>
#include <strings.h>
#include "ctftools.h"
#include "memory.h"
#include "symbol.h"
/*
* Return the source types that the object was generated from.
*/
{
return (SOURCE_NONE);
types |= SOURCE_UNKNOWN;
continue;
}
case 'c':
break;
case 'h':
/* ignore */
break;
case 's':
break;
default:
types |= SOURCE_UNKNOWN;
}
}
symit_free(si);
return (types);
}
static int
int require_ctf)
{
int ctfscnidx;
if (require_ctf &&
terminate("Input file %s was partially built from "
"C sources, but no CTF data was present\n", file);
}
return (0);
}
/* Reconstruction of type tree */
return (0);
}
symit_free(si);
return (-1);
else
return (1);
}
return (0);
}
static int
void *arg, int require_ctf)
{
int rc = 0;
"member %d", secnum);
}
/* skip special sections - their names begin with "/" */
case ELF_K_AR:
break;
case ELF_K_ELF:
break;
default:
terminate("%s: Unknown elf kind %d\n",
}
}
secnum++;
if (rc < 0)
return (rc);
else
}
return (found);
}
static int
int require_ctf)
{
int found = 0;
int fd;
(void) elf_version(EV_CURRENT);
case ELF_K_AR:
break;
case ELF_K_ELF:
break;
default:
}
return (found);
}
/*ARGSUSED*/
int
{
return (1);
}
int
int require_ctf)
{
int found;
int i, rc;
for (i = 0, found = 0; i < n; i++) {
private, require_ctf)) < 0)
return (rc);
}
return (found);
}
static int
{
warning("Can't process input archive %s\n",
file);
err++;
}
nfiles++;
}
if (err > 0)
return (-1);
return (nfiles);
}
int
{
(void) elf_version(EV_CURRENT);
for (i = 0; i < n; i++) {
err++;
continue;
}
elf_errmsg(-1));
err++;
continue;
}
case ELF_K_AR:
err++;
else
break;
case ELF_K_ELF:
nfiles++;
break;
default:
err++;
}
}
if (err > 0)
return (-1);
return (nfiles);
}
struct symit_data {
char *si_curname;
char *si_curfile;
int si_nument;
int si_next;
};
{
int symtabidx;
return (NULL);
return (si);
}
void
{
}
void
{
}
char *
{
return (si->si_curfile);
}
GElf_Sym *
{
continue;
continue;
}
return (NULL);
}
char *
{
return (si->si_curname);
}