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/11/libexec/rtld-elf/rtld.h 361983 2020-06-09 19:16:49Z kib $
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
4434192Sjdp#define NEW(type)	((type *) xmalloc(sizeof(type)))
45233307Skib#define CNEW(type)	((type *) xcalloc(1, sizeof(type)))
4634192Sjdp
4734192Sjdp/* We might as well do booleans like C++. */
4834192Sjdptypedef unsigned char bool;
4934192Sjdp#define false	0
5034192Sjdp#define true	1
5134192Sjdp
52133063Sdfrextern size_t tls_last_offset;
53133063Sdfrextern size_t tls_last_size;
54133063Sdfrextern size_t tls_static_space;
55133063Sdfrextern int tls_dtv_generation;
56133063Sdfrextern int tls_max_index;
57133063Sdfr
58264346Salcextern int npagesizes;
59264346Salcextern size_t *pagesizes;
60264346Salc
61232831Skibextern int main_argc;
62232831Skibextern char **main_argv;
63232831Skibextern char **environ;
64232831Skib
6550609Sjdpstruct stat;
6634192Sjdpstruct Struct_Obj_Entry;
6734192Sjdp
6855687Sjdp/* Lists of shared objects */
6950608Sjdptypedef struct Struct_Objlist_Entry {
7060938Sjake    STAILQ_ENTRY(Struct_Objlist_Entry) link;
7150608Sjdp    struct Struct_Obj_Entry *obj;
7250608Sjdp} Objlist_Entry;
7350608Sjdp
7460938Sjaketypedef STAILQ_HEAD(Struct_Objlist, Struct_Objlist_Entry) Objlist;
7550608Sjdp
7663870Sjdp/* Types of init and fini functions */
7755687Sjdptypedef void (*InitFunc)(void);
78232831Skibtypedef void (*InitArrFunc)(int, char **, char **);
7955687Sjdp
8055687Sjdp/* Lists of shared object dependencies */
8134192Sjdptypedef struct Struct_Needed_Entry {
8234192Sjdp    struct Struct_Needed_Entry *next;
8334192Sjdp    struct Struct_Obj_Entry *obj;
8434192Sjdp    unsigned long name;		/* Offset of name in string table */
8534192Sjdp} Needed_Entry;
8634192Sjdp
87153515Skantypedef struct Struct_Name_Entry {
88153515Skan    STAILQ_ENTRY(Struct_Name_Entry) link;
89153515Skan    char   name[1];
90153515Skan} Name_Entry;
91153515Skan
9262801Sjdp/* Lock object */
9362801Sjdptypedef struct Struct_LockInfo {
9462801Sjdp    void *context;		/* Client context for creating locks */
9562801Sjdp    void *thelock;		/* The one big lock */
9662801Sjdp    /* Debugging aids. */
9762801Sjdp    volatile int rcount;	/* Number of readers holding lock */
9862801Sjdp    volatile int wcount;	/* Number of writers holding lock */
9962801Sjdp    /* Methods */
10062801Sjdp    void *(*lock_create)(void *context);
10162801Sjdp    void (*rlock_acquire)(void *lock);
10262801Sjdp    void (*wlock_acquire)(void *lock);
10362801Sjdp    void (*rlock_release)(void *lock);
10462801Sjdp    void (*wlock_release)(void *lock);
10562801Sjdp    void (*lock_destroy)(void *lock);
10662801Sjdp    void (*context_destroy)(void *context);
10762801Sjdp} LockInfo;
10862801Sjdp
109153515Skantypedef struct Struct_Ver_Entry {
110153515Skan	Elf_Word     hash;
111153515Skan	unsigned int flags;
112153515Skan	const char  *name;
113153515Skan	const char  *file;
114153515Skan} Ver_Entry;
115153515Skan
116234840Skibtypedef struct Struct_Sym_Match_Result {
117234840Skib    const Elf_Sym *sym_out;
118234840Skib    const Elf_Sym *vsymp;
119234840Skib    int vcount;
120234840Skib} Sym_Match_Result;
121234840Skib
122153515Skan#define VER_INFO_HIDDEN	0x01
123153515Skan
12434192Sjdp/*
12534192Sjdp * Shared object descriptor.
12634192Sjdp *
12734192Sjdp * Items marked with "(%)" are dynamically allocated, and must be freed
12834192Sjdp * when the structure is destroyed.
12950977Sjdp *
13050977Sjdp * CAUTION: It appears that the JDK port peeks into these structures.
13150977Sjdp * It looks at "next" and "mapbase" at least.  Don't add new members
13250977Sjdp * near the front, until this can be straightened out.
13334192Sjdp */
13434192Sjdptypedef struct Struct_Obj_Entry {
13534192Sjdp    /*
13634192Sjdp     * These two items have to be set right for compatibility with the
13734192Sjdp     * original ElfKit crt1.o.
13834192Sjdp     */
139153504Smarcel    Elf_Size magic;		/* Magic number (sanity check) */
140153504Smarcel    Elf_Size version;		/* Version number of struct format */
14134192Sjdp
142294373Skib    TAILQ_ENTRY(Struct_Obj_Entry) next;
14334192Sjdp    char *path;			/* Pathname of underlying file (%) */
144116511Smdodd    char *origin_path;		/* Directory path of origin file */
145313124Smarkj    int refcount;		/* DAG references */
146313124Smarkj    int holdcount;		/* Count of transient references */
14734192Sjdp    int dl_refcount;		/* Number of times loaded by dlopen */
14834192Sjdp
14934192Sjdp    /* These items are computed by map_object() or by digest_phdr(). */
15034192Sjdp    caddr_t mapbase;		/* Base address of mapped region */
15134192Sjdp    size_t mapsize;		/* Size of mapped region in bytes */
15234192Sjdp    size_t textsize;		/* Size of text segment in bytes */
15338467Sjb    Elf_Addr vaddrbase;		/* Base address in shared object file */
15434192Sjdp    caddr_t relocbase;		/* Relocation constant = mapbase - vaddrbase */
15538467Sjb    const Elf_Dyn *dynamic;	/* Dynamic section */
15634192Sjdp    caddr_t entry;		/* Entry point */
15738467Sjb    const Elf_Phdr *phdr;	/* Program header if it is mapped, else NULL */
15834192Sjdp    size_t phsize;		/* Size of program header in bytes */
15950610Sjdp    const char *interp;		/* Pathname of the interpreter, if any */
160217153Skib    Elf_Word stack_flags;
16134192Sjdp
162133063Sdfr    /* TLS information */
163133063Sdfr    int tlsindex;		/* Index in DTV for this module */
164133063Sdfr    void *tlsinit;		/* Base address of TLS init block */
165133063Sdfr    size_t tlsinitsize;		/* Size of TLS init block for this module */
166133063Sdfr    size_t tlssize;		/* Size of TLS block for this module */
167133063Sdfr    size_t tlsoffset;		/* Offset of static TLS block for this module */
168133063Sdfr    size_t tlsalign;		/* Alignment of static TLS block */
169133063Sdfr
170230784Skib    caddr_t relro_page;
171230784Skib    size_t relro_size;
172230784Skib
17334192Sjdp    /* Items from the dynamic section. */
17445501Sjdp    Elf_Addr *pltgot;		/* PLT or GOT, depending on architecture */
17538467Sjb    const Elf_Rel *rel;		/* Relocation entries */
17634192Sjdp    unsigned long relsize;	/* Size in bytes of relocation info */
17738816Sdfr    const Elf_Rela *rela;	/* Relocation entries with addend */
17838816Sdfr    unsigned long relasize;	/* Size in bytes of addend relocation info */
17938467Sjb    const Elf_Rel *pltrel;	/* PLT relocation entries */
18034192Sjdp    unsigned long pltrelsize;	/* Size in bytes of PLT relocation info */
18138816Sdfr    const Elf_Rela *pltrela;	/* PLT relocation entries with addend */
18238816Sdfr    unsigned long pltrelasize;	/* Size in bytes of PLT addend reloc info */
18338467Sjb    const Elf_Sym *symtab;	/* Symbol table */
18434192Sjdp    const char *strtab;		/* String table */
18534192Sjdp    unsigned long strsize;	/* Size in bytes of string table */
186177924Simp#ifdef __mips__
187177924Simp    Elf_Word local_gotno;	/* Number of local GOT entries */
188177924Simp    Elf_Word symtabno;		/* Number of dynamic symbols */
189177924Simp    Elf_Word gotsym;		/* First dynamic symbol in GOT */
190177924Simp#endif
191291668Snwhitehorn#ifdef __powerpc64__
192291668Snwhitehorn    Elf_Addr glink;		/* GLINK PLT call stub section */
193291668Snwhitehorn#endif
19434192Sjdp
195153515Skan    const Elf_Verneed *verneed; /* Required versions. */
196153515Skan    Elf_Word verneednum;	/* Number of entries in verneed table */
197153515Skan    const Elf_Verdef  *verdef;	/* Provided versions. */
198153515Skan    Elf_Word verdefnum;		/* Number of entries in verdef table */
199153515Skan    const Elf_Versym *versyms;  /* Symbol versions table */
200153515Skan
20185004Sdfr    const Elf_Hashelt *buckets;	/* Hash table buckets array */
20234192Sjdp    unsigned long nbuckets;	/* Number of buckets */
20385004Sdfr    const Elf_Hashelt *chains;	/* Hash table chain array */
204234841Skib    unsigned long nchains;	/* Number of entries in chain array */
20534192Sjdp
206234841Skib    Elf32_Word nbuckets_gnu;		/* Number of GNU hash buckets*/
207234841Skib    Elf32_Word symndx_gnu;		/* 1st accessible symbol on dynsym table */
208234841Skib    Elf32_Word maskwords_bm_gnu;  	/* Bloom filter words - 1 (bitmask) */
209234841Skib    Elf32_Word shift2_gnu;		/* Bloom filter shift count */
210234841Skib    Elf32_Word dynsymcount;		/* Total entries in dynsym table */
211234841Skib    Elf_Addr *bloom_gnu;		/* Bloom filter used by GNU hash func */
212234841Skib    const Elf_Hashelt *buckets_gnu;	/* GNU hash table bucket array */
213234841Skib    const Elf_Hashelt *chain_zero_gnu;	/* GNU hash table value array (Zeroed) */
214234841Skib
215189959Skib    char *rpath;		/* Search path specified in object */
216238471Skib    char *runpath;		/* Search path with different priority */
21734192Sjdp    Needed_Entry *needed;	/* Shared objects needed by this one (%) */
218216695Skib    Needed_Entry *needed_filtees;
219216695Skib    Needed_Entry *needed_aux_filtees;
22034192Sjdp
221153515Skan    STAILQ_HEAD(, Struct_Name_Entry) names; /* List of names for this object we
222153515Skan					       know about. */
223153515Skan    Ver_Entry *vertab;		/* Versions required /defined by this object */
224153515Skan    int vernum;			/* Number of entries in vertab */
225153515Skan
22685677Speter    Elf_Addr init;		/* Initialization function to call */
22785677Speter    Elf_Addr fini;		/* Termination function to call */
228232831Skib    Elf_Addr preinit_array;	/* Pre-initialization array of functions */
229232831Skib    Elf_Addr init_array;	/* Initialization array of functions */
230232831Skib    Elf_Addr fini_array;	/* Termination array of functions */
231232831Skib    int preinit_array_num;	/* Number of entries in preinit_array */
232232831Skib    int init_array_num; 	/* Number of entries in init_array */
233232831Skib    int fini_array_num; 	/* Number of entries in fini_array */
23434192Sjdp
235232831Skib    int32_t osrel;		/* OSREL note value */
236232831Skib
237168312Skan    bool mainprog : 1;		/* True if this is the main program */
238168312Skan    bool rtld : 1;		/* True if this is the dynamic linker */
239233231Skib    bool relocated : 1;		/* True if processed by relocate_objects() */
240233546Skib    bool ver_checked : 1;	/* True if processed by rtld_verify_object_versions */
241168312Skan    bool textrel : 1;		/* True if there are relocations to text seg */
242168312Skan    bool symbolic : 1;		/* True if generated with "-Bsymbolic" */
243168312Skan    bool bind_now : 1;		/* True if all relocations should be made first */
244168312Skan    bool traced : 1;		/* Already printed in ldd trace output */
245168312Skan    bool jmpslots_done : 1;	/* Already have relocated the jump slots */
246168312Skan    bool init_done : 1;		/* Already have added object to init list */
247168312Skan    bool tls_done : 1;		/* Already allocated offset for static TLS */
248168312Skan    bool phdr_alloc : 1;	/* Phdr is allocated and needs to be freed. */
249189959Skib    bool z_origin : 1;		/* Process rpath and soname tokens */
250190543Skib    bool z_nodelete : 1;	/* Do not unload the object and dependencies */
251199829Skib    bool z_noopen : 1;		/* Do not load on dlopen */
252216695Skib    bool z_loadfltr : 1;	/* Immediately load filtees */
253256101Skib    bool z_interpose : 1;	/* Interpose all objects but main */
254238471Skib    bool z_nodeflib : 1;	/* Don't search default library path */
255281549Skib    bool z_global : 1;		/* Make the object global */
256361983Skib    bool z_pie : 1;		/* Object proclaimed itself PIE executable */
257346156Skib    bool static_tls : 1;	/* Needs static TLS allocation */
258346156Skib    bool static_tls_copied : 1;	/* Needs static TLS copying */
259194531Skan    bool ref_nodel : 1;		/* Refcount increased to prevent dlclose */
260194531Skan    bool init_scanned: 1;	/* Object is already on init list. */
261194531Skan    bool on_fini_list: 1;	/* Object is already on fini list. */
262214728Skib    bool dag_inited : 1;	/* Object has its DAG initialized. */
263216695Skib    bool filtees_loaded : 1;	/* Filtees loaded */
264228435Skib    bool irelative : 1;		/* Object has R_MACHDEP_IRELATIVE relocs */
265228435Skib    bool gnu_ifunc : 1;		/* Object has references to STT_GNU_IFUNC */
266270802Skib    bool non_plt_gnu_ifunc : 1;	/* Object has non-plt IFUNC references */
267341774Skib    bool ifuncs_resolved : 1;	/* Object ifuncs were already resolved */
268232831Skib    bool crt_no_init : 1;	/* Object' crt does not call _init/_fini */
269234841Skib    bool valid_hash_sysv : 1;	/* A valid System V hash hash tag is available */
270234841Skib    bool valid_hash_gnu : 1;	/* A valid GNU hash tag is available */
271276627Skib    bool dlopened : 1;		/* dlopen()-ed (vs. load statically) */
272294373Skib    bool marker : 1;		/* marker on the global obj list */
273313124Smarkj    bool unholdfree : 1;	/* unmap upon last unhold */
274313124Smarkj    bool doomed : 1;		/* Object cannot be referenced */
27535529Sdfr
276194531Skan    struct link_map linkmap;	/* For GDB and dlinfo() */
27750977Sjdp    Objlist dldags;		/* Object belongs to these dlopened DAGs (%) */
27850977Sjdp    Objlist dagmembers;		/* DAG has these members (%) */
27950977Sjdp    dev_t dev;			/* Object's filesystem's device */
28050977Sjdp    ino_t ino;			/* Object's inode number */
281229780Suqs    void *priv;			/* Platform-dependent */
28234192Sjdp} Obj_Entry;
28334192Sjdp
28434192Sjdp#define RTLD_MAGIC	0xd550b87a
28534192Sjdp#define RTLD_VERSION	1
28634192Sjdp
287294373SkibTAILQ_HEAD(obj_entry_q, Struct_Obj_Entry);
288294373Skib
289192922Sdfr#define RTLD_STATIC_TLS_EXTRA	128
290133063Sdfr
291153515Skan/* Flags to be passed into symlook_ family of functions. */
292153515Skan#define SYMLOOK_IN_PLT	0x01	/* Lookup for PLT symbol */
293228375Skib#define SYMLOOK_DLSYM	0x02	/* Return newest versioned symbol. Used by
294153515Skan				   dlsym. */
295233231Skib#define	SYMLOOK_EARLY	0x04	/* Symlook is done during initialization. */
296270798Skib#define	SYMLOOK_IFUNC	0x08	/* Allow IFUNC processing in
297270798Skib				   reloc_non_plt(). */
298153515Skan
299199829Skib/* Flags for load_object(). */
300199877Skib#define	RTLD_LO_NOLOAD	0x01	/* dlopen() specified RTLD_NOLOAD. */
301199877Skib#define	RTLD_LO_DLOPEN	0x02	/* Load_object() called from dlopen(). */
302199877Skib#define	RTLD_LO_TRACE	0x04	/* Only tracing. */
303216695Skib#define	RTLD_LO_NODELETE 0x08	/* Loaded object cannot be closed. */
304216695Skib#define	RTLD_LO_FILTEES 0x10	/* Loading filtee. */
305233231Skib#define	RTLD_LO_EARLY	0x20	/* Do not call ctors, postpone it to the
306233231Skib				   initialization during the image start. */
307361889Skib#define	RTLD_LO_IGNSTLS 0x40	/* Do not allocate static TLS */
308361382Skib#define	RTLD_LO_DEEPBIND 0x80	/* Force symbolic for this object */
309199829Skib
31076296Sjdp/*
31176296Sjdp * Symbol cache entry used during relocation to avoid multiple lookups
31276296Sjdp * of the same symbol.
31376296Sjdp */
31476296Sjdptypedef struct Struct_SymCache {
31576296Sjdp    const Elf_Sym *sym;		/* Symbol table entry */
31676296Sjdp    const Obj_Entry *obj;	/* Shared object which defines it */
31776296Sjdp} SymCache;
31876296Sjdp
319216695Skib/*
320216695Skib * This structure provides a reentrant way to keep a list of objects and
321216695Skib * check which ones have already been processed in some way.
322216695Skib */
323216695Skibtypedef struct Struct_DoneList {
324216695Skib    const Obj_Entry **objs;		/* Array of object pointers */
325216695Skib    unsigned int num_alloc;		/* Allocated size of the array */
326216695Skib    unsigned int num_used;		/* Number of array slots used */
327216695Skib} DoneList;
328216695Skib
329216695Skibstruct Struct_RtldLockState {
330216695Skib	int lockstate;
331218476Skib	sigjmp_buf env;
332216695Skib};
333216695Skib
334238471Skibstruct fill_search_info_args {
335238471Skib	int request;
336238471Skib	unsigned int flags;
337238471Skib	struct dl_serinfo *serinfo;
338238471Skib	struct dl_serpath *serpath;
339238471Skib	char *strspace;
340238471Skib};
341238471Skib
342216695Skib/*
343216695Skib * The pack of arguments and results for the symbol lookup functions.
344216695Skib */
345216695Skibtypedef struct Struct_SymLook {
346216695Skib    const char *name;
347216695Skib    unsigned long hash;
348234841Skib    uint32_t hash_gnu;
349216695Skib    const Ver_Entry *ventry;
350216695Skib    int flags;
351216695Skib    const Obj_Entry *defobj_out;
352216695Skib    const Elf_Sym *sym_out;
353216695Skib    struct Struct_RtldLockState *lockstate;
354216695Skib} SymLook;
355216695Skib
356280816Skibvoid _rtld_error(const char *, ...) __printflike(1, 2) __exported;
357281005Semastevoid rtld_die(void) __dead2;
358233361Skibconst char *rtld_strerror(int);
359233361SkibObj_Entry *map_object(int, const char *, const struct stat *);
360233361Skibvoid *xcalloc(size_t, size_t);
361233361Skibvoid *xmalloc(size_t);
362233361Skibchar *xstrdup(const char *);
363259043Skibvoid *malloc_aligned(size_t size, size_t align);
364259043Skibvoid free_aligned(void *ptr);
36538816Sdfrextern Elf_Addr _GLOBAL_OFFSET_TABLE_[];
366212497Snwhitehornextern Elf_Sym sym_zero;	/* For resolving undefined weak refs. */
367316135Skibextern bool ld_bind_not;
36834192Sjdp
369233361Skibvoid dump_relocations(Obj_Entry *);
370233361Skibvoid dump_obj_relocations(Obj_Entry *);
371233361Skibvoid dump_Elf_Rel(Obj_Entry *, const Elf_Rel *, u_long);
372233361Skibvoid dump_Elf_Rela(Obj_Entry *, const Elf_Rela *, u_long);
373116563Smdodd
37438816Sdfr/*
37538816Sdfr * Function declarations.
37638816Sdfr */
37738816Sdfrunsigned long elf_hash(const char *);
37866056Sjdpconst Elf_Sym *find_symdef(unsigned long, const Obj_Entry *,
379216695Skib  const Obj_Entry **, int, SymCache *, struct Struct_RtldLockState *);
380116557Smdoddvoid lockdflt_init(void);
381232831Skibvoid digest_notes(Obj_Entry *, Elf_Addr, Elf_Addr);
382294373SkibObj_Entry *globallist_curr(const Obj_Entry *obj);
383294373SkibObj_Entry *globallist_next(const Obj_Entry *obj);
38450608Sjdpvoid obj_free(Obj_Entry *);
38550608SjdpObj_Entry *obj_new(void);
38645501Sjdpvoid _rtld_bind_start(void);
387228435Skibvoid *rtld_resolve_ifunc(const Obj_Entry *obj, const Elf_Sym *def);
388216695Skibvoid symlook_init(SymLook *, const char *);
389216695Skibint symlook_obj(SymLook *, const Obj_Entry *);
390133063Sdfrvoid *tls_get_addr_common(Elf_Addr** dtvp, int index, size_t offset);
391133063Sdfrvoid *allocate_tls(Obj_Entry *, void *, size_t, size_t);
392133063Sdfrvoid free_tls(void *, size_t, size_t);
393133063Sdfrvoid *allocate_module_tls(int index);
394133063Sdfrbool allocate_tls_offset(Obj_Entry *obj);
395142645Sdfrvoid free_tls_offset(Obj_Entry *obj);
396153515Skanconst Ver_Entry *fetch_ventry(const Obj_Entry *obj, unsigned long);
397296319Skibint convert_prot(int elfflags);
39838816Sdfr
399116558Smdodd/*
400116558Smdodd * MD function declarations.
401116558Smdodd */
402116558Smdoddint do_copy_relocations(Obj_Entry *);
403233231Skibint reloc_non_plt(Obj_Entry *, Obj_Entry *, int flags,
404233231Skib    struct Struct_RtldLockState *);
405116558Smdoddint reloc_plt(Obj_Entry *);
406233231Skibint reloc_jmpslots(Obj_Entry *, int flags, struct Struct_RtldLockState *);
407228435Skibint reloc_iresolve(Obj_Entry *, struct Struct_RtldLockState *);
408233231Skibint reloc_gnu_ifunc(Obj_Entry *, int flags, struct Struct_RtldLockState *);
409331205Smariusvoid ifunc_init(Elf_Auxinfo[__min_size(AT_COUNT)]);
410331205Smariusvoid pre_init(void);
411331205Smariusvoid init_pltgot(Obj_Entry *);
412133063Sdfrvoid allocate_initial_tls(Obj_Entry *);
413116558Smdodd
41434192Sjdp#endif /* } */
415