summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/aarch64/dl-machine.h6
-rw-r--r--sysdeps/x86_64/dl-machine.h9
2 files changed, 12 insertions, 3 deletions
diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h
index 3e10cb462f..417633812b 100644
--- a/sysdeps/aarch64/dl-machine.h
+++ b/sysdeps/aarch64/dl-machine.h
@@ -241,7 +241,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
const ElfW(Sym) *sym, const struct r_found_version *version,
- void *const reloc_addr_arg, int skip_ifunc)
+ void *const reloc_addr_arg, int skip_ifunc, struct link_map *boot_map)
{
ElfW(Addr) *const reloc_addr = reloc_addr_arg;
const unsigned int r_type = ELFW (R_TYPE) (reloc->r_info);
@@ -253,7 +253,11 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
else
{
const ElfW(Sym) *const refsym = sym;
+#if defined RTLD_BOOTSTRAP || defined STATIC_PIE_BOOTSTRAP
+ struct link_map *sym_map = boot_map;
+#else
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
+#endif
ElfW(Addr) value = SYMBOL_ADDRESS (sym_map, sym, true);
if (sym != NULL
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index ceee50734e..95fd72c160 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -255,7 +255,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
const ElfW(Sym) *sym, const struct r_found_version *version,
- void *const reloc_addr_arg, int skip_ifunc)
+ void *const reloc_addr_arg, int skip_ifunc, struct link_map *boot_map)
{
ElfW(Addr) *const reloc_addr = reloc_addr_arg;
const unsigned long int r_type = ELFW(R_TYPE) (reloc->r_info);
@@ -293,7 +293,11 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
# ifndef RTLD_BOOTSTRAP
const ElfW(Sym) *const refsym = sym;
# endif
+#if defined RTLD_BOOTSTRAP || defined STATIC_PIE_BOOTSTRAP
+ struct link_map *sym_map = boot_map;
+#else
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
+#endif
ElfW(Addr) value = SYMBOL_ADDRESS (sym_map, sym, true);
if (sym != NULL
@@ -573,7 +577,8 @@ elf_machine_lazy_rel (struct link_map *map,
/* Always initialize TLS descriptors completely at load time, in
case static TLS is allocated for it that requires locking. */
- elf_machine_rela (map, reloc, sym, version, reloc_addr, skip_ifunc);
+ elf_machine_rela (map, reloc, sym, version, reloc_addr, skip_ifunc,
+ NULL);
}
else if (__glibc_unlikely (r_type == R_X86_64_IRELATIVE))
{