* GNU Lesser General Public License version 2.1 or later.
*/
-#ifndef _LD_HASH_H_
-#define _LD_HASH_H_
+#ifndef _DL_HASH_H
+#define _DL_HASH_H
#ifndef RTLD_NEXT
#define RTLD_NEXT ((void*)-1)
struct dyn_elf * prev;
};
+struct symbol_ref {
+ const ElfW(Sym) *sym;
+ struct elf_resolve *tpnt;
+};
+
+/* Structure to describe a single list of scope elements. The lookup
+ functions get passed an array of pointers to such structures. */
+struct r_scope_elem {
+ struct elf_resolve **r_list; /* Array of maps for the scope. */
+ unsigned int r_nlist; /* Number of entries in the scope. */
+ struct r_scope_elem *next;
+};
+
struct elf_resolve {
/* These entries must be in this order to be compatible with the interface used
by gdb to obtain the list of symbols. */
struct elf_resolve * next;
struct elf_resolve * prev;
/* Nothing after this address is used by gdb. */
- DL_LOADADDR_TYPE mapaddr; /* Address at which ELF segments (either main app and DSO) are mapped into */
+
+#if defined(USE_TLS) && USE_TLS
+ /* Thread-local storage related info. */
+
+ /* Start of the initialization image. */
+ void *l_tls_initimage;
+ /* Size of the initialization image. */
+ size_t l_tls_initimage_size;
+ /* Size of the TLS block. */
+ size_t l_tls_blocksize;
+ /* Alignment requirement of the TLS block. */
+ size_t l_tls_align;
+ /* Offset of first byte module alignment. */
+ size_t l_tls_firstbyte_offset;
+# ifndef NO_TLS_OFFSET
+# define NO_TLS_OFFSET 0
+# endif
+ /* For objects present at startup time: offset in the static TLS block. */
+ ptrdiff_t l_tls_offset;
+ /* Index of the module in the dtv array. */
+ size_t l_tls_modid;
+ /* Nonzero if _dl_init_static_tls should be called for this module */
+ unsigned int l_need_tls_init:1;
+#endif
+
+ ElfW(Addr) mapaddr;
+#ifdef __LDSO_STANDALONE_SUPPORT__
+ /* Store the entry point from the ELF header (e_entry) */
+ ElfW(Addr) l_entry;
+#endif
enum {elf_lib, elf_executable,program_interpreter, loaded_file} libtype;
- struct dyn_elf * symbol_scope;
+ /* This is the local scope of the shared object */
+ struct r_scope_elem symbol_scope;
unsigned short usage_count;
unsigned short int init_flag;
unsigned long rtld_flags; /* RTLD_GLOBAL, RTLD_NOW etc. */
memory when the module is dlclose()d. */
struct funcdesc_ht *funcdesc_ht;
#endif
+#ifdef __DSBT__
+ /* Information for DSBT */
+ void **dsbt_table;
+ unsigned long dsbt_size;
+ unsigned long dsbt_index;
+#endif
};
#define RELOCS_DONE 0x000001
#define INIT_FUNCS_CALLED 0x000004
#define FINI_FUNCS_CALLED 0x000008
#define DL_OPENED 0x000010
+#define DL_RESERVED 0x000020
extern struct dyn_elf * _dl_symbol_tables;
extern struct elf_resolve * _dl_loaded_modules;
-extern struct dyn_elf * _dl_handles;
+extern struct dyn_elf * _dl_handles;
extern struct elf_resolve * _dl_add_elf_hash_table(const char * libname,
DL_LOADADDR_TYPE loadaddr, unsigned long * dynamic_info,
unsigned long dynamic_addr, unsigned long dynamic_size);
-extern char * _dl_lookup_hash(const char * name, struct dyn_elf * rpnt,
- struct elf_resolve *mytpnt, int type_class
-#ifdef __FDPIC__
- , struct elf_resolve **tpntp
-#endif
- );
-
-static __always_inline char *_dl_find_hash(const char *name, struct dyn_elf *rpnt,
- struct elf_resolve *mytpnt, int type_class)
-{
-#ifdef __FDPIC__
- return _dl_lookup_hash(name, rpnt, mytpnt, type_class, NULL);
-#else
- return _dl_lookup_hash(name, rpnt, mytpnt, type_class);
-#endif
-}
-
-extern int _dl_linux_dynamic_link(void);
+extern char *_dl_find_hash(const char *name, struct r_scope_elem *scope,
+ struct elf_resolve *mytpnt, int type_class,
+ struct symbol_ref *symbol);
extern char * _dl_library_path;
-extern char * _dl_not_lazy;
-
-static inline int _dl_symbol(char * name)
-{
- if (name[0] != '_' || name[1] != 'd' || name[2] != 'l' || name[3] != '_')
- return 0;
- return 1;
-}
#define LD_ERROR_NOFILE 1
#define LD_ERROR_NOZERO 2
#define LD_ERROR_NOTDYN 5
#define LD_ERROR_MMAP_FAILED 6
#define LD_ERROR_NODYNAMIC 7
-#define LD_WRONG_RELOCS 8
-#define LD_BAD_HANDLE 9
-#define LD_NO_SYMBOL 10
+#define LD_ERROR_TLS_FAILED 8
+#define LD_WRONG_RELOCS 9
+#define LD_BAD_HANDLE 10
+#define LD_NO_SYMBOL 11
-#endif /* _LD_HASH_H_ */
+#endif /* _DL_HASH_H */