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