]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/x86_64/dl-machine.h
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysdeps / x86_64 / dl-machine.h
index 2201818aa6f1a527d219a5113036532754226edb..f17f5fb7cdaae8d9c3845a7ed53603fdb819dff1 100644 (file)
@@ -1,5 +1,5 @@
 /* Machine-dependent ELF dynamic relocation inline functions.  x86-64 version.
-   Copyright (C) 2001-2018 Free Software Foundation, Inc.
+   Copyright (C) 2001-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@suse.de>.
 
@@ -15,7 +15,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #ifndef dl_machine_h
 #define dl_machine_h
@@ -306,8 +306,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
       const ElfW(Sym) *const refsym = sym;
 # endif
       struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
-      ElfW(Addr) value = (sym == NULL ? 0
-                         : (ElfW(Addr)) sym_map->l_addr + sym->st_value);
+      ElfW(Addr) value = SYMBOL_ADDRESS (sym_map, sym, true);
 
       if (sym != NULL
          && __glibc_unlikely (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC)
@@ -348,6 +347,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
          /* Set to symbol size plus addend.  */
          value = sym->st_size;
 # endif
+         /* Fall through.  */
        case R_X86_64_GLOB_DAT:
        case R_X86_64_JUMP_SLOT:
          *reloc_addr = value + reloc->r_addend;
@@ -461,6 +461,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
          /* Set to symbol size plus addend.  */
          value = sym->st_size;
 #  endif
+         /* Fall through.  */
        case R_X86_64_32:
          value += reloc->r_addend;
          *(unsigned int *) reloc_addr = value;