summaryrefslogtreecommitdiff
path: root/ldso/include
diff options
context:
space:
mode:
Diffstat (limited to 'ldso/include')
-rw-r--r--ldso/include/dl-elf.h20
-rw-r--r--ldso/include/dl-hash.h1
2 files changed, 17 insertions, 4 deletions
diff --git a/ldso/include/dl-elf.h b/ldso/include/dl-elf.h
index a1237b09f..d8f3b382c 100644
--- a/ldso/include/dl-elf.h
+++ b/ldso/include/dl-elf.h
@@ -65,10 +65,10 @@ extern void _dl_protect_relro (struct elf_resolve *l);
#define DYNAMIC_SIZE (DT_NUM+OS_NUM+ARCH_NUM)
-extern void _dl_parse_dynamic_info(Elf32_Dyn *dpnt, unsigned long dynamic_info[], void *debug_addr);
+extern void _dl_parse_dynamic_info(Elf32_Dyn *dpnt, unsigned long dynamic_info[], void *debug_addr, Elf32_Addr load_off);
static inline __attribute__((always_inline))
-void __dl_parse_dynamic_info(Elf32_Dyn *dpnt, unsigned long dynamic_info[], void *debug_addr)
+void __dl_parse_dynamic_info(Elf32_Dyn *dpnt, unsigned long dynamic_info[], void *debug_addr, Elf32_Addr load_off)
{
for (; dpnt->d_tag; dpnt++) {
if (dpnt->d_tag < DT_NUM) {
@@ -97,7 +97,21 @@ void __dl_parse_dynamic_info(Elf32_Dyn *dpnt, unsigned long dynamic_info[], void
}
#endif
}
-}
+# define ADJUST_DYN_INFO(tag, load_off) \
+ do { \
+ if (dynamic_info[tag]) \
+ dynamic_info[tag] += load_off; \
+ } while(0)
+
+ ADJUST_DYN_INFO (DT_HASH, load_off);
+ ADJUST_DYN_INFO (DT_PLTGOT, load_off);
+ ADJUST_DYN_INFO (DT_STRTAB, load_off);
+ ADJUST_DYN_INFO (DT_SYMTAB, load_off);
+ ADJUST_DYN_INFO (DT_RELOC_TABLE_ADDR, load_off);
+ ADJUST_DYN_INFO (DT_JMPREL, load_off);
+# undef ADJUST_DYN_INFO
+
+ }
/* Reloc type classes as returned by elf_machine_type_class().
ELF_RTYPE_CLASS_PLT means this reloc should not be satisfied by
diff --git a/ldso/include/dl-hash.h b/ldso/include/dl-hash.h
index cc0d389f6..53e17302a 100644
--- a/ldso/include/dl-hash.h
+++ b/ldso/include/dl-hash.h
@@ -77,7 +77,6 @@ extern int _dl_linux_dynamic_link(void);
extern char * _dl_library_path;
extern char * _dl_not_lazy;
-extern unsigned long _dl_elf_hash(const unsigned char *name);
static inline int _dl_symbol(char * name)
{