summaryrefslogtreecommitdiff
path: root/ldso/include/dl-hash.h
diff options
context:
space:
mode:
Diffstat (limited to 'ldso/include/dl-hash.h')
-rw-r--r--ldso/include/dl-hash.h35
1 files changed, 27 insertions, 8 deletions
diff --git a/ldso/include/dl-hash.h b/ldso/include/dl-hash.h
index 34bed1b4b..b1927e49a 100644
--- a/ldso/include/dl-hash.h
+++ b/ldso/include/dl-hash.h
@@ -25,6 +25,19 @@ struct dyn_elf {
struct dyn_elf * prev;
};
+struct sym_val {
+ const ElfW(Sym) *s;
+ struct elf_resolve *m;
+};
+
+/* 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. */
@@ -60,8 +73,13 @@ struct elf_resolve {
#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. */
@@ -128,6 +146,7 @@ struct elf_resolve {
#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;
@@ -139,17 +158,17 @@ extern struct elf_resolve * _dl_add_elf_hash_table(const char * libname,
/* Only need extra arg with some configurations */
#if !((defined(USE_TLS) && USE_TLS) || defined __FDPIC__)
-# define _dl_lookup_hash(n, r, m, c, tpntp) _dl_lookup_hash(n, r, m, c)
-# define _dl_find_hash(n, r, m, t, tpntp) _dl_find_hash(n, r, m, t)
+# define _dl_lookup_hash(n, r, m, s, c, tpnt) _dl_lookup_hash(n, r, m, s, c)
+# define _dl_find_hash(n, r, m, s, t, tpntp) _dl_find_hash(n, r, m, s, t)
#endif
-extern char *_dl_lookup_hash(const char *name, struct dyn_elf *rpnt,
- struct elf_resolve *mytpnt, int type_class,
+extern char *_dl_lookup_hash(const char *name, struct r_scope_elem *scope,
+ struct elf_resolve *mytpnt, struct sym_val *symbol, int type_class,
struct elf_resolve **tpntp);
-static __always_inline char *_dl_find_hash(const char *name, struct dyn_elf *rpnt,
- struct elf_resolve *mytpnt, int type_class,
+static __always_inline char *_dl_find_hash(const char *name, struct r_scope_elem *scope,
+ struct elf_resolve *mytpnt, struct sym_val *symbol, int type_class,
struct elf_resolve **tpntp)
{
- return _dl_lookup_hash(name, rpnt, mytpnt, type_class, tpntp);
+ return _dl_lookup_hash(name, scope, mytpnt, symbol, type_class, tpntp);
}
extern int _dl_linux_dynamic_link(void);