xref: /titanic_41/usr/src/cmd/sgs/include/debug.h (revision 70025d765b044c6d8594bb965a2247a61e991a99)
1 /*
2  * CDDL HEADER START
3  *
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
7  * with the License.
8  *
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.
13  *
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]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_DEBUG_H
28 #define	_DEBUG_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 /*
33  * Global include file for linker debugging.
34  *
35  * ld(1) and ld.so carry out all diagnostic debugging calls via dlopen'ing
36  * the library liblddbg.so.  Thus debugging is always enabled.  The utility
37  * elfdump() is explicitly dependent upon this library.  There are two
38  * categories of routines defined in this library:
39  *
40  *  o	Debugging routines that have specific linker knowledge, and test the
41  *	class of debugging allowable before proceeding, start with the `Dbg_'
42  *	prefix.
43  *
44  *  o	Lower level routines that provide generic ELF structure interpretation
45  *	start with the `Elf_' prefix.  These latter routines are the only
46  *	routines used by the elfdump() utility.
47  */
48 
49 #include <libelf.h>
50 #include <sgs.h>
51 #include <libld.h>
52 #include <rtld.h>
53 #include <machdep.h>
54 #include <gelf.h>
55 
56 #ifdef	__cplusplus
57 extern "C" {
58 #endif
59 
60 /*
61  * Define any interface flags.  These flags direct the debugging routine to
62  * generate different diagnostics, thus the strings themselves are maintained
63  * in this library.
64  */
65 #define	DBG_SUP_ENVIRON		1
66 #define	DBG_SUP_CMDLINE		2
67 #define	DBG_SUP_DEFAULT		3
68 
69 #define	DBG_CONF_IGNORE		1	/* configuration processing errors */
70 #define	DBG_CONF_VERSION	2
71 #define	DBG_CONF_PRCFAIL	3
72 #define	DBG_CONF_CORRUPT	4
73 
74 #define	DBG_ORDER_INFO_RANGE	1	/* sh_link out of range */
75 #define	DBG_ORDER_INFO_ORDER	2	/* sh_info also ordered */
76 #define	DBG_ORDER_LINK_OUTRANGE	3	/* sh_link out of range */
77 #define	DBG_ORDER_FLAGS		4	/* sh_flags do not match */
78 #define	DBG_ORDER_CYCLIC	5	/* sh_link cyclic */
79 #define	DBG_ORDER_LINK_ERROR	6	/* sh_link (one) has an error */
80 
81 #define	DBG_INIT_SORT		1	/* calling init from sorted order */
82 #define	DBG_INIT_PEND		2	/* calling pending init */
83 #define	DBG_INIT_DYN		3	/* dynamically triggered init */
84 #define	DBG_INIT_DONE		4	/* init completed */
85 
86 #define	DBG_DLSYM_DEF		0
87 #define	DBG_DLSYM_NEXT		1
88 #define	DBG_DLSYM_DEFAULT	2
89 #define	DBG_DLSYM_SELF		3
90 #define	DBG_DLSYM_PROBE		4
91 
92 #define	DBG_DLCLOSE_NULL	0
93 #define	DBG_DLCLOSE_IGNORE	1
94 #define	DBG_DLCLOSE_RESCAN	2
95 
96 #define	DBG_WAIT_INIT		1
97 #define	DBG_WAIT_FINI		2
98 #define	DBG_WAIT_SYMBOL		3
99 
100 #define	DBG_SYM_REDUCE_GLOBAL	1	/* reporting global symbols to local */
101 #define	DBG_SYM_REDUCE_RETAIN	2	/* reporting non reduced local syms */
102 
103 #define	DBG_DEP_CREATE		1	/* Group handle operations */
104 #define	DBG_DEP_ADD		2
105 #define	DBG_DEP_DELETE		3
106 #define	DBG_DEP_REMOVE		4
107 #define	DBG_DEP_REMAIN		5
108 #define	DBG_DEP_ORPHAN		6
109 #define	DBG_DEP_REINST		7
110 
111 #define	DBG_BINFO_FOUND		0x0001	/* information regarding binding */
112 #define	DBG_BINFO_DIRECT	0x0002	/* bound directly */
113 #define	DBG_BINFO_COPYREF	0x0004	/* bound to copy relocated reference */
114 #define	DBG_BINFO_FILTEE	0x0008	/* bound to filtee */
115 #define	DBG_BINFO_INTERPOSE	0x0010	/* bound to an identified interposer */
116 #define	DBG_BINFO_PLTADDR	0x0020	/* bound to executables undefined plt */
117 #define	DBG_BINFO_MSK		0xffff
118 
119 #define	DBG_CAP_INITIAL		0
120 #define	DBG_CAP_IGNORE		1
121 #define	DBG_CAP_OLD		2
122 #define	DBG_CAP_NEW		3
123 #define	DBG_CAP_RESOLVED	4
124 
125 #define	DBG_REL_START		1
126 #define	DBG_REL_FINISH		2
127 #define	DBG_REL_NONE		3
128 
129 /*
130  * Define our setup entry point.
131  */
132 extern	uint_t		Dbg_setup(const char *);
133 extern	void		Dbg_set(uint_t);
134 
135 /*
136  * Define a user macro to invoke debugging.  The `dbg_mask' variable acts as a
137  * suitable flag, and can be set to collect the return value from Dbg_setup().
138  */
139 extern	uint_t		dbg_mask;
140 
141 #define	DBG_CALL(func)	if (dbg_mask) func
142 
143 /*
144  * Most debugging tokens are interpreted within liblddbg, and thus any flags
145  * within dbg_mask are only meaningful to this library.  The following flags
146  * may be set by the Dbg_setup() by can be interpreted by the caller.
147  */
148 #define	DBG_G_SNAME	0x10000000	/* prepend simple name */
149 #define	DBG_G_FNAME	0x20000000	/* prepend full name */
150 #define	DBG_G_CLASS	0x40000000	/* prepend ELF class */
151 
152 /*
153  * Print routine, this must be supplied by the application.
154  */
155 /*PRINTFLIKE1*/
156 extern	void		dbg_print(const char *, ...);
157 
158 
159 /*
160  * External interface routines.  These are linker specific.
161  */
162 #ifdef _ELF64
163 #define	Dbg_cap_hw_1		Dbg_cap_hw_164
164 #define	Dbg_cap_mapfile		Dbg_cap_mapfile64
165 #define	Dbg_cap_sec_entry	Dbg_cap_sec_entry64
166 #define	Dbg_file_analyze	Dbg_file_analyze64
167 #define	Dbg_file_aout		Dbg_file_aout64
168 #define	Dbg_file_archive	Dbg_file_archive64
169 #define	Dbg_file_bind_entry	Dbg_file_bind_entry64
170 #define	Dbg_file_bindings	Dbg_file_bindings64
171 #define	Dbg_file_config_dis	Dbg_file_config_dis64
172 #define	Dbg_file_config_obj	Dbg_file_config_obj64
173 #define	Dbg_file_delete		Dbg_file_delete64
174 #define	Dbg_file_dlclose	Dbg_file_dlclose64
175 #define	Dbg_file_dldump		Dbg_file_dldump64
176 #define	Dbg_file_dlopen		Dbg_file_dlopen64
177 #define	Dbg_file_elf		Dbg_file_elf64
178 #define	Dbg_file_filtee		Dbg_file_filtee64
179 #define	Dbg_file_filter		Dbg_file_filter64
180 #define	Dbg_file_fixname	Dbg_file_fixname64
181 #define	Dbg_file_generic	Dbg_file_generic64
182 #define	Dbg_file_hdl_action	Dbg_file_hdl_action64
183 #define	Dbg_file_hdl_collect	Dbg_file_hdl_collect64
184 #define	Dbg_file_hdl_title	Dbg_file_hdl_title64
185 #define	Dbg_file_ldso		Dbg_file_ldso64
186 #define	Dbg_file_lazyload	Dbg_file_lazyload64
187 #define	Dbg_file_needed		Dbg_file_needed64
188 #define	Dbg_file_nl		Dbg_file_nl64
189 #define	Dbg_file_output		Dbg_file_output64
190 #define	Dbg_file_preload	Dbg_file_preload64
191 #define	Dbg_file_prot		Dbg_file_prot64
192 #define	Dbg_file_reuse		Dbg_file_reuse64
193 #define	Dbg_file_skip		Dbg_file_skip64
194 #define	Dbg_got_display		Dbg_got_display64
195 #define	Dbg_map_atsign		Dbg_map_atsign64
196 #define	Dbg_map_cap		Dbg_map_cap64
197 #define	Dbg_map_dash		Dbg_map_dash64
198 #define	Dbg_map_ent		Dbg_map_ent64
199 #define	Dbg_map_equal		Dbg_map_equal64
200 #define	Dbg_map_parse		Dbg_map_parse64
201 #define	Dbg_map_pipe		Dbg_map_pipe64
202 #define	Dbg_map_seg		Dbg_map_seg64
203 #define	Dbg_map_size_new	Dbg_map_size_new64
204 #define	Dbg_map_size_old	Dbg_map_size_old64
205 #define	Dbg_map_sort_fini	Dbg_map_sort_fini64
206 #define	Dbg_map_sort_orig	Dbg_map_sort_orig64
207 #define	Dbg_map_symbol		Dbg_map_symbol64
208 #define	Dbg_map_version		Dbg_map_version64
209 #define	Dbg_move_mventry	Dbg_move_mventry64
210 #define	Dbg_move_mventry2	Dbg_move_mventry264
211 #define	Dbg_move_outsctadj	Dbg_move_outsctadj64
212 #define	Dbg_reloc_discard	Dbg_reloc_discard64
213 #define	Dbg_reloc_error		Dbg_reloc_error64
214 #define	Dbg_reloc_generate	Dbg_reloc_generate64
215 #define	Dbg_reloc_in		Dbg_reloc_in64
216 #define	Dbg_reloc_out		Dbg_reloc_out64
217 #define	Dbg_reloc_proc		Dbg_reloc_proc64
218 #define	Dbg_reloc_ars_entry	Dbg_reloc_ars_entry64
219 #define	Dbg_reloc_ors_entry	Dbg_reloc_ors_entry64
220 #define	Dbg_reloc_doact		Dbg_reloc_doact64
221 #define	Dbg_reloc_dooutrel	Dbg_reloc_dooutrel64
222 #define	Dbg_reloc_reg_apply	Dbg_reloc_reg_apply64
223 #define	Dbg_reloc_transition	Dbg_reloc_transition64
224 #define	Dbg_sec_added		Dbg_sec_added64
225 #define	Dbg_sec_created		Dbg_sec_created64
226 #define	Dbg_sec_discarded	Dbg_sec_discarded64
227 #define	Dbg_sec_group		Dbg_sec_group64
228 #define	Dbg_sec_in		Dbg_sec_in64
229 #define	Dbg_sec_order_list	Dbg_sec_order_list64
230 #define	Dbg_sec_order_error	Dbg_sec_order_error64
231 #define	Dbg_sec_strtab		Dbg_sec_strtab64
232 #define	Dbg_seg_entry		Dbg_seg_entry64
233 #define	Dbg_seg_list		Dbg_seg_list64
234 #define	Dbg_seg_os		Dbg_seg_os64
235 #define	Dbg_seg_title		Dbg_seg_title64
236 #define	Dbg_statistics_ar	Dbg_statistics_ar64
237 #define	Dbg_statistics_ld	Dbg_statistics_ld64
238 #define	Dbg_syminfo_entry	Dbg_syminfo_entry64
239 #define	Dbg_syminfo_entry_title	Dbg_syminfo_entry_title64
240 #define	Dbg_syminfo_title	Dbg_syminfo_title64
241 #define	Dbg_syms_ar_checking	Dbg_syms_ar_checking64
242 #define	Dbg_syms_ar_entry	Dbg_syms_ar_entry64
243 #define	Dbg_syms_ar_resolve	Dbg_syms_ar_resolve64
244 #define	Dbg_syms_created	Dbg_syms_created64
245 #define	Dbg_syms_discarded	Dbg_syms_discarded64
246 #define	Dbg_syms_entered	Dbg_syms_entered64
247 #define	Dbg_syms_entry		Dbg_syms_entry64
248 #define	Dbg_syms_global		Dbg_syms_global64
249 #define	Dbg_syms_ignore		Dbg_syms_ignore64
250 #define	Dbg_syms_new		Dbg_syms_new64
251 #define	Dbg_syms_nl		Dbg_syms_nl64
252 #define	Dbg_syms_old		Dbg_syms_old64
253 #define	Dbg_syms_process	Dbg_syms_process64
254 #define	Dbg_syms_reduce		Dbg_syms_reduce64
255 #define	Dbg_syms_reloc		Dbg_syms_reloc64
256 #define	Dbg_syms_resolved	Dbg_syms_resolved64
257 #define	Dbg_syms_resolving1	Dbg_syms_resolving164
258 #define	Dbg_syms_resolving2	Dbg_syms_resolving264
259 #define	Dbg_syms_sec_entry	Dbg_syms_sec_entry64
260 #define	Dbg_syms_sec_title	Dbg_syms_sec_title64
261 #define	Dbg_syms_spec_title	Dbg_syms_spec_title64
262 #define	Dbg_syms_up_title	Dbg_syms_up_title64
263 #define	Dbg_syms_updated	Dbg_syms_updated64
264 #define	Dbg_syms_dlsym		Dbg_syms_dlsym64
265 #define	Dbg_syms_lookup_aout	Dbg_syms_lookup_aout64
266 #define	Dbg_syms_lookup		Dbg_syms_lookup64
267 #define	Dbg_tls_modactivity	Dbg_tls_modactivity64
268 #define	Dbg_tls_static_block	Dbg_tls_static_block64
269 #define	Dbg_unused_sec		Dbg_unused_sec64
270 #define	Dbg_audit_interface	Dbg_audit_interface64
271 #define	Dbg_audit_lib		Dbg_audit_lib64
272 #define	Dbg_audit_object	Dbg_audit_object64
273 #define	Dbg_audit_symval	Dbg_audit_symval64
274 #define	Dbg_audit_version	Dbg_audit_version64
275 #define	Dbg_ver_avail_entry	Dbg_ver_avail_entry64
276 #define	Dbg_ver_desc_entry	Dbg_ver_desc_entry64
277 #endif	/* _ELF64 */
278 
279 extern	void		Dbg_args_files(int, char *);
280 extern	void		Dbg_args_flags(int, int);
281 extern	void		Dbg_bind_global(const char *, caddr_t, caddr_t, Xword,
282 			    Pltbindtype, const char *, caddr_t, caddr_t,
283 			    const char *, uint_t);
284 extern	void		Dbg_bind_plt_summary(Half, Word, Word, Word,
285 			    Word, Word, Word);
286 extern	void		Dbg_bind_profile(uint_t, uint_t);
287 extern	void		Dbg_bind_weak(const char *, caddr_t, caddr_t,
288 			    const char *);
289 extern	void		Dbg_cap_hw_candidate(const char *);
290 extern	void		Dbg_cap_hw_filter(const char *, const char *);
291 extern	void		Dbg_cap_hw_1(Xword, Half);
292 extern	void		Dbg_cap_mapfile(Xword, Xword, Half);
293 extern	void		Dbg_cap_sec_entry(uint_t, Xword, Xword, Half);
294 extern	void		Dbg_cap_sec_title(const char *);
295 extern	void		Dbg_ent_print(Half, List * len, Boolean);
296 extern	void		Dbg_file_analyze(Rt_map *);
297 extern	void		Dbg_file_aout(const char *, ulong_t, ulong_t, ulong_t);
298 extern	void		Dbg_file_archive(const char *, int);
299 extern	void		Dbg_file_ar_rescan(void);
300 extern	void		Dbg_file_bind_entry(Bnd_desc *);
301 extern	void		Dbg_file_bindings(Rt_map *, int, Word);
302 extern	void		Dbg_file_cntl(Lm_list *, Aliste, Aliste);
303 extern	void		Dbg_file_config_dis(const char *, int);
304 extern	void		Dbg_file_config_obj(const char *, const char *,
305 			    const char *);
306 extern	void		Dbg_file_delete(const char *);
307 extern	void		Dbg_file_dlclose(const char *, int);
308 extern	void		Dbg_file_dldump(const char *, const char *, int);
309 extern	void		Dbg_file_dlopen(const char *, const char *, int);
310 extern	void		Dbg_file_del_rescan(void);
311 extern	void		Dbg_file_elf(const char *, ulong_t, ulong_t, ulong_t,
312 			    ulong_t, Lmid_t, Aliste);
313 extern	void		Dbg_file_filtee(const char *, const char *, int);
314 extern	void		Dbg_file_filter(const char *, const char *, int);
315 extern	void		Dbg_file_fixname(const char *, const char *);
316 extern	void		Dbg_file_generic(Ifl_desc *);
317 extern	void		Dbg_file_hdl_action(Grp_hdl *, Rt_map *, int);
318 extern	void		Dbg_file_hdl_collect(Grp_hdl *, const char *);
319 extern	void		Dbg_file_hdl_title(int);
320 extern	void		Dbg_file_lazyload(const char *, const char *,
321 			    const char *);
322 extern	void		Dbg_file_ldso(const char *, ulong_t, ulong_t, char **,
323 			    auxv_t *);
324 extern	void		Dbg_file_mode_promote(const char *, int);
325 extern	void		Dbg_file_needed(const char *, const char *);
326 extern	void		Dbg_file_nl(void);
327 extern	void		Dbg_file_output(Ofl_desc *);
328 extern	void		Dbg_file_preload(const char *);
329 extern	void		Dbg_file_prot(const char *, int);
330 extern	void		Dbg_file_reuse(const char *, const char *);
331 extern	void		Dbg_file_rejected(Rej_desc *);
332 extern	void		Dbg_file_skip(const char *, const char *);
333 extern	void		Dbg_got_display(Gottable *, Ofl_desc *);
334 extern	void		Dbg_libs_audit(const char *, const char *);
335 extern	void		Dbg_libs_ignore(const char *);
336 extern	void		Dbg_libs_init(List *, List *);
337 extern	void		Dbg_libs_l(const char *, const char *);
338 extern	void		Dbg_libs_path(const char *, Half, const char *);
339 extern	void		Dbg_libs_req(const char *, const char *, const char *);
340 extern	void		Dbg_libs_update(List *, List *);
341 extern	void		Dbg_libs_yp(const char *);
342 extern	void		Dbg_libs_ylu(const char *, const char *, int);
343 extern	void		Dbg_libs_find(const char *);
344 extern	void		Dbg_libs_found(const char *, int);
345 extern	void		Dbg_map_atsign(Boolean);
346 extern	void		Dbg_map_dash(const char *, Sdf_desc *);
347 extern	void		Dbg_map_ent(Boolean, Ent_desc *, Ofl_desc *);
348 extern	void		Dbg_map_equal(Boolean);
349 extern	void		Dbg_map_parse(const char *);
350 extern	void		Dbg_map_pipe(Sg_desc *, const char *, const Word);
351 extern	void		Dbg_map_seg(Half, int, Sg_desc *);
352 extern	void		Dbg_map_size_new(const char *);
353 extern	void		Dbg_map_size_old(Ehdr *, Sym_desc *);
354 extern	void		Dbg_map_sort_fini(Sg_desc *);
355 extern	void		Dbg_map_sort_orig(Sg_desc *);
356 extern	void		Dbg_map_symbol(Ehdr *, Sym_desc *);
357 extern	void		Dbg_map_version(const char *, const char *, int);
358 extern 	void		Dbg_move_adjexpandreloc(ulong_t, const char *);
359 extern 	void		Dbg_move_adjmovereloc(ulong_t, ulong_t, const char *);
360 extern	void		Dbg_move_data(const char *);
361 extern 	void		Dbg_move_expanding(Move *, Addr);
362 extern 	void		Dbg_move_input1(const char *);
363 extern 	void		Dbg_move_mventry(int, Move *, Sym_desc *);
364 extern 	void		Dbg_move_mventry2(Move *, Word, char *);
365 extern 	void		Dbg_move_outmove(const uchar_t *);
366 extern 	void		Dbg_move_outsctadj(Sym_desc *);
367 extern 	void		Dbg_move_parexpn(const char *, const char *);
368 #if	defined(_ELF64)
369 extern	void		Dbg_pltpad_bindto64(const char *, const char *, Addr);
370 extern	void		Dbg_pltpad_boundto64(const char *, Addr, const char *,
371 			    const char *);
372 #endif
373 extern	void		Dbg_reloc_apply(unsigned long long, unsigned long long);
374 extern	void		Dbg_reloc_discard(Half, Rel_desc *);
375 extern	void		Dbg_reloc_error(Half, Word, void *, const char *,
376 			    const char *);
377 extern	void		Dbg_reloc_generate(Os_desc *, Word);
378 extern	void		Dbg_reloc_reg_apply(unsigned long long,
379 			    unsigned long long);
380 extern	void		Dbg_reloc_in(Half, Word, void *, const char *,
381 			    const char *);
382 extern	void		Dbg_reloc_out(Half, Word, void *, const char *,
383 			    const char *);
384 extern	void		Dbg_reloc_proc(Os_desc *, Is_desc *, Is_desc *);
385 extern	void		Dbg_reloc_ars_entry(Half, Rel_desc *);
386 extern	void		Dbg_reloc_ors_entry(Half, Rel_desc *);
387 extern	void		Dbg_reloc_doactiverel(void);
388 extern	void		Dbg_reloc_doact(Half, Word, Xword, Xword, const char *,
389 			    Os_desc *);
390 extern	void		Dbg_reloc_dooutrel(GElf_Word);
391 extern	void		Dbg_reloc_copy(const char *, const char *,
392 			    const char *, int);
393 extern	void		Dbg_reloc_run(const char *, uint_t, int, int);
394 extern	void		Dbg_reloc_transition(Half, Word, Word, Xword,
395 			    const char *);
396 extern	void		Dbg_sec_added(Os_desc *, Sg_desc *);
397 extern	void		Dbg_sec_created(Os_desc *, Sg_desc *);
398 extern	void		Dbg_sec_discarded(Is_desc *, Is_desc *);
399 extern	void		Dbg_sec_group(Is_desc *, Group_desc *);
400 extern	void		Dbg_sec_in(Is_desc *);
401 extern	void		Dbg_sec_order_list(Ofl_desc *, int);
402 extern	void		Dbg_sec_order_error(Ifl_desc *, Word, int);
403 extern	void		Dbg_sec_strtab(Os_desc *, Str_tbl *);
404 extern	void		Dbg_seg_entry(Half, int, Sg_desc *);
405 extern	void		Dbg_seg_list(Half, List *);
406 extern	void		Dbg_seg_os(Ofl_desc *, Os_desc *, int);
407 extern	void		Dbg_seg_title(void);
408 extern	void		Dbg_support_action(const char *, const char *,
409 			    Support_ndx, const char *);
410 extern	void		Dbg_support_load(const char *, const char *);
411 extern	void		Dbg_support_req(const char *, int);
412 extern	void		Dbg_syms_ar_checking(Xword, Elf_Arsym *, const char *);
413 extern	void		Dbg_syms_ar_entry(Xword, Elf_Arsym *);
414 extern	void		Dbg_syms_ar_resolve(Xword, Elf_Arsym *, const char *,
415 			    int);
416 extern	void		Dbg_syms_ar_title(const char *, int);
417 extern	void		Dbg_syms_created(const char *);
418 extern	void		Dbg_syms_discarded(Sym_desc *, Is_desc *);
419 extern	void		Dbg_syms_entered(Ehdr *, Sym *, Sym_desc *);
420 extern	void		Dbg_syms_entry(Xword, Sym_desc *);
421 extern	void		Dbg_syms_global(Xword, const char *);
422 extern	void		Dbg_syms_ignore(Ehdr *, Sym_desc *);
423 extern	void		Dbg_syms_lazy_rescan(const char *);
424 extern	void		Dbg_syms_new(Ehdr *, Sym *, Sym_desc *);
425 extern	void		Dbg_syms_nl(void);
426 extern	void		Dbg_syms_old(Ehdr *, Sym_desc *);
427 extern	void		Dbg_syms_process(Ifl_desc *);
428 extern	void		Dbg_syms_reduce(int, Ehdr *, Sym_desc *, int,
429 			    const char *);
430 extern	void		Dbg_syms_reloc(Ehdr *, Sym_desc *);
431 extern	void		Dbg_syms_resolved(Ehdr *, Sym_desc *);
432 extern	void		Dbg_syms_resolving1(Xword, const char *, int, int);
433 extern	void		Dbg_syms_resolving2(Ehdr *, Sym *, Sym *, Sym_desc *,
434 			    Ifl_desc *);
435 extern	void		Dbg_syms_sec_entry(int, Sg_desc *, Os_desc *);
436 extern	void		Dbg_syms_sec_title(void);
437 extern	void		Dbg_syms_spec_title(void);
438 extern	void		Dbg_syms_up_title(Ehdr *);
439 extern	void		Dbg_syms_updated(Ehdr *, Sym_desc *, const char *);
440 extern	void		Dbg_syms_dlsym(const char *, const char *, const char *,
441 			    int);
442 extern	void		Dbg_syms_lookup_aout(const char *);
443 extern	void		Dbg_syms_lookup(const char *, const char *,
444 			    const char *);
445 extern	void		Dbg_tls_modactivity(void *, uint_t);
446 extern	void		Dbg_tls_static_block(void *, ulong_t);
447 extern	void		Dbg_audit_interface(const char *, const char *);
448 extern	void		Dbg_audit_lib(const char *);
449 extern	void		Dbg_audit_object(const char *, const char *);
450 extern	void		Dbg_audit_symval(const char *, const char *,
451 			    const char *, Addr, Addr);
452 extern	void		Dbg_audit_version(const char *, ulong_t);
453 extern	void		Dbg_statistics_ar(Ofl_desc *);
454 extern	void		Dbg_statistics_ld(Ofl_desc *);
455 extern	void		Dbg_syminfo_entry(int, Syminfo *, Sym *,
456 			    const char *, Dyn *);
457 extern	void		Dbg_syminfo_title(void);
458 extern	void		Dbg_unused_file(const char *, int);
459 extern	void		Dbg_unused_rtldinfo(const char *, const char *);
460 extern	void		Dbg_unused_sec(Is_desc *);
461 extern	void		Dbg_unused_unref(const char *, const char *);
462 extern	void		Dbg_util_broadcast(const char *);
463 extern	void		Dbg_util_call_array(const char *, void *,
464 			    uint_t, uint_t);
465 extern	void		Dbg_util_call_fini(const char *);
466 extern	void		Dbg_util_call_init(const char *, int);
467 extern	void		Dbg_util_call_main(const char *);
468 extern	void		Dbg_util_collect(const char *, int, int);
469 extern	void		Dbg_util_dbnotify(rd_event_e, r_state_e);
470 extern	void		Dbg_util_edge_in(Rt_map *, uint_t, Rt_map *, int, int);
471 extern	void		Dbg_util_edge_out(const char *, int, const char *);
472 extern	void		Dbg_util_intoolate(const char *);
473 extern	void		Dbg_util_nl(void);
474 extern	void		Dbg_util_no_init(const char *);
475 extern	void		Dbg_util_scc_entry(uint_t, const char *);
476 extern	void		Dbg_util_scc_title(int);
477 extern	void		Dbg_util_str(const char *);
478 extern	void		Dbg_util_wait(int, const char *, const char *);
479 extern	void		Dbg_ver_avail_entry(Ver_index *, const char *);
480 extern	void		Dbg_ver_avail_title(const char *);
481 extern	void		Dbg_ver_desc_entry(Ver_desc *);
482 extern	void		Dbg_ver_def_title(const char *);
483 extern	void		Dbg_ver_need_title(const char *);
484 extern	void		Dbg_ver_need_entry(Half, const char *, const char *);
485 extern	void		Dbg_ver_nointerface(const char *);
486 extern	void		Dbg_ver_symbol(const char *);
487 
488 /*
489  * External interface routines. These are not linker specific and provide
490  * generic routines for interpreting elf structures.
491  */
492 #ifdef _ELF64
493 #define	Elf_phdr_entry		Gelf_phdr_entry
494 #define	Elf_shdr_entry		Gelf_shdr_entry
495 #define	Elf_sym_table_entry	Gelf_sym_table_entry
496 #else	/* elf32 */
497 extern	void		Elf_phdr_entry(Half, Elf32_Phdr *);
498 extern	void		Elf_shdr_entry(Half, Elf32_Shdr *);
499 extern	void		Elf_sym_table_entry(const char *, Elf32_Ehdr *,
500 			    Elf32_Sym *, Elf32_Word, const char *,
501 			    const char *);
502 #endif /* _ELF64 */
503 
504 /*
505  * These are used by both the Elf32 and Elf64 sides.
506  */
507 extern	const char	*Gelf_sym_dem(const char *);
508 
509 extern	void		Gelf_cap_print(GElf_Cap *, int, Half);
510 extern	void		Gelf_cap_title(void);
511 extern	void		Gelf_phdr_entry(Half, GElf_Phdr *);
512 extern	void		Gelf_shdr_entry(Half, GElf_Shdr *);
513 extern	void		Gelf_sym_table_entry(const char *, GElf_Ehdr *,
514 			    GElf_Sym *, GElf_Word, const char *, const char *);
515 extern	void		Gelf_elf_data_title(void);
516 extern	void		Gelf_syminfo_entry(int, GElf_Syminfo *, const char *,
517 			    const char *);
518 extern	void		Gelf_sym_table_title(GElf_Ehdr *, const char *,
519 			    const char *);
520 extern	void		Gelf_ver_def_title(void);
521 extern	void		Gelf_ver_need_title(void);
522 extern	void		Gelf_ver_line_1(const char *, const char *,
523 			    const char *, const char *);
524 extern	void		Gelf_ver_line_2(const char *, const char *);
525 extern	void		Gelf_ver_line_3(const char *, const char *,
526 			    const char *);
527 
528 extern	void		Gelf_dyn_print(GElf_Dyn *, int ndx, const char *, Half);
529 extern	void		Gelf_dyn_title(void);
530 extern	void		Gelf_elf_header(GElf_Ehdr *, GElf_Shdr *);
531 extern	void		Gelf_got_title(uchar_t);
532 extern	void		Gelf_got_entry(GElf_Ehdr *, Sword, GElf_Addr,
533 			    GElf_Xword, GElf_Word, void *, const char *);
534 extern	void		Gelf_reloc_entry(const char *, GElf_Half, GElf_Word,
535 			    GElf_Rela *, const char *, const char *);
536 extern	void		Gelf_syminfo_title(void);
537 
538 #ifdef	__cplusplus
539 }
540 #endif
541 
542 #endif /* _DEBUG_H */
543