xref: /titanic_51/usr/src/cmd/sgs/include/debug.h (revision 49335bdececa5fc091b6c63763f9176524390b5e)
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_config_dis	Dbg_file_config_dis64
171 #define	Dbg_file_config_obj	Dbg_file_config_obj64
172 #define	Dbg_file_delete		Dbg_file_delete64
173 #define	Dbg_file_dlclose	Dbg_file_dlclose64
174 #define	Dbg_file_dldump		Dbg_file_dldump64
175 #define	Dbg_file_dlopen		Dbg_file_dlopen64
176 #define	Dbg_file_elf		Dbg_file_elf64
177 #define	Dbg_file_filtee		Dbg_file_filtee64
178 #define	Dbg_file_filter		Dbg_file_filter64
179 #define	Dbg_file_fixname	Dbg_file_fixname64
180 #define	Dbg_file_generic	Dbg_file_generic64
181 #define	Dbg_file_hdl_action	Dbg_file_hdl_action64
182 #define	Dbg_file_hdl_collect	Dbg_file_hdl_collect64
183 #define	Dbg_file_hdl_title	Dbg_file_hdl_title64
184 #define	Dbg_file_ldso		Dbg_file_ldso64
185 #define	Dbg_file_lazyload	Dbg_file_lazyload64
186 #define	Dbg_file_needed		Dbg_file_needed64
187 #define	Dbg_file_nl		Dbg_file_nl64
188 #define	Dbg_file_output		Dbg_file_output64
189 #define	Dbg_file_preload	Dbg_file_preload64
190 #define	Dbg_file_prot		Dbg_file_prot64
191 #define	Dbg_file_reuse		Dbg_file_reuse64
192 #define	Dbg_file_skip		Dbg_file_skip64
193 #define	Dbg_got_display		Dbg_got_display64
194 #define	Dbg_map_atsign		Dbg_map_atsign64
195 #define	Dbg_map_cap		Dbg_map_cap64
196 #define	Dbg_map_dash		Dbg_map_dash64
197 #define	Dbg_map_ent		Dbg_map_ent64
198 #define	Dbg_map_equal		Dbg_map_equal64
199 #define	Dbg_map_parse		Dbg_map_parse64
200 #define	Dbg_map_pipe		Dbg_map_pipe64
201 #define	Dbg_map_seg		Dbg_map_seg64
202 #define	Dbg_map_size_new	Dbg_map_size_new64
203 #define	Dbg_map_size_old	Dbg_map_size_old64
204 #define	Dbg_map_sort_fini	Dbg_map_sort_fini64
205 #define	Dbg_map_sort_orig	Dbg_map_sort_orig64
206 #define	Dbg_map_symbol		Dbg_map_symbol64
207 #define	Dbg_map_version		Dbg_map_version64
208 #define	Dbg_move_mventry	Dbg_move_mventry64
209 #define	Dbg_move_mventry2	Dbg_move_mventry264
210 #define	Dbg_move_outsctadj	Dbg_move_outsctadj64
211 #define	Dbg_reloc_discard	Dbg_reloc_discard64
212 #define	Dbg_reloc_error		Dbg_reloc_error64
213 #define	Dbg_reloc_generate	Dbg_reloc_generate64
214 #define	Dbg_reloc_in		Dbg_reloc_in64
215 #define	Dbg_reloc_out		Dbg_reloc_out64
216 #define	Dbg_reloc_proc		Dbg_reloc_proc64
217 #define	Dbg_reloc_ars_entry	Dbg_reloc_ars_entry64
218 #define	Dbg_reloc_ors_entry	Dbg_reloc_ors_entry64
219 #define	Dbg_reloc_doact		Dbg_reloc_doact64
220 #define	Dbg_reloc_dooutrel	Dbg_reloc_dooutrel64
221 #define	Dbg_reloc_reg_apply	Dbg_reloc_reg_apply64
222 #define	Dbg_reloc_transition	Dbg_reloc_transition64
223 #define	Dbg_sec_added		Dbg_sec_added64
224 #define	Dbg_sec_created		Dbg_sec_created64
225 #define	Dbg_sec_discarded	Dbg_sec_discarded64
226 #define	Dbg_sec_group		Dbg_sec_group64
227 #define	Dbg_sec_in		Dbg_sec_in64
228 #define	Dbg_sec_order_list	Dbg_sec_order_list64
229 #define	Dbg_sec_order_error	Dbg_sec_order_error64
230 #define	Dbg_sec_strtab		Dbg_sec_strtab64
231 #define	Dbg_seg_entry		Dbg_seg_entry64
232 #define	Dbg_seg_list		Dbg_seg_list64
233 #define	Dbg_seg_os		Dbg_seg_os64
234 #define	Dbg_seg_title		Dbg_seg_title64
235 #define	Dbg_statistics_ar	Dbg_statistics_ar64
236 #define	Dbg_statistics_ld	Dbg_statistics_ld64
237 #define	Dbg_syminfo_entry	Dbg_syminfo_entry64
238 #define	Dbg_syminfo_entry_title	Dbg_syminfo_entry_title64
239 #define	Dbg_syminfo_title	Dbg_syminfo_title64
240 #define	Dbg_syms_ar_checking	Dbg_syms_ar_checking64
241 #define	Dbg_syms_ar_entry	Dbg_syms_ar_entry64
242 #define	Dbg_syms_ar_resolve	Dbg_syms_ar_resolve64
243 #define	Dbg_syms_created	Dbg_syms_created64
244 #define	Dbg_syms_discarded	Dbg_syms_discarded64
245 #define	Dbg_syms_entered	Dbg_syms_entered64
246 #define	Dbg_syms_entry		Dbg_syms_entry64
247 #define	Dbg_syms_global		Dbg_syms_global64
248 #define	Dbg_syms_ignore		Dbg_syms_ignore64
249 #define	Dbg_syms_new		Dbg_syms_new64
250 #define	Dbg_syms_nl		Dbg_syms_nl64
251 #define	Dbg_syms_old		Dbg_syms_old64
252 #define	Dbg_syms_process	Dbg_syms_process64
253 #define	Dbg_syms_reduce		Dbg_syms_reduce64
254 #define	Dbg_syms_reloc		Dbg_syms_reloc64
255 #define	Dbg_syms_resolved	Dbg_syms_resolved64
256 #define	Dbg_syms_resolving1	Dbg_syms_resolving164
257 #define	Dbg_syms_resolving2	Dbg_syms_resolving264
258 #define	Dbg_syms_sec_entry	Dbg_syms_sec_entry64
259 #define	Dbg_syms_sec_title	Dbg_syms_sec_title64
260 #define	Dbg_syms_spec_title	Dbg_syms_spec_title64
261 #define	Dbg_syms_up_title	Dbg_syms_up_title64
262 #define	Dbg_syms_updated	Dbg_syms_updated64
263 #define	Dbg_syms_dlsym		Dbg_syms_dlsym64
264 #define	Dbg_syms_lookup_aout	Dbg_syms_lookup_aout64
265 #define	Dbg_syms_lookup		Dbg_syms_lookup64
266 #define	Dbg_tls_modactivity	Dbg_tls_modactivity64
267 #define	Dbg_tls_static_block	Dbg_tls_static_block64
268 #define	Dbg_unused_sec		Dbg_unused_sec64
269 #define	Dbg_audit_interface	Dbg_audit_interface64
270 #define	Dbg_audit_lib		Dbg_audit_lib64
271 #define	Dbg_audit_object	Dbg_audit_object64
272 #define	Dbg_audit_symval	Dbg_audit_symval64
273 #define	Dbg_audit_version	Dbg_audit_version64
274 #define	Dbg_ver_avail_entry	Dbg_ver_avail_entry64
275 #define	Dbg_ver_desc_entry	Dbg_ver_desc_entry64
276 #endif	/* _ELF64 */
277 
278 extern	void		Dbg_args_files(int, char *);
279 extern	void		Dbg_args_flags(int, int);
280 extern	void		Dbg_bind_global(const char *, caddr_t, caddr_t, Xword,
281 			    Pltbindtype, const char *, caddr_t, caddr_t,
282 			    const char *, uint_t);
283 extern	void		Dbg_bind_plt_summary(Half, Word, Word, Word,
284 			    Word, Word, Word);
285 extern	void		Dbg_bind_profile(uint_t, uint_t);
286 extern	void		Dbg_bind_weak(const char *, caddr_t, caddr_t,
287 			    const char *);
288 extern	void		Dbg_cap_hw_candidate(const char *);
289 extern	void		Dbg_cap_hw_filter(const char *, const char *);
290 extern	void		Dbg_cap_hw_1(Xword, Half);
291 extern	void		Dbg_cap_mapfile(Xword, Xword, Half);
292 extern	void		Dbg_cap_sec_entry(uint_t, Xword, Xword, Half);
293 extern	void		Dbg_cap_sec_title(const char *);
294 extern	void		Dbg_ent_print(Half, List * len, Boolean);
295 extern	void		Dbg_file_analyze(Rt_map *);
296 extern	void		Dbg_file_aout(const char *, ulong_t, ulong_t, ulong_t);
297 extern	void		Dbg_file_archive(const char *, int);
298 extern	void		Dbg_file_ar_rescan(void);
299 extern	void		Dbg_file_bind_entry(Bnd_desc *);
300 extern	void		Dbg_file_cntl(Lm_list *, Aliste, Aliste);
301 extern	void		Dbg_file_config_dis(const char *, int);
302 extern	void		Dbg_file_config_obj(const char *, const char *,
303 			    const char *);
304 extern	void		Dbg_file_delete(const char *);
305 extern	void		Dbg_file_dlclose(const char *, int);
306 extern	void		Dbg_file_dldump(const char *, const char *, int);
307 extern	void		Dbg_file_dlopen(const char *, const char *, int);
308 extern	void		Dbg_file_del_rescan(void);
309 extern	void		Dbg_file_elf(const char *, ulong_t, ulong_t, ulong_t,
310 			    ulong_t, Lmid_t, Aliste);
311 extern	void		Dbg_file_filtee(const char *, const char *, int);
312 extern	void		Dbg_file_filter(const char *, const char *, int);
313 extern	void		Dbg_file_fixname(const char *, const char *);
314 extern	void		Dbg_file_generic(Ifl_desc *);
315 extern	void		Dbg_file_hdl_action(Grp_hdl *, Rt_map *, int);
316 extern	void		Dbg_file_hdl_collect(Grp_hdl *, const char *);
317 extern	void		Dbg_file_hdl_title(int);
318 extern	void		Dbg_file_lazyload(const char *, const char *,
319 			    const char *);
320 extern	void		Dbg_file_ldso(const char *, ulong_t, ulong_t, char **,
321 			    auxv_t *);
322 extern	void		Dbg_file_mode_promote(const char *, int);
323 extern	void		Dbg_file_needed(const char *, const char *);
324 extern	void		Dbg_file_nl(void);
325 extern	void		Dbg_file_output(Ofl_desc *);
326 extern	void		Dbg_file_preload(const char *);
327 extern	void		Dbg_file_prot(const char *, int);
328 extern	void		Dbg_file_reuse(const char *, const char *);
329 extern	void		Dbg_file_rejected(Rej_desc *);
330 extern	void		Dbg_file_skip(const char *, const char *);
331 extern	void		Dbg_got_display(Gottable *, Ofl_desc *);
332 extern	void		Dbg_libs_audit(const char *, const char *);
333 extern	void		Dbg_libs_ignore(const char *);
334 extern	void		Dbg_libs_init(List *, List *);
335 extern	void		Dbg_libs_l(const char *, const char *);
336 extern	void		Dbg_libs_path(const char *, Half, const char *);
337 extern	void		Dbg_libs_req(const char *, const char *, const char *);
338 extern	void		Dbg_libs_update(List *, List *);
339 extern	void		Dbg_libs_yp(const char *);
340 extern	void		Dbg_libs_ylu(const char *, const char *, int);
341 extern	void		Dbg_libs_find(const char *);
342 extern	void		Dbg_libs_found(const char *, int);
343 extern	void		Dbg_map_atsign(Boolean);
344 extern	void		Dbg_map_dash(const char *, Sdf_desc *);
345 extern	void		Dbg_map_ent(Boolean, Ent_desc *, Ofl_desc *);
346 extern	void		Dbg_map_equal(Boolean);
347 extern	void		Dbg_map_parse(const char *);
348 extern	void		Dbg_map_pipe(Sg_desc *, const char *, const Word);
349 extern	void		Dbg_map_seg(Half, int, Sg_desc *);
350 extern	void		Dbg_map_size_new(const char *);
351 extern	void		Dbg_map_size_old(Ehdr *, Sym_desc *);
352 extern	void		Dbg_map_sort_fini(Sg_desc *);
353 extern	void		Dbg_map_sort_orig(Sg_desc *);
354 extern	void		Dbg_map_symbol(Ehdr *, Sym_desc *);
355 extern	void		Dbg_map_version(const char *, const char *, int);
356 extern 	void		Dbg_move_adjexpandreloc(ulong_t, const char *);
357 extern 	void		Dbg_move_adjmovereloc(ulong_t, ulong_t, const char *);
358 extern	void		Dbg_move_data(const char *);
359 extern 	void		Dbg_move_expanding(Move *, Addr);
360 extern 	void		Dbg_move_input1(const char *);
361 extern 	void		Dbg_move_mventry(int, Move *, Sym_desc *);
362 extern 	void		Dbg_move_mventry2(Move *, Word, char *);
363 extern 	void		Dbg_move_outmove(const uchar_t *);
364 extern 	void		Dbg_move_outsctadj(Sym_desc *);
365 extern 	void		Dbg_move_parexpn(const char *, const char *);
366 #if	defined(_ELF64)
367 extern	void		Dbg_pltpad_bindto64(const char *, const char *, Addr);
368 extern	void		Dbg_pltpad_boundto64(const char *, Addr, const char *,
369 			    const char *);
370 #endif
371 extern	void		Dbg_reloc_apply(unsigned long long, unsigned long long);
372 extern	void		Dbg_reloc_discard(Half, Rel_desc *);
373 extern	void		Dbg_reloc_error(Half, Word, void *, const char *,
374 			    const char *);
375 extern	void		Dbg_reloc_generate(Os_desc *, Word);
376 extern	void		Dbg_reloc_reg_apply(unsigned long long,
377 			    unsigned long long);
378 extern	void		Dbg_reloc_in(Half, Word, void *, const char *,
379 			    const char *);
380 extern	void		Dbg_reloc_out(Half, Word, void *, const char *,
381 			    const char *);
382 extern	void		Dbg_reloc_proc(Os_desc *, Is_desc *, Is_desc *);
383 extern	void		Dbg_reloc_ars_entry(Half, Rel_desc *);
384 extern	void		Dbg_reloc_ors_entry(Half, Rel_desc *);
385 extern	void		Dbg_reloc_doactiverel(void);
386 extern	void		Dbg_reloc_doact(Half, Word, Xword, Xword, const char *,
387 			    Os_desc *);
388 extern	void		Dbg_reloc_dooutrel(GElf_Word);
389 extern	void		Dbg_reloc_copy(const char *, const char *,
390 			    const char *, int);
391 extern	void		Dbg_reloc_run(const char *, uint_t, int, int);
392 extern	void		Dbg_reloc_transition(Half, Word, Word, Xword,
393 			    const char *);
394 extern	void		Dbg_sec_added(Os_desc *, Sg_desc *);
395 extern	void		Dbg_sec_created(Os_desc *, Sg_desc *);
396 extern	void		Dbg_sec_discarded(Is_desc *, Is_desc *);
397 extern	void		Dbg_sec_group(Is_desc *, Group_desc *);
398 extern	void		Dbg_sec_in(Is_desc *);
399 extern	void		Dbg_sec_order_list(Ofl_desc *, int);
400 extern	void		Dbg_sec_order_error(Ifl_desc *, Word, int);
401 extern	void		Dbg_sec_strtab(Os_desc *, Str_tbl *);
402 extern	void		Dbg_seg_entry(Half, int, Sg_desc *);
403 extern	void		Dbg_seg_list(Half, List *);
404 extern	void		Dbg_seg_os(Ofl_desc *, Os_desc *, int);
405 extern	void		Dbg_seg_title(void);
406 extern	void		Dbg_support_action(const char *, const char *,
407 			    Support_ndx, const char *);
408 extern	void		Dbg_support_load(const char *, const char *);
409 extern	void		Dbg_support_req(const char *, int);
410 extern	void		Dbg_syms_ar_checking(Xword, Elf_Arsym *, const char *);
411 extern	void		Dbg_syms_ar_entry(Xword, Elf_Arsym *);
412 extern	void		Dbg_syms_ar_resolve(Xword, Elf_Arsym *, const char *,
413 			    int);
414 extern	void		Dbg_syms_ar_title(const char *, int);
415 extern	void		Dbg_syms_created(const char *);
416 extern	void		Dbg_syms_discarded(Sym_desc *, Is_desc *);
417 extern	void		Dbg_syms_entered(Ehdr *, Sym *, Sym_desc *);
418 extern	void		Dbg_syms_entry(Xword, Sym_desc *);
419 extern	void		Dbg_syms_global(Xword, const char *);
420 extern	void		Dbg_syms_ignore(Ehdr *, Sym_desc *);
421 extern	void		Dbg_syms_lazy_rescan(const char *);
422 extern	void		Dbg_syms_new(Ehdr *, Sym *, Sym_desc *);
423 extern	void		Dbg_syms_nl(void);
424 extern	void		Dbg_syms_old(Ehdr *, Sym_desc *);
425 extern	void		Dbg_syms_process(Ifl_desc *);
426 extern	void		Dbg_syms_reduce(int, Ehdr *, Sym_desc *, int,
427 			    const char *);
428 extern	void		Dbg_syms_reloc(Ehdr *, Sym_desc *);
429 extern	void		Dbg_syms_resolved(Ehdr *, Sym_desc *);
430 extern	void		Dbg_syms_resolving1(Xword, const char *, int, int);
431 extern	void		Dbg_syms_resolving2(Ehdr *, Sym *, Sym *, Sym_desc *,
432 			    Ifl_desc *);
433 extern	void		Dbg_syms_sec_entry(int, Sg_desc *, Os_desc *);
434 extern	void		Dbg_syms_sec_title(void);
435 extern	void		Dbg_syms_spec_title(void);
436 extern	void		Dbg_syms_up_title(Ehdr *);
437 extern	void		Dbg_syms_updated(Ehdr *, Sym_desc *, const char *);
438 extern	void		Dbg_syms_dlsym(const char *, const char *, const char *,
439 			    int);
440 extern	void		Dbg_syms_lookup_aout(const char *);
441 extern	void		Dbg_syms_lookup(const char *, const char *,
442 			    const char *);
443 extern	void		Dbg_scc_title(int);
444 extern	void		Dbg_scc_entry(uint_t, 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_dbnotify(rd_event_e, r_state_e);
469 extern	void		Dbg_util_intoolate(const char *);
470 extern	void		Dbg_util_nl(void);
471 extern	void		Dbg_util_no_init(const char *);
472 extern	void		Dbg_util_str(const char *);
473 extern	void		Dbg_util_wait(int, const char *, const char *);
474 extern	void		Dbg_ver_avail_entry(Ver_index *, const char *);
475 extern	void		Dbg_ver_avail_title(const char *);
476 extern	void		Dbg_ver_desc_entry(Ver_desc *);
477 extern	void		Dbg_ver_def_title(const char *);
478 extern	void		Dbg_ver_need_title(const char *);
479 extern	void		Dbg_ver_need_entry(Half, const char *, const char *);
480 extern	void		Dbg_ver_nointerface(const char *);
481 extern	void		Dbg_ver_symbol(const char *);
482 
483 /*
484  * External interface routines. These are not linker specific and provide
485  * generic routines for interpreting elf structures.
486  */
487 #ifdef _ELF64
488 #define	Elf_phdr_entry		Gelf_phdr_entry
489 #define	Elf_shdr_entry		Gelf_shdr_entry
490 #define	Elf_sym_table_entry	Gelf_sym_table_entry
491 #else	/* elf32 */
492 extern	void		Elf_phdr_entry(Half, Elf32_Phdr *);
493 extern	void		Elf_shdr_entry(Half, Elf32_Shdr *);
494 extern	void		Elf_sym_table_entry(const char *, Elf32_Ehdr *,
495 			    Elf32_Sym *, Elf32_Word, const char *,
496 			    const char *);
497 #endif /* _ELF64 */
498 
499 /*
500  * These are used by both the Elf32 and Elf64 sides.
501  */
502 extern	const char	*Gelf_sym_dem(const char *);
503 
504 extern	void		Gelf_cap_print(GElf_Cap *, int, Half);
505 extern	void		Gelf_cap_title(void);
506 extern	void		Gelf_phdr_entry(Half, GElf_Phdr *);
507 extern	void		Gelf_shdr_entry(Half, GElf_Shdr *);
508 extern	void		Gelf_sym_table_entry(const char *, GElf_Ehdr *,
509 			    GElf_Sym *, GElf_Word, const char *, const char *);
510 extern	void		Gelf_elf_data_title(void);
511 extern	void		Gelf_syminfo_entry(int, GElf_Syminfo *, const char *,
512 			    const char *);
513 extern	void		Gelf_sym_table_title(GElf_Ehdr *, const char *,
514 			    const char *);
515 extern	void		Gelf_ver_def_title(void);
516 extern	void		Gelf_ver_need_title(void);
517 extern	void		Gelf_ver_line_1(const char *, const char *,
518 			    const char *, const char *);
519 extern	void		Gelf_ver_line_2(const char *, const char *);
520 extern	void		Gelf_ver_line_3(const char *, const char *,
521 			    const char *);
522 
523 extern	void		Gelf_dyn_print(GElf_Dyn *, int ndx, const char *, Half);
524 extern	void		Gelf_dyn_title(void);
525 extern	void		Gelf_elf_header(GElf_Ehdr *, GElf_Shdr *);
526 extern	void		Gelf_got_title(uchar_t);
527 extern	void		Gelf_got_entry(GElf_Ehdr *, Sword, GElf_Addr,
528 			    GElf_Xword, GElf_Word, void *, const char *);
529 extern	void		Gelf_reloc_entry(const char *, GElf_Half, GElf_Word,
530 			    GElf_Rela *, const char *, const char *);
531 extern	void		Gelf_syminfo_title(void);
532 
533 #ifdef	__cplusplus
534 }
535 #endif
536 
537 #endif /* _DEBUG_H */
538