4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 1998-2000 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #ifndef _STATIC_PROF_H
28 #define _STATIC_PROF_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
47 #include <sys/elf_SPARC.h>
48 #include <sys/utsname.h>
52 * Declaration of global variables
55 #define DEFBKTS 24997 /* 3571 nice big prime number */
56 #define MASK (~(unsigned long)0<<28)
59 * bucket struct of hash table
61 typedef struct binding_bucket
72 static binding_bucket bkts
[DEFBKTS
];
75 * data structure for linked list of DT_NEEDED entries
77 typedef struct dt_list_tag
85 struct dt_list_tag
*next
;
88 static dt_list
*dt_needed
= NULL
; /* ptr to link list of dtneeded */
91 * struct for the binary object under test
93 typedef struct obj_com
95 char **filenames
; /* name of application file */
97 int numfiles
; /* number of applications to check */
98 /* ---Current application ELF file information--- */
99 char *ename
; /* name of current ELF file */
100 int fd
; /* file descriptor for current file */
101 Elf
*elf
; /* elf descriptor for current file */
103 Elf64_Ehdr
*ehdr
; /* 64 bit elf header for current file */
104 Elf64_Phdr
*phdr
; /* 64 bit prog header for current file */
105 Elf64_Dyn
*dynsect
; /* pointer to 64 bit dynamic section */
107 Elf32_Ehdr
*ehdr
; /* 32 bit elf header for current file */
108 Elf32_Phdr
*phdr
; /* 32 bit prog header for current file */
109 Elf32_Dyn
*dynsect
; /* ptr to 64 bit dynamic section */
111 Elf_Data
*ddata
; /* ptr to dstring table data descriptor */
112 char *dynnames
; /* pointer to dynamic string table */
113 /* ---ELF file symbol table information--- */
114 /* dynamic symbol table */
123 /* regular symbol table */
135 * struct of the linked list of object files
137 typedef struct obj_list_tag
140 struct obj_list_tag
*next
;
143 static int oflag
= 0; /* flag for redirecting output */
144 static int pflag
= 0; /* flag for profiling to stdout */
145 static int sflag
= 1; /* flag for silent mode */
146 static int aflag
= 1; /* flag for read input as archive */
147 extern int errno
; /* file opening error return code */
148 static FILE *OUTPUT_FD
; /* output fd: default as stdout */
149 static char *outputfile
; /* full pathname of output file */
161 #endif /* _STATIC_PROF_H */