5 #define RTLD_NEXT ((void*)-1)
9 struct elf_resolve **init_fini;
10 unsigned long nlist; /* Number of entries in init_fini */
14 struct elf_resolve * dyn;
15 struct dyn_elf * next_handle; /* Used by dlopen et al. */
16 struct init_fini init_fini;
17 struct dyn_elf * next;
18 struct dyn_elf * prev;
22 /* These entries must be in this order to be compatible with the interface used
23 by gdb to obtain the list of symbols. */
24 ElfW(Addr) loadaddr; /* Base address shared object is loaded at. */
25 char *libname; /* Absolute file name object was found in. */
26 ElfW(Dyn) *dynamic_addr; /* Dynamic section of the shared object. */
27 struct elf_resolve * next;
28 struct elf_resolve * prev;
29 /* Nothing after this address is used by gdb. */
30 enum {elf_lib, elf_executable,program_interpreter, loaded_file} libtype;
31 struct dyn_elf * symbol_scope;
32 unsigned short usage_count;
33 unsigned short int init_flag;
34 unsigned long rtld_flags; /* RTLD_GLOBAL, RTLD_NOW etc. */
36 Elf32_Word *elf_buckets;
37 struct init_fini_list *init_fini;
38 struct init_fini_list *rtld_local; /* keep tack of RTLD_LOCAL libs in same group */
40 * These are only used with ELF style shared libraries
44 unsigned long dynamic_info[DYNAMIC_SIZE];
46 unsigned long n_phent;
49 ElfW(Addr) relro_addr;
53 /* this is used to store the address of relocation data words, so
54 * we don't have to calculate it every time, which requires a divide */
55 unsigned long data_words;
59 #define RELOCS_DONE 0x000001
60 #define JMP_RELOCS_DONE 0x000002
61 #define INIT_FUNCS_CALLED 0x000004
62 #define FINI_FUNCS_CALLED 0x000008
63 #define DL_OPENED 0x000010
65 extern struct dyn_elf * _dl_symbol_tables;
66 extern struct elf_resolve * _dl_loaded_modules;
67 extern struct dyn_elf * _dl_handles;
69 extern struct elf_resolve * _dl_check_hashed_files(const char * libname);
70 extern struct elf_resolve * _dl_add_elf_hash_table(const char * libname,
71 char * loadaddr, unsigned long * dynamic_info,
72 unsigned long dynamic_addr, unsigned long dynamic_size);
74 extern char * _dl_find_hash(const char * name, struct dyn_elf * rpnt1,
75 struct elf_resolve *mytpnt, int type_class);
77 extern int _dl_linux_dynamic_link(void);
79 extern char * _dl_library_path;
80 extern char * _dl_not_lazy;
82 static inline int _dl_symbol(char * name)
84 if(name[0] != '_' || name[1] != 'd' || name[2] != 'l' || name[3] != '_')
90 #define LD_ERROR_NOFILE 1
91 #define LD_ERROR_NOZERO 2
92 #define LD_ERROR_NOTELF 3
93 #define LD_ERROR_NOTMAGIC 4
94 #define LD_ERROR_NOTDYN 5
95 #define LD_ERROR_MMAP_FAILED 6
96 #define LD_ERROR_NODYNAMIC 7
97 #define LD_WRONG_RELOCS 8
98 #define LD_BAD_HANDLE 9
99 #define LD_NO_SYMBOL 10
103 #endif /* _LD_HASH_H_ */