134192Sjdp/*-
255687Sjdp * Copyright 1996, 1997, 1998, 1999, 2000 John D. Polstra.
334192Sjdp * All rights reserved.
434192Sjdp *
534192Sjdp * Redistribution and use in source and binary forms, with or without
634192Sjdp * modification, are permitted provided that the following conditions
734192Sjdp * are met:
834192Sjdp * 1. Redistributions of source code must retain the above copyright
934192Sjdp *    notice, this list of conditions and the following disclaimer.
1034192Sjdp * 2. Redistributions in binary form must reproduce the above copyright
1134192Sjdp *    notice, this list of conditions and the following disclaimer in the
1234192Sjdp *    documentation and/or other materials provided with the distribution.
1334192Sjdp *
1434192Sjdp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1534192Sjdp * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1634192Sjdp * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1734192Sjdp * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1834192Sjdp * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1934192Sjdp * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2034192Sjdp * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2134192Sjdp * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2234192Sjdp * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2334192Sjdp * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2434192Sjdp *
2550476Speter * $FreeBSD: stable/10/libexec/rtld-elf/rtld.h 331206 2018-03-19 14:28:58Z marius $
2634192Sjdp */
2734192Sjdp
2834192Sjdp#ifndef RTLD_H /* { */
2934192Sjdp#define RTLD_H 1
3034192Sjdp
3176224Sobrien#include <machine/elf.h>
3234192Sjdp#include <sys/types.h>
3350608Sjdp#include <sys/queue.h>
3434192Sjdp
3576224Sobrien#include <elf-hints.h>
3635529Sdfr#include <link.h>
37225152Skib#include <stdarg.h>
38216695Skib#include <setjmp.h>
3934192Sjdp#include <stddef.h>
4034192Sjdp
41115396Skan#include "rtld_lock.h"
4245501Sjdp#include "rtld_machdep.h"
4345501Sjdp
44127250Speter#ifdef COMPAT_32BIT
45127250Speter#undef STANDARD_LIBRARY_PATH
46127250Speter#undef _PATH_ELF_HINTS
47127250Speter#define	_PATH_ELF_HINTS		"/var/run/ld-elf32.so.hints"
48127250Speter/* For running 32 bit binaries  */
49127250Speter#define	STANDARD_LIBRARY_PATH	"/lib32:/usr/lib32"
50127250Speter#define LD_ "LD_32_"
51127250Speter#endif
52127250Speter
5334192Sjdp#ifndef STANDARD_LIBRARY_PATH
54119013Sgordon#define STANDARD_LIBRARY_PATH	"/lib:/usr/lib"
5534192Sjdp#endif
56127250Speter#ifndef LD_
57127250Speter#define LD_ "LD_"
58127250Speter#endif
5934192Sjdp
6034192Sjdp#define NEW(type)	((type *) xmalloc(sizeof(type)))
61233307Skib#define CNEW(type)	((type *) xcalloc(1, sizeof(type)))
6234192Sjdp
6334192Sjdp/* We might as well do booleans like C++. */
6434192Sjdptypedef unsigned char bool;
6534192Sjdp#define false	0
6634192Sjdp#define true	1
6734192Sjdp
68133063Sdfrextern size_t tls_last_offset;
69133063Sdfrextern size_t tls_last_size;
70133063Sdfrextern size_t tls_static_space;
71133063Sdfrextern int tls_dtv_generation;
72133063Sdfrextern int tls_max_index;
73133063Sdfr
74281452Skibextern int npagesizes;
75281452Skibextern size_t *pagesizes;
76281452Skib
77232831Skibextern int main_argc;
78232831Skibextern char **main_argv;
79232831Skibextern char **environ;
80232831Skib
8150609Sjdpstruct stat;
8234192Sjdpstruct Struct_Obj_Entry;
8334192Sjdp
8455687Sjdp/* Lists of shared objects */
8550608Sjdptypedef struct Struct_Objlist_Entry {
8660938Sjake    STAILQ_ENTRY(Struct_Objlist_Entry) link;
8750608Sjdp    struct Struct_Obj_Entry *obj;
8850608Sjdp} Objlist_Entry;
8950608Sjdp
9060938Sjaketypedef STAILQ_HEAD(Struct_Objlist, Struct_Objlist_Entry) Objlist;
9150608Sjdp
9263870Sjdp/* Types of init and fini functions */
9355687Sjdptypedef void (*InitFunc)(void);
94232831Skibtypedef void (*InitArrFunc)(int, char **, char **);
9555687Sjdp
9655687Sjdp/* Lists of shared object dependencies */
9734192Sjdptypedef struct Struct_Needed_Entry {
9834192Sjdp    struct Struct_Needed_Entry *next;
9934192Sjdp    struct Struct_Obj_Entry *obj;
10034192Sjdp    unsigned long name;		/* Offset of name in string table */
10134192Sjdp} Needed_Entry;
10234192Sjdp
103153515Skantypedef struct Struct_Name_Entry {
104153515Skan    STAILQ_ENTRY(Struct_Name_Entry) link;
105153515Skan    char   name[1];
106153515Skan} Name_Entry;
107153515Skan
10862801Sjdp/* Lock object */
10962801Sjdptypedef struct Struct_LockInfo {
11062801Sjdp    void *context;		/* Client context for creating locks */
11162801Sjdp    void *thelock;		/* The one big lock */
11262801Sjdp    /* Debugging aids. */
11362801Sjdp    volatile int rcount;	/* Number of readers holding lock */
11462801Sjdp    volatile int wcount;	/* Number of writers holding lock */
11562801Sjdp    /* Methods */
11662801Sjdp    void *(*lock_create)(void *context);
11762801Sjdp    void (*rlock_acquire)(void *lock);
11862801Sjdp    void (*wlock_acquire)(void *lock);
11962801Sjdp    void (*rlock_release)(void *lock);
12062801Sjdp    void (*wlock_release)(void *lock);
12162801Sjdp    void (*lock_destroy)(void *lock);
12262801Sjdp    void (*context_destroy)(void *context);
12362801Sjdp} LockInfo;
12462801Sjdp
125153515Skantypedef struct Struct_Ver_Entry {
126153515Skan	Elf_Word     hash;
127153515Skan	unsigned int flags;
128153515Skan	const char  *name;
129153515Skan	const char  *file;
130153515Skan} Ver_Entry;
131153515Skan
132234840Skibtypedef struct Struct_Sym_Match_Result {
133234840Skib    const Elf_Sym *sym_out;
134234840Skib    const Elf_Sym *vsymp;
135234840Skib    int vcount;
136234840Skib} Sym_Match_Result;
137234840Skib
138153515Skan#define VER_INFO_HIDDEN	0x01
139153515Skan
14034192Sjdp/*
14134192Sjdp * Shared object descriptor.
14234192Sjdp *
14334192Sjdp * Items marked with "(%)" are dynamically allocated, and must be freed
14434192Sjdp * when the structure is destroyed.
14550977Sjdp *
14650977Sjdp * CAUTION: It appears that the JDK port peeks into these structures.
14750977Sjdp * It looks at "next" and "mapbase" at least.  Don't add new members
14850977Sjdp * near the front, until this can be straightened out.
14934192Sjdp */
15034192Sjdptypedef struct Struct_Obj_Entry {
15134192Sjdp    /*
15234192Sjdp     * These two items have to be set right for compatibility with the
15334192Sjdp     * original ElfKit crt1.o.
15434192Sjdp     */
155153504Smarcel    Elf_Size magic;		/* Magic number (sanity check) */
156153504Smarcel    Elf_Size version;		/* Version number of struct format */
15734192Sjdp
158296727Skib    TAILQ_ENTRY(Struct_Obj_Entry) next;
15934192Sjdp    char *path;			/* Pathname of underlying file (%) */
160116511Smdodd    char *origin_path;		/* Directory path of origin file */
16134192Sjdp    int refcount;
16234192Sjdp    int dl_refcount;		/* Number of times loaded by dlopen */
16334192Sjdp
16434192Sjdp    /* These items are computed by map_object() or by digest_phdr(). */
16534192Sjdp    caddr_t mapbase;		/* Base address of mapped region */
16634192Sjdp    size_t mapsize;		/* Size of mapped region in bytes */
16734192Sjdp    size_t textsize;		/* Size of text segment in bytes */
16838467Sjb    Elf_Addr vaddrbase;		/* Base address in shared object file */
16934192Sjdp    caddr_t relocbase;		/* Relocation constant = mapbase - vaddrbase */
17038467Sjb    const Elf_Dyn *dynamic;	/* Dynamic section */
17134192Sjdp    caddr_t entry;		/* Entry point */
17238467Sjb    const Elf_Phdr *phdr;	/* Program header if it is mapped, else NULL */
17334192Sjdp    size_t phsize;		/* Size of program header in bytes */
17450610Sjdp    const char *interp;		/* Pathname of the interpreter, if any */
175217153Skib    Elf_Word stack_flags;
17634192Sjdp
177133063Sdfr    /* TLS information */
178133063Sdfr    int tlsindex;		/* Index in DTV for this module */
179133063Sdfr    void *tlsinit;		/* Base address of TLS init block */
180133063Sdfr    size_t tlsinitsize;		/* Size of TLS init block for this module */
181133063Sdfr    size_t tlssize;		/* Size of TLS block for this module */
182133063Sdfr    size_t tlsoffset;		/* Offset of static TLS block for this module */
183133063Sdfr    size_t tlsalign;		/* Alignment of static TLS block */
184133063Sdfr
185230784Skib    caddr_t relro_page;
186230784Skib    size_t relro_size;
187230784Skib
18834192Sjdp    /* Items from the dynamic section. */
18945501Sjdp    Elf_Addr *pltgot;		/* PLT or GOT, depending on architecture */
19038467Sjb    const Elf_Rel *rel;		/* Relocation entries */
19134192Sjdp    unsigned long relsize;	/* Size in bytes of relocation info */
19238816Sdfr    const Elf_Rela *rela;	/* Relocation entries with addend */
19338816Sdfr    unsigned long relasize;	/* Size in bytes of addend relocation info */
19438467Sjb    const Elf_Rel *pltrel;	/* PLT relocation entries */
19534192Sjdp    unsigned long pltrelsize;	/* Size in bytes of PLT relocation info */
19638816Sdfr    const Elf_Rela *pltrela;	/* PLT relocation entries with addend */
19738816Sdfr    unsigned long pltrelasize;	/* Size in bytes of PLT addend reloc info */
19838467Sjb    const Elf_Sym *symtab;	/* Symbol table */
19934192Sjdp    const char *strtab;		/* String table */
20034192Sjdp    unsigned long strsize;	/* Size in bytes of string table */
201177924Simp#ifdef __mips__
202177924Simp    Elf_Word local_gotno;	/* Number of local GOT entries */
203177924Simp    Elf_Word symtabno;		/* Number of dynamic symbols */
204177924Simp    Elf_Word gotsym;		/* First dynamic symbol in GOT */
205177924Simp#endif
20634192Sjdp
207153515Skan    const Elf_Verneed *verneed; /* Required versions. */
208153515Skan    Elf_Word verneednum;	/* Number of entries in verneed table */
209153515Skan    const Elf_Verdef  *verdef;	/* Provided versions. */
210153515Skan    Elf_Word verdefnum;		/* Number of entries in verdef table */
211153515Skan    const Elf_Versym *versyms;  /* Symbol versions table */
212153515Skan
21385004Sdfr    const Elf_Hashelt *buckets;	/* Hash table buckets array */
21434192Sjdp    unsigned long nbuckets;	/* Number of buckets */
21585004Sdfr    const Elf_Hashelt *chains;	/* Hash table chain array */
216234841Skib    unsigned long nchains;	/* Number of entries in chain array */
21734192Sjdp
218234841Skib    Elf32_Word nbuckets_gnu;		/* Number of GNU hash buckets*/
219234841Skib    Elf32_Word symndx_gnu;		/* 1st accessible symbol on dynsym table */
220234841Skib    Elf32_Word maskwords_bm_gnu;  	/* Bloom filter words - 1 (bitmask) */
221234841Skib    Elf32_Word shift2_gnu;		/* Bloom filter shift count */
222234841Skib    Elf32_Word dynsymcount;		/* Total entries in dynsym table */
223234841Skib    Elf_Addr *bloom_gnu;		/* Bloom filter used by GNU hash func */
224234841Skib    const Elf_Hashelt *buckets_gnu;	/* GNU hash table bucket array */
225234841Skib    const Elf_Hashelt *chain_zero_gnu;	/* GNU hash table value array (Zeroed) */
226234841Skib
227189959Skib    char *rpath;		/* Search path specified in object */
228238471Skib    char *runpath;		/* Search path with different priority */
22934192Sjdp    Needed_Entry *needed;	/* Shared objects needed by this one (%) */
230216695Skib    Needed_Entry *needed_filtees;
231216695Skib    Needed_Entry *needed_aux_filtees;
23234192Sjdp
233153515Skan    STAILQ_HEAD(, Struct_Name_Entry) names; /* List of names for this object we
234153515Skan					       know about. */
235153515Skan    Ver_Entry *vertab;		/* Versions required /defined by this object */
236153515Skan    int vernum;			/* Number of entries in vertab */
237153515Skan
23885677Speter    Elf_Addr init;		/* Initialization function to call */
23985677Speter    Elf_Addr fini;		/* Termination function to call */
240232831Skib    Elf_Addr preinit_array;	/* Pre-initialization array of functions */
241232831Skib    Elf_Addr init_array;	/* Initialization array of functions */
242232831Skib    Elf_Addr fini_array;	/* Termination array of functions */
243232831Skib    int preinit_array_num;	/* Number of entries in preinit_array */
244232831Skib    int init_array_num; 	/* Number of entries in init_array */
245232831Skib    int fini_array_num; 	/* Number of entries in fini_array */
24634192Sjdp
247232831Skib    int32_t osrel;		/* OSREL note value */
248232831Skib
249168312Skan    bool mainprog : 1;		/* True if this is the main program */
250168312Skan    bool rtld : 1;		/* True if this is the dynamic linker */
251233231Skib    bool relocated : 1;		/* True if processed by relocate_objects() */
252233546Skib    bool ver_checked : 1;	/* True if processed by rtld_verify_object_versions */
253168312Skan    bool textrel : 1;		/* True if there are relocations to text seg */
254168312Skan    bool symbolic : 1;		/* True if generated with "-Bsymbolic" */
255168312Skan    bool bind_now : 1;		/* True if all relocations should be made first */
256168312Skan    bool traced : 1;		/* Already printed in ldd trace output */
257168312Skan    bool jmpslots_done : 1;	/* Already have relocated the jump slots */
258168312Skan    bool init_done : 1;		/* Already have added object to init list */
259168312Skan    bool tls_done : 1;		/* Already allocated offset for static TLS */
260168312Skan    bool phdr_alloc : 1;	/* Phdr is allocated and needs to be freed. */
261189959Skib    bool z_origin : 1;		/* Process rpath and soname tokens */
262190543Skib    bool z_nodelete : 1;	/* Do not unload the object and dependencies */
263199829Skib    bool z_noopen : 1;		/* Do not load on dlopen */
264216695Skib    bool z_loadfltr : 1;	/* Immediately load filtees */
265256101Skib    bool z_interpose : 1;	/* Interpose all objects but main */
266238471Skib    bool z_nodeflib : 1;	/* Don't search default library path */
267281849Skib    bool z_global : 1;		/* Make the object global */
268194531Skan    bool ref_nodel : 1;		/* Refcount increased to prevent dlclose */
269194531Skan    bool init_scanned: 1;	/* Object is already on init list. */
270194531Skan    bool on_fini_list: 1;	/* Object is already on fini list. */
271214728Skib    bool dag_inited : 1;	/* Object has its DAG initialized. */
272216695Skib    bool filtees_loaded : 1;	/* Filtees loaded */
273228435Skib    bool irelative : 1;		/* Object has R_MACHDEP_IRELATIVE relocs */
274228435Skib    bool gnu_ifunc : 1;		/* Object has references to STT_GNU_IFUNC */
275271469Skib    bool non_plt_gnu_ifunc : 1;	/* Object has non-plt IFUNC references */
276232831Skib    bool crt_no_init : 1;	/* Object' crt does not call _init/_fini */
277234841Skib    bool valid_hash_sysv : 1;	/* A valid System V hash hash tag is available */
278234841Skib    bool valid_hash_gnu : 1;	/* A valid GNU hash tag is available */
279276908Skib    bool dlopened : 1;		/* dlopen()-ed (vs. load statically) */
280296727Skib    bool marker : 1;		/* marker on the global obj list */
28135529Sdfr
282194531Skan    struct link_map linkmap;	/* For GDB and dlinfo() */
28350977Sjdp    Objlist dldags;		/* Object belongs to these dlopened DAGs (%) */
28450977Sjdp    Objlist dagmembers;		/* DAG has these members (%) */
28550977Sjdp    dev_t dev;			/* Object's filesystem's device */
28650977Sjdp    ino_t ino;			/* Object's inode number */
287229780Suqs    void *priv;			/* Platform-dependent */
28834192Sjdp} Obj_Entry;
28934192Sjdp
29034192Sjdp#define RTLD_MAGIC	0xd550b87a
29134192Sjdp#define RTLD_VERSION	1
29234192Sjdp
293296727SkibTAILQ_HEAD(obj_entry_q, Struct_Obj_Entry);
294296727Skib
295192922Sdfr#define RTLD_STATIC_TLS_EXTRA	128
296133063Sdfr
297153515Skan/* Flags to be passed into symlook_ family of functions. */
298153515Skan#define SYMLOOK_IN_PLT	0x01	/* Lookup for PLT symbol */
299228375Skib#define SYMLOOK_DLSYM	0x02	/* Return newest versioned symbol. Used by
300153515Skan				   dlsym. */
301233231Skib#define	SYMLOOK_EARLY	0x04	/* Symlook is done during initialization. */
302271469Skib#define	SYMLOOK_IFUNC	0x08	/* Allow IFUNC processing in
303271469Skib				   reloc_non_plt(). */
304153515Skan
305199829Skib/* Flags for load_object(). */
306199877Skib#define	RTLD_LO_NOLOAD	0x01	/* dlopen() specified RTLD_NOLOAD. */
307199877Skib#define	RTLD_LO_DLOPEN	0x02	/* Load_object() called from dlopen(). */
308199877Skib#define	RTLD_LO_TRACE	0x04	/* Only tracing. */
309216695Skib#define	RTLD_LO_NODELETE 0x08	/* Loaded object cannot be closed. */
310216695Skib#define	RTLD_LO_FILTEES 0x10	/* Loading filtee. */
311233231Skib#define	RTLD_LO_EARLY	0x20	/* Do not call ctors, postpone it to the
312233231Skib				   initialization during the image start. */
313199829Skib
31476296Sjdp/*
31576296Sjdp * Symbol cache entry used during relocation to avoid multiple lookups
31676296Sjdp * of the same symbol.
31776296Sjdp */
31876296Sjdptypedef struct Struct_SymCache {
31976296Sjdp    const Elf_Sym *sym;		/* Symbol table entry */
32076296Sjdp    const Obj_Entry *obj;	/* Shared object which defines it */
32176296Sjdp} SymCache;
32276296Sjdp
323216695Skib/*
324216695Skib * This structure provides a reentrant way to keep a list of objects and
325216695Skib * check which ones have already been processed in some way.
326216695Skib */
327216695Skibtypedef struct Struct_DoneList {
328216695Skib    const Obj_Entry **objs;		/* Array of object pointers */
329216695Skib    unsigned int num_alloc;		/* Allocated size of the array */
330216695Skib    unsigned int num_used;		/* Number of array slots used */
331216695Skib} DoneList;
332216695Skib
333216695Skibstruct Struct_RtldLockState {
334216695Skib	int lockstate;
335218476Skib	sigjmp_buf env;
336216695Skib};
337216695Skib
338238471Skibstruct fill_search_info_args {
339238471Skib	int request;
340238471Skib	unsigned int flags;
341238471Skib	struct dl_serinfo *serinfo;
342238471Skib	struct dl_serpath *serpath;
343238471Skib	char *strspace;
344238471Skib};
345238471Skib
346216695Skib/*
347216695Skib * The pack of arguments and results for the symbol lookup functions.
348216695Skib */
349216695Skibtypedef struct Struct_SymLook {
350216695Skib    const char *name;
351216695Skib    unsigned long hash;
352234841Skib    uint32_t hash_gnu;
353216695Skib    const Ver_Entry *ventry;
354216695Skib    int flags;
355216695Skib    const Obj_Entry *defobj_out;
356216695Skib    const Elf_Sym *sym_out;
357216695Skib    struct Struct_RtldLockState *lockstate;
358216695Skib} SymLook;
359216695Skib
360281453Skibvoid _rtld_error(const char *, ...) __printflike(1, 2) __exported;
361282118Semastevoid rtld_die(void) __dead2;
362233361Skibconst char *rtld_strerror(int);
363233361SkibObj_Entry *map_object(int, const char *, const struct stat *);
364233361Skibvoid *xcalloc(size_t, size_t);
365233361Skibvoid *xmalloc(size_t);
366233361Skibchar *xstrdup(const char *);
367259290Skibvoid *malloc_aligned(size_t size, size_t align);
368259290Skibvoid free_aligned(void *ptr);
36938816Sdfrextern Elf_Addr _GLOBAL_OFFSET_TABLE_[];
370212497Snwhitehornextern Elf_Sym sym_zero;	/* For resolving undefined weak refs. */
37134192Sjdp
372233361Skibvoid dump_relocations(Obj_Entry *);
373233361Skibvoid dump_obj_relocations(Obj_Entry *);
374233361Skibvoid dump_Elf_Rel(Obj_Entry *, const Elf_Rel *, u_long);
375233361Skibvoid dump_Elf_Rela(Obj_Entry *, const Elf_Rela *, u_long);
376116563Smdodd
37738816Sdfr/*
37838816Sdfr * Function declarations.
37938816Sdfr */
38038816Sdfrunsigned long elf_hash(const char *);
38166056Sjdpconst Elf_Sym *find_symdef(unsigned long, const Obj_Entry *,
382216695Skib  const Obj_Entry **, int, SymCache *, struct Struct_RtldLockState *);
383116557Smdoddvoid lockdflt_init(void);
384232831Skibvoid digest_notes(Obj_Entry *, Elf_Addr, Elf_Addr);
385296727SkibObj_Entry *globallist_curr(const Obj_Entry *obj);
386296727SkibObj_Entry *globallist_next(const Obj_Entry *obj);
38750608Sjdpvoid obj_free(Obj_Entry *);
38850608SjdpObj_Entry *obj_new(void);
38945501Sjdpvoid _rtld_bind_start(void);
390228435Skibvoid *rtld_resolve_ifunc(const Obj_Entry *obj, const Elf_Sym *def);
391216695Skibvoid symlook_init(SymLook *, const char *);
392216695Skibint symlook_obj(SymLook *, const Obj_Entry *);
393133063Sdfrvoid *tls_get_addr_common(Elf_Addr** dtvp, int index, size_t offset);
394133063Sdfrvoid *allocate_tls(Obj_Entry *, void *, size_t, size_t);
395133063Sdfrvoid free_tls(void *, size_t, size_t);
396133063Sdfrvoid *allocate_module_tls(int index);
397133063Sdfrbool allocate_tls_offset(Obj_Entry *obj);
398142645Sdfrvoid free_tls_offset(Obj_Entry *obj);
399153515Skanconst Ver_Entry *fetch_ventry(const Obj_Entry *obj, unsigned long);
400296939Skibint convert_prot(int elfflags);
40138816Sdfr
402116558Smdodd/*
403116558Smdodd * MD function declarations.
404116558Smdodd */
405116558Smdoddint do_copy_relocations(Obj_Entry *);
406233231Skibint reloc_non_plt(Obj_Entry *, Obj_Entry *, int flags,
407233231Skib    struct Struct_RtldLockState *);
408116558Smdoddint reloc_plt(Obj_Entry *);
409233231Skibint reloc_jmpslots(Obj_Entry *, int flags, struct Struct_RtldLockState *);
410228435Skibint reloc_iresolve(Obj_Entry *, struct Struct_RtldLockState *);
411233231Skibint reloc_gnu_ifunc(Obj_Entry *, int flags, struct Struct_RtldLockState *);
412331206Smariusvoid ifunc_init(Elf_Auxinfo *);
413331206Smariusvoid pre_init(void);
414331206Smariusvoid init_pltgot(Obj_Entry *);
415133063Sdfrvoid allocate_initial_tls(Obj_Entry *);
416116558Smdodd
41734192Sjdp#endif /* } */
418