]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/arm/dl-machine.h
elf: Unify symbol address run-time calculation [BZ #19818]
[thirdparty/glibc.git] / sysdeps / arm / dl-machine.h
index 8a00eab5e3d9df7b0e5b3765dd3862776da6becc..1a4fd3f17b6df7daed28f939eeeff3ea152a97d5 100644 (file)
@@ -392,7 +392,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
     {
       const Elf32_Sym *const refsym = sym;
       struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
-      Elf32_Addr value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
+      Elf32_Addr value = SYMBOL_ADDRESS (sym_map, sym, true);
 
       if (sym != NULL
          && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
@@ -452,7 +452,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
                 binding found in the user program or a loaded library
                 rather than the dynamic linker's built-in definitions
                 used while loading those libraries.  */
-             value -= map->l_addr + refsym->st_value;
+             value -= SYMBOL_ADDRESS (map, refsym, true);
 # endif
            /* Support relocations on mis-aligned offsets.  */
            ((struct unaligned *) reloc_addr)->x += value;
@@ -553,7 +553,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
       const Elf32_Sym *const refsym = sym;
 # endif
       struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
-      Elf32_Addr value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
+      Elf32_Addr value = SYMBOL_ADDRESS (sym_map, sym, true);
 
       if (sym != NULL
          && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)