4 #define RTLD_NEXT ((void*)-1)
9 struct elf_resolve * dyn;
10 struct dyn_elf * next_handle; /* Used by dlopen et al. */
11 struct dyn_elf * next;
15 /* These entries must be in this order to be compatible with the interface used
16 by gdb to obtain the list of symbols. */
19 unsigned long dynamic_addr;
20 struct elf_resolve * next;
21 struct elf_resolve * prev;
22 /* Nothing after this address is used by gdb. */
23 enum {elf_lib, elf_executable,program_interpreter, loaded_file} libtype;
24 struct dyn_elf * symbol_scope;
25 unsigned short usage_count;
26 unsigned short int init_flag;
28 unsigned long * elf_buckets;
30 * These are only used with ELF style shared libraries
33 unsigned long * chains;
34 unsigned long dynamic_info[24];
36 unsigned long dynamic_size;
37 unsigned long n_phent;
43 * The DT_DEBUG entry in the .dynamic section is given the address of this structure.
44 * gdb can pick this up to obtain the correct list of loaded modules.
49 struct elf_resolve * link_map;
50 unsigned long brk_fun;
51 enum {RT_CONSISTENT, RT_ADD, RT_DELETE};
56 #define COPY_RELOCS_DONE 1
58 #define JMP_RELOCS_DONE 4
59 #define INIT_FUNCS_CALLED 8
61 extern struct dyn_elf * _dl_symbol_tables;
62 extern struct elf_resolve * _dl_loaded_modules;
63 extern struct dyn_elf * _dl_handles;
65 extern struct elf_resolve * _dl_check_hashed_files(char * libname);
66 extern struct elf_resolve * _dl_add_elf_hash_table(char * libname,
67 char * loadaddr, unsigned long * dynamic_info,
68 unsigned long dynamic_addr, unsigned long dynamic_size);
69 extern char * _dl_find_hash(char * name, struct dyn_elf * rpnt1,
70 unsigned long instr_addr, struct elf_resolve * f_tpnt,
72 extern int _dl_linux_dynamic_link(void);
75 /* On m68k constant strings are referenced through the GOT. */
76 /* XXX Requires load_addr to be defined. */
77 #define SEND_STDERR(X) \
78 { const char *__s = (X); \
79 if (__s < (const char *) load_addr) __s += load_addr; \
80 _dl_write (2, __s, _dl_strlen_inline (__s)); \
83 #define SEND_STDERR(X) _dl_write(2, X, _dl_strlen_inline(X));
85 extern int _dl_fdprintf(int, const char *, ...);
86 extern char * _dl_library_path;
87 extern char * _dl_not_lazy;
88 extern char * _dl_strdup(const char *);
89 extern unsigned long _dl_elf_hash(const char * name);
91 static inline int _dl_symbol(char * name)
93 if(name[0] != '_' || name[1] != 'd' || name[2] != 'l' || name[3] != '_')
99 #define DL_ERROR_NOFILE 1
100 #define DL_ERROR_NOZERO 2
101 #define DL_ERROR_NOTELF 3
102 #define DL_ERROR_NOTMAGIC 4
103 #define DL_ERROR_NOTDYN 5
104 #define DL_ERROR_MMAP_FAILED 6
105 #define DL_ERROR_NODYNAMIC 7
106 #define DL_WRONG_RELOCS 8
107 #define DL_BAD_HANDLE 9
108 #define DL_NO_SYMBOL 10