xref: /illumos-gate/usr/src/cmd/sgs/libld/common/_libld.h (revision 40cb5e5daa7b80bb70fcf8dadfb20f9281566331)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  *	Copyright (c) 1988 AT&T
24  *	  All Rights Reserved
25  *
26  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
27  * Use is subject to license terms.
28  */
29 
30 /*
31  * Local include file for ld library.
32  */
33 
34 #ifndef	_LIBLD_DOT_H
35 #define	_LIBLD_DOT_H
36 
37 #pragma ident	"%Z%%M%	%I%	%E% SMI"
38 
39 #include <libld.h>
40 #include <_libelf.h>
41 #include <debug.h>
42 #include <conv.h>
43 #include <msg.h>
44 
45 #ifdef	__cplusplus
46 extern "C" {
47 #endif
48 
49 /*
50  * Types of segment index.
51  */
52 typedef enum {
53 	LD_PHDR,	LD_INTERP,	LD_SUNWCAP,	LD_TEXT,
54 	LD_DATA,	LD_BSS,
55 #if	(defined(__i386) || defined(__amd64)) && defined(_ELF64)
56 	LD_LRODATA,	LD_LDATA,
57 #endif
58 	LD_DYN,		LD_DTRACE,	 LD_NOTE,	LD_SUNWBSS,
59 	LD_TLS,
60 #if	(defined(__i386) || defined(__amd64)) && defined(_ELF64)
61 	LD_UNWIND,
62 #endif
63 	LD_EXTRA,
64 	LD_NUM
65 } Segment_ndx;
66 
67 /*
68  * Types of bss sections
69  */
70 typedef enum {
71 	MAKE_BSS,
72 	MAKE_LBSS,
73 	MAKE_TLS
74 } Bss_Type;
75 
76 /*
77  * Structure to manage the update of weak symbols from their associated alias.
78  */
79 typedef	struct wk_desc {
80 	Sym		*wk_symtab;	/* the .symtab entry */
81 	Sym		*wk_dynsym;	/* the .dynsym entry */
82 	Sym_desc	*wk_weak;	/* the original weak symbol */
83 	Sym_desc	*wk_alias;	/* the real symbol */
84 } Wk_desc;
85 
86 /*
87  * Structure to manage the support library interfaces.
88  */
89 typedef struct func_list {
90 	const char	*fl_obj;	/* name of support object */
91 					/*	function is from */
92 	void		(*fl_fptr)();	/* function pointer */
93 	uint_t		fl_version;	/* ld_version() level */
94 } Func_list;
95 
96 typedef	struct support_list {
97 	const char	*sup_name;	/* ld_support function name */
98 	List		sup_funcs;	/* list of support functions */
99 } Support_list;
100 
101 /*
102  * Structure to manage a sorted output relocation list.
103  *
104  *	rl_key1		->	pointer to needed ndx
105  *	rl_key2		->	pointer to symbol relocation is against
106  *	rl_key3		->	virtual offset of relocation
107  */
108 typedef struct reloc_list {
109 	Sym_desc	*rl_key2;
110 	Xword		rl_key3;
111 	Rel_desc	*rl_rsp;
112 	Half		rl_key1;
113 } Reloc_list;
114 
115 
116 typedef struct sym_s_list {
117 	Word		sl_hval;
118 	Sym_desc *	sl_sdp;
119 } Sym_s_list;
120 
121 /*
122  * ld heap management structure
123  */
124 typedef struct _ld_heap Ld_heap;
125 struct _ld_heap {
126 	Ld_heap		*lh_next;
127 	void		*lh_free;
128 	void		*lh_end;
129 };
130 
131 #define	HEAPBLOCK	0x68000		/* default allocation block size */
132 #define	HEAPALIGN	0x8		/* heap blocks alignment requirement */
133 
134 /*
135  * Dynamic per-symbol filtee string table descriptor.  This associates filtee
136  * strings that will be created in the .dynstr, with .dynamic entries.
137  */
138 typedef struct {
139 	char		*dft_str;	/* dynstr string */
140 	Word		dft_flag;	/* auxiliary/filtee type */
141 	Half		dft_ndx;	/* eventual ndx into .dynamic */
142 } Dfltr_desc;
143 
144 /*
145  * Per-symbol filtee descriptor.  This associates symbol definitions with
146  * their filtees.
147  */
148 typedef struct {
149 	Sym_desc	*sft_sdp;	/* symbol descriptor */
150 	Aliste		sft_off;	/* offset into dtstr descriptor */
151 } Sfltr_desc;
152 
153 /*
154  * Define Alist initialization sizes.
155  */
156 #define	AL_CNT_DFLTR	4		/* ofl_dtsfltrs initial alist count */
157 #define	AL_CNT_GROUP	20		/* ifl_groups initial alist count */
158 #define	AL_CNT_SFLTR	20		/* ofl_symfltrs initial alist count */
159 #define	AL_CNT_OSDESC	40		/* sg_osdescs initial alist count */
160 #define	AL_CNT_SECORDER	40		/* sg_secorder initial alist count */
161 
162 /*
163  * Return codes for {tls|got}_fixups() routines
164  */
165 typedef enum {
166 	FIX_ERROR,	/* fatal error - time to punt */
167 	FIX_DONE,	/* relocation done - no further processing required */
168 	FIX_RELOC	/* do_reloc() relocation processing required */
169 } Fixupret;
170 
171 #ifndef	FILENAME_MAX
172 #define	FILENAME_MAX	BUFSIZ		/* maximum length of a path name */
173 #endif
174 
175 /*
176  * Relocation buckets are sized based on the number of input relocations and
177  * the following constants.
178  */
179 #define	REL_HAIDESCNO	1000		/* high water mark active buckets */
180 #define	REL_LAIDESCNO	50		/* low water mark active buckets */
181 #define	REL_HOIDESCNO	500		/* high water mark output buckets */
182 #define	REL_LOIDESCNO	10		/* low water mark output buckets */
183 
184 extern char		*Plibpath;
185 extern char		*Llibdir;
186 extern char		*Ulibdir;
187 extern Ld_heap		*ld_heap;
188 extern List		lib_support;
189 extern int		demangle_flag;
190 extern const Msg	reject[];
191 extern int		Verbose;
192 
193 /*
194  * For backward compatibility provide a /dev/zero file descriptor.
195  */
196 extern int		dz_fd;
197 
198 /*
199  * Local functions.
200  */
201 extern char		*add_string(char *, char *);
202 extern const char	*demangle(const char *);
203 
204 extern void		lds_atexit(Ofl_desc *, int);
205 
206 extern void		libld_free(void *);
207 extern void		*libld_malloc(size_t);
208 extern void		*libld_realloc(void *, size_t);
209 
210 extern Listnode		*list_appendc(List *, const void *);
211 extern Listnode		*list_insertc(List *, const void *, Listnode *);
212 extern Listnode		*list_prependc(List *, const void *);
213 extern Listnode		*list_where(List *, Word num);
214 
215 extern Sdf_desc		*sdf_add(const char *, List *);
216 extern Sdf_desc		*sdf_find(const char *, List *);
217 
218 #if	defined(_ELF64)
219 
220 #define	ld_add_actrel		ld64_add_actrel
221 #define	ld_add_libdir		ld64_add_libdir
222 #define	ld_add_outrel		ld64_add_outrel
223 #define	ld_adj_movereloc	ld64_adj_movereloc
224 #define	ld_am_I_partial		ld64_am_I_partial
225 #define	ld_ar_member		ld64_ar_member
226 #define	ld_ar_setup		ld64_ar_setup
227 #if	defined(sparc)
228 #define	ld_allocate_got		ld64_allocate_got
229 #endif
230 #define	ld_assign_got		ld64_assign_got
231 #define	ld_assign_got_ndx	ld64_assign_got_ndx
232 #define	ld_assign_got_TLS	ld64_assign_got_TLS
233 #define	ld_assign_plt_ndx	ld64_assign_plt_ndx
234 #define	ld_calc_got_offset	ld64_calc_got_offset
235 #define	ld_calc_plt_addr	ld64_calc_plt_addr
236 #define	ld_disp_errmsg		ld64_disp_errmsg
237 #define	ld_do_activerelocs	ld64_do_activerelocs
238 #define	ld_ent_check		ld64_ent_check
239 #define	ld_exit			ld64_exit
240 #define	ld_fillin_gotplt	ld64_fillin_gotplt
241 #define	ld_find_gotndx		ld64_find_gotndx
242 #define	ld_find_library		ld64_find_library
243 #define	ld_finish_libs		ld64_finish_libs
244 #define	ld_get_group		ld64_get_group
245 #define	ld_lib_setup		ld64_lib_setup
246 #define	ld_init			ld64_init
247 #define	ld_init_rel		ld64_init_rel
248 #define	ld_is_regsym		ld64_is_regsym
249 #define	ld_lcm			ld64_lcm
250 #define	ld_mach_update_odynamic	ld64_mach_update_odynamic
251 #define	ld_mach_eflags		ld64_mach_eflags
252 #define	ld_mach_make_dynamic	ld64_mach_make_dynamic
253 #define	ld_mach_sym_typecheck	ld64_mach_sym_typecheck
254 #define	ld_make_bss		ld64_make_bss
255 #define	ld_make_data		ld64_make_data
256 #define	ld_make_got		ld64_make_got
257 #define	ld_make_sunwbss		ld64_make_sunwbss
258 #define	ld_make_sunwdata	ld64_make_sunwdata
259 #define	ld_make_sunwmove	ld64_make_sunmove
260 #define	ld_make_text		ld64_make_text
261 #define	ld_map_out		ld64_map_out
262 #define	ld_map_parse		ld64_map_parse
263 #define	ld_open_outfile		ld64_open_outfile
264 #define	ld_perform_outreloc	ld64_perform_outreloc
265 #define	ld_place_section	ld64_place_section
266 #define	ld_process_archive	ld64_process_archive
267 #define	ld_process_files	ld64_process_files
268 #define	ld_process_flags	ld64_process_flags
269 #define	ld_process_ifl		ld64_process_ifl
270 #define	ld_process_ordered	ld64_process_ordered
271 #define	ld_process_sym_reloc	ld64_process_sym_reloc
272 #define	ld_reloc_local		ld64_reloc_local
273 #define	ld_reloc_GOT_relative	ld64_reloc_GOT_relative
274 #define	ld_reloc_GOTOP		ld64_reloc_GOTOP
275 #define	ld_reloc_plt		ld64_reloc_plt
276 #define	ld_reloc_register	ld64_reloc_register
277 #define	ld_reloc_remain_entry	ld64_reloc_remain_entry
278 #define	ld_reloc_TLS		ld64_reloc_TLS
279 #define	ld_reg_check		ld64_reg_check
280 #define	ld_reg_enter		ld64_reg_enter
281 #define	ld_reg_find		ld64_reg_find
282 #define	ld_sec_validate		ld64_sec_validate
283 #define	ld_sort_ordered		ld64_sort_ordered
284 #define	ld_sort_seg_list	ld64_sort_seg_list
285 #define	ld_sunwmove_preprocess	ld64_sunwmove_preprocess
286 #define	ld_sup_atexit		ld64_sup_atexit
287 #define	ld_sup_file		ld64_sup_file
288 #define	ld_sup_loadso		ld64_sup_loadso
289 #define	ld_sup_input_done	ld64_sup_input_done
290 #define	ld_sup_input_section	ld64_sup_input_section
291 #define	ld_sup_section		ld64_sup_section
292 #define	ld_sup_start		ld64_sup_start
293 #define	ld_sym_add_u		ld64_sym_add_u
294 #define	ld_sym_adjust_vis	ld64_sym_adjust_vis
295 #define	ld_sym_avl_comp		ld64_sym_avl_comp
296 #define	ld_sym_copy		ld64_sym_copy
297 #define	ld_sym_enter		ld64_sym_enter
298 #define	ld_sym_find		ld64_sym_find
299 #define	ld_sym_nodirect		ld64_sym_nodirect
300 #define	ld_sym_process		ld64_sym_process
301 #define	ld_sym_resolve		ld64_sym_resolve
302 #define	ld_sym_spec		ld64_sym_spec
303 #define	ld_vers_base		ld64_vers_base
304 #define	ld_vers_check_defs	ld64_vers_check_defs
305 #define	ld_vers_check_need	ld64_vers_check_need
306 #define	ld_vers_def_process	ld64_vers_def_process
307 #define	ld_vers_desc		ld64_vers_desc
308 #define	ld_vers_find		ld64_vers_find
309 #define	ld_vers_need_process	ld64_vers_need_process
310 #define	ld_vers_promote		ld64_vers_promote
311 #define	ld_vers_sym_process	ld64_vers_sym_process
312 #define	ld_vers_verify		ld64_vers_verify
313 
314 #else
315 
316 #define	ld_add_actrel		ld32_add_actrel
317 #define	ld_add_libdir		ld32_add_libdir
318 #define	ld_add_outrel		ld32_add_outrel
319 #define	ld_adj_movereloc	ld32_adj_movereloc
320 #define	ld_am_I_partial		ld32_am_I_partial
321 #define	ld_ar_member		ld32_ar_member
322 #define	ld_ar_setup		ld32_ar_setup
323 #if	defined(sparc)
324 #define	ld_allocate_got		ld32_allocate_got
325 #endif
326 #define	ld_assign_got		ld32_assign_got
327 #define	ld_assign_got_ndx	ld32_assign_got_ndx
328 #define	ld_assign_got_TLS	ld32_assign_got_TLS
329 #define	ld_assign_plt_ndx	ld32_assign_plt_ndx
330 #define	ld_calc_got_offset	ld32_calc_got_offset
331 #define	ld_calc_plt_addr	ld32_calc_plt_addr
332 #define	ld_disp_errmsg		ld32_disp_errmsg
333 #define	ld_do_activerelocs	ld32_do_activerelocs
334 #define	ld_ent_check		ld32_ent_check
335 #define	ld_exit			ld32_exit
336 #define	ld_fillin_gotplt	ld32_fillin_gotplt
337 #define	ld_find_gotndx		ld32_find_gotndx
338 #define	ld_find_library		ld32_find_library
339 #define	ld_finish_libs		ld32_finish_libs
340 #define	ld_get_group		ld32_get_group
341 #define	ld_lib_setup		ld32_lib_setup
342 #define	ld_init			ld32_init
343 #define	ld_init_rel		ld32_init_rel
344 #define	ld_is_regsym		ld32_is_regsym
345 #define	ld_lcm			ld32_lcm
346 #define	ld_mach_update_odynamic	ld32_mach_update_odynamic
347 #define	ld_mach_eflags		ld32_mach_eflags
348 #define	ld_mach_make_dynamic	ld32_mach_make_dynamic
349 #define	ld_mach_sym_typecheck	ld32_mach_sym_typecheck
350 #define	ld_make_bss		ld32_make_bss
351 #define	ld_make_data		ld32_make_data
352 #define	ld_make_got		ld32_make_got
353 #define	ld_make_sunwbss		ld32_make_sunwbss
354 #define	ld_make_sunwdata	ld32_make_sunwdata
355 #define	ld_make_sunwmove	ld32_make_sunmove
356 #define	ld_make_text		ld32_make_text
357 #define	ld_map_out		ld32_map_out
358 #define	ld_map_parse		ld32_map_parse
359 #define	ld_open_outfile		ld32_open_outfile
360 #define	ld_perform_outreloc	ld32_perform_outreloc
361 #define	ld_place_section	ld32_place_section
362 #define	ld_process_archive	ld32_process_archive
363 #define	ld_process_files	ld32_process_files
364 #define	ld_process_flags	ld32_process_flags
365 #define	ld_process_ifl		ld32_process_ifl
366 #define	ld_process_ordered	ld32_process_ordered
367 #define	ld_process_sym_reloc	ld32_process_sym_reloc
368 #define	ld_reloc_local		ld32_reloc_local
369 #define	ld_reloc_GOT_relative	ld32_reloc_GOT_relative
370 #define	ld_reloc_GOTOP		ld32_reloc_GOTOP
371 #define	ld_reloc_plt		ld32_reloc_plt
372 #define	ld_reloc_register	ld32_reloc_register
373 #define	ld_reloc_remain_entry	ld32_reloc_remain_entry
374 #define	ld_reloc_TLS		ld32_reloc_TLS
375 #define	ld_reg_check		ld32_reg_check
376 #define	ld_reg_enter		ld32_reg_enter
377 #define	ld_reg_find		ld32_reg_find
378 #define	ld_sec_validate		ld32_sec_validate
379 #define	ld_sort_ordered		ld32_sort_ordered
380 #define	ld_sort_seg_list	ld32_sort_seg_list
381 #define	ld_sunwmove_preprocess	ld32_sunwmove_preprocess
382 #define	ld_sup_atexit		ld32_sup_atexit
383 #define	ld_sup_file		ld32_sup_file
384 #define	ld_sup_loadso		ld32_sup_loadso
385 #define	ld_sup_input_done	ld32_sup_input_done
386 #define	ld_sup_input_section	ld32_sup_input_section
387 #define	ld_sup_section		ld32_sup_section
388 #define	ld_sup_start		ld32_sup_start
389 #define	ld_sym_add_u		ld32_sym_add_u
390 #define	ld_sym_adjust_vis	ld32_sym_adjust_vis
391 #define	ld_sym_avl_comp		ld32_sym_avl_comp
392 #define	ld_sym_copy		ld32_sym_copy
393 #define	ld_sym_enter		ld32_sym_enter
394 #define	ld_sym_find		ld32_sym_find
395 #define	ld_sym_nodirect		ld32_sym_nodirect
396 #define	ld_sym_process		ld32_sym_process
397 #define	ld_sym_resolve		ld32_sym_resolve
398 #define	ld_sym_spec		ld32_sym_spec
399 #define	ld_vers_base		ld32_vers_base
400 #define	ld_vers_check_defs	ld32_vers_check_defs
401 #define	ld_vers_check_need	ld32_vers_check_need
402 #define	ld_vers_def_process	ld32_vers_def_process
403 #define	ld_vers_desc		ld32_vers_desc
404 #define	ld_vers_find		ld32_vers_find
405 #define	ld_vers_need_process	ld32_vers_need_process
406 #define	ld_vers_promote		ld32_vers_promote
407 #define	ld_vers_sym_process	ld32_vers_sym_process
408 #define	ld_vers_verify		ld32_vers_verify
409 
410 #endif
411 
412 extern uintptr_t	dbg_setup(const char *, Dbg_desc *, const char **, int);
413 
414 extern uintptr_t	ld_add_actrel(Word, Rel_desc *, Ofl_desc *);
415 extern uintptr_t	ld_add_libdir(Ofl_desc *, const char *);
416 extern uintptr_t	ld_add_outrel(Word, Rel_desc *, Ofl_desc *);
417 extern void 		ld_adj_movereloc(Ofl_desc *, Rel_desc *);
418 extern Sym_desc * 	ld_am_I_partial(Rel_desc *, Xword);
419 extern void		ld_ar_member(Ar_desc *, Elf_Arsym *, Ar_aux *,
420 			    Ar_mem *);
421 extern Ar_desc		*ld_ar_setup(const char *, Elf *, Ofl_desc *);
422 #if	defined(sparc)
423 extern uintptr_t	ld_allocate_got(Ofl_desc *);
424 #endif
425 extern uintptr_t	ld_assign_got(Ofl_desc *, Sym_desc *);
426 extern uintptr_t	ld_assign_got_ndx(List *, Gotndx *, Gotref, Ofl_desc *,
427 			    Rel_desc *, Sym_desc *);
428 extern uintptr_t	ld_assign_got_TLS(Boolean, Rel_desc *, Ofl_desc *,
429 			    Sym_desc *, Gotndx *, Gotref, Word, Word,
430 			    Word, Word);
431 extern void		ld_assign_plt_ndx(Sym_desc *, Ofl_desc *);
432 
433 extern Xword		ld_calc_got_offset(Rel_desc *, Ofl_desc *);
434 extern Xword		ld_calc_plt_addr(Sym_desc *, Ofl_desc *);
435 
436 extern void		ld_disp_errmsg(const char *, Rel_desc *, Ofl_desc *);
437 extern uintptr_t	ld_do_activerelocs(Ofl_desc *);
438 
439 extern void		ld_ent_check(Ofl_desc *);
440 extern int		ld_exit(Ofl_desc *);
441 
442 extern uintptr_t	ld_fillin_gotplt(Ofl_desc *);
443 extern Gotndx *		ld_find_gotndx(List *, Gotref, Ofl_desc *, Rel_desc *);
444 extern uintptr_t	ld_find_library(const char *, Ofl_desc *);
445 extern uintptr_t	ld_finish_libs(Ofl_desc *);
446 
447 extern Group_desc *	ld_get_group(Ofl_desc *, Is_desc *);
448 
449 extern uintptr_t	ld_lib_setup(Ofl_desc *);
450 
451 extern void		ld_init(Ofl_desc *);
452 extern Word		ld_init_rel(Rel_desc *, void *);
453 extern const char	*ld_is_regsym(Ofl_desc *, Ifl_desc *, Sym *,
454 			    const char *, int, Word, const char *, Word *);
455 
456 extern Xword		ld_lcm(Xword, Xword);
457 
458 extern void		ld_mach_update_odynamic(Ofl_desc *, Dyn **);
459 extern void		ld_mach_eflags(Ehdr *, Ofl_desc *);
460 extern void		ld_mach_make_dynamic(Ofl_desc *, size_t *);
461 extern int		ld_mach_sym_typecheck(Sym_desc *, Sym *, Ifl_desc *,
462 			    Ofl_desc *);
463 extern uintptr_t	ld_make_bss(Ofl_desc *, Xword, Xword, Bss_Type);
464 extern Is_desc		*ld_make_data(Ofl_desc *, size_t);
465 extern uintptr_t	ld_make_got(Ofl_desc *);
466 extern uintptr_t	ld_make_sunwbss(Ofl_desc *, size_t, Xword);
467 extern uintptr_t	ld_make_sunwdata(Ofl_desc *, size_t, Xword);
468 extern uintptr_t	ld_make_sunwmove(Ofl_desc *, int);
469 extern Is_desc		*ld_make_text(Ofl_desc *, size_t);
470 extern void		ld_map_out(Ofl_desc *);
471 extern uintptr_t	ld_map_parse(const char *, Ofl_desc *);
472 
473 extern uintptr_t	ld_open_outfile(Ofl_desc *);
474 
475 extern uintptr_t	ld_perform_outreloc(Rel_desc *, Ofl_desc *);
476 extern Os_desc *	ld_place_section(Ofl_desc *, Is_desc *, int, Word);
477 extern uintptr_t	ld_process_archive(const char *, int, Ar_desc *,
478 			    Ofl_desc *);
479 extern uintptr_t	ld_process_files(Ofl_desc *, int, char **);
480 extern uintptr_t	ld_process_flags(Ofl_desc *, int, char **);
481 extern Ifl_desc		*ld_process_ifl(const char *, const char *, int, Elf *,
482 			    Half, Ofl_desc *, Rej_desc *);
483 extern uintptr_t	ld_process_ordered(Ifl_desc *, Ofl_desc *, Word, Word);
484 extern uintptr_t	ld_process_sym_reloc(Ofl_desc *, Rel_desc *, Rel *,
485 			    Is_desc *, const char *);
486 
487 extern uintptr_t	ld_reloc_local(Rel_desc *, Ofl_desc *);
488 extern uintptr_t	ld_reloc_GOT_relative(Boolean, Rel_desc *, Ofl_desc *);
489 extern uintptr_t	ld_reloc_GOTOP(Boolean, Rel_desc *, Ofl_desc *);
490 extern uintptr_t	ld_reloc_plt(Rel_desc *, Ofl_desc *);
491 extern uintptr_t	ld_reloc_register(Rel_desc *, Is_desc *, Ofl_desc *);
492 extern void		ld_reloc_remain_entry(Rel_desc *, Os_desc *,
493 			    Ofl_desc *);
494 extern uintptr_t	ld_reloc_TLS(Boolean, Rel_desc *, Ofl_desc *);
495 
496 extern int		ld_reg_check(Sym_desc *, Sym *, const char *,
497 			    Ifl_desc *, Ofl_desc *);
498 extern int		ld_reg_enter(Sym_desc *, Ofl_desc *);
499 extern Sym_desc *	ld_reg_find(Sym *, Ofl_desc *);
500 
501 extern void		ld_sec_validate(Ofl_desc *);
502 extern uintptr_t	ld_sort_ordered(Ofl_desc *);
503 extern uintptr_t	ld_sort_seg_list(Ofl_desc *);
504 extern uintptr_t	ld_sunwmove_preprocess(Ofl_desc *);
505 extern void		ld_sup_atexit(Ofl_desc *, int);
506 extern void		ld_sup_file(Ofl_desc *, const char *, const Elf_Kind,
507 			    int flags, Elf *);
508 extern uintptr_t	ld_sup_loadso(Ofl_desc *, const char *);
509 extern void		ld_sup_input_done(Ofl_desc *);
510 extern void		ld_sup_section(Ofl_desc *, const char *, Shdr *, Word,
511 			    Elf_Data *, Elf *);
512 extern uintptr_t	ld_sup_input_section(Ofl_desc*, Ifl_desc *,
513 			    const char *, Shdr **, Word, Elf_Scn *, Elf *);
514 extern void		ld_sup_start(Ofl_desc *, const Half, const char *);
515 extern Sym_desc		*ld_sym_add_u(const char *, Ofl_desc *);
516 extern void		ld_sym_adjust_vis(Sym_desc *, Ofl_desc *);
517 extern int		ld_sym_avl_comp(const void *, const void *);
518 extern uintptr_t	ld_sym_copy(Sym_desc *);
519 extern Sym_desc		*ld_sym_enter(const char *, Sym *, Word, Ifl_desc *,
520 			    Ofl_desc *, Word, Word, Word, Half, avl_index_t *);
521 extern Sym_desc		*ld_sym_find(const char *, Word, avl_index_t *,
522 			    Ofl_desc *);
523 extern uintptr_t	ld_sym_nodirect(Is_desc *, Ifl_desc *, Ofl_desc *);
524 extern uintptr_t	ld_sym_process(Is_desc *, Ifl_desc *, Ofl_desc *);
525 extern uintptr_t	ld_sym_resolve(Sym_desc *, Sym *, Ifl_desc *,
526 			    Ofl_desc *, int, Word, Word);
527 extern uintptr_t	ld_sym_spec(Ofl_desc *);
528 
529 extern Ver_desc		*ld_vers_base(Ofl_desc *);
530 extern uintptr_t	ld_vers_check_defs(Ofl_desc *);
531 extern uintptr_t	ld_vers_check_need(Ofl_desc *);
532 extern uintptr_t	ld_vers_def_process(Is_desc *, Ifl_desc *, Ofl_desc *);
533 extern Ver_desc		*ld_vers_desc(const char *, Word, List *);
534 extern Ver_desc		*ld_vers_find(const char *, Word, List *);
535 extern uintptr_t	ld_vers_need_process(Is_desc *, Ifl_desc *, Ofl_desc *);
536 extern void		ld_vers_promote(Sym_desc *, Word, Ifl_desc *,
537 			    Ofl_desc *);
538 extern int		ld_vers_sym_process(Lm_list *, Is_desc *, Ifl_desc *);
539 extern int		ld_vers_verify(Ofl_desc *);
540 
541 extern uintptr_t	add_regsym(Sym_desc *, Ofl_desc *);
542 extern void		*alist_append(Alist **, const void *, size_t, int);
543 extern Word		hashbkts(Word);
544 extern Xword		lcm(Xword, Xword);
545 extern Listnode *	list_where(List *, Word);
546 
547 #if	(defined(__i386) || defined(__amd64)) && defined(_ELF64)
548 extern uintptr_t	append_amd64_unwind(Os_desc *, Ofl_desc *);
549 extern uintptr_t	make_amd64_unwindhdr(Ofl_desc *);
550 extern uintptr_t	populate_amd64_unwindhdr(Ofl_desc *);
551 #endif
552 
553 #ifdef	__cplusplus
554 }
555 #endif
556 
557 #endif /* _LIBLD_DOT_H */
558