static_prof.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 (c) 1998-2000 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _STATIC_PROF_H
#define _STATIC_PROF_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* include headers
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <libelf.h>
#include <link.h>
#include <sys/elf_SPARC.h>
#include <errno.h>
/*
* Declaration of global variables
*/
#define MASK (~(unsigned long)0<<28)
/*
* bucket struct of hash table
*/
typedef struct binding_bucket
{
char *sym;
char *ref_lib;
char *def_lib;
char *obj;
char *section;
char *sttype;
char *stbind;
/*
* data structure for linked list of DT_NEEDED entries
*/
typedef struct dt_list_tag
{
char *libname;
#if defined(_LP64)
#else
#endif
struct dt_list_tag *next;
} dt_list;
/*
* struct for the binary object under test
*/
typedef struct obj_com
{
char **filenames; /* name of application file */
char *filename;
int numfiles; /* number of applications to check */
/* ---Current application ELF file information--- */
char *ename; /* name of current ELF file */
int fd; /* file descriptor for current file */
#if defined(_LP64)
#else
#endif
char *dynnames; /* pointer to dynamic string table */
/* ---ELF file symbol table information--- */
/* dynamic symbol table */
#if defined(_LP64)
#else
#endif
int dsym_num;
char *dsym_names;
/* regular symbol table */
#if defined(_LP64)
#else
#endif
int sym_num;
char *sym_names;
} obj_com;
/*
* struct of the linked list of object files
*/
typedef struct obj_list_tag
{
struct obj_list_tag *next;
} obj_list;
static int oflag = 0; /* flag for redirecting output */
static int pflag = 0; /* flag for profiling to stdout */
extern int errno; /* file opening error return code */
static char *outputfile; /* full pathname of output file */
#define SUCCEED 0
#define FAIL 1
#define TRUE 1
#define FALSE 0
#ifdef __cplusplus
}
#endif
#endif /* _STATIC_PROF_H */