summaryrefslogtreecommitdiff
path: root/sysdeps/m68k/dl-machine.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/m68k/dl-machine.h')
-rw-r--r--sysdeps/m68k/dl-machine.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/sysdeps/m68k/dl-machine.h b/sysdeps/m68k/dl-machine.h
index 41c179c3f1..8eb2295deb 100644
--- a/sysdeps/m68k/dl-machine.h
+++ b/sysdeps/m68k/dl-machine.h
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. m68k version.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -51,9 +51,15 @@ static inline Elf32_Addr
elf_machine_load_address (void)
{
Elf32_Addr addr;
+#ifdef SHARED
asm (PCREL_OP ("lea", "_dl_start", "%0", "%0", "%%pc") "\n\t"
"sub.l _dl_start@GOT.w(%%a5), %0"
: "=a" (addr));
+#else
+ asm (PCREL_OP ("lea", "_dl_relocate_static_pie", "%0", "%0", "%%pc") "\n\t"
+ "sub.l _dl_relocate_static_pie@GOT.w(%%a5), %0"
+ : "=a" (addr));
+#endif
return addr;
}
@@ -182,6 +188,7 @@ _dl_start_user:\n\
static inline Elf32_Addr
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+ const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
const Elf32_Rela *reloc,
Elf32_Addr *reloc_addr, Elf32_Addr value)
{
@@ -222,7 +229,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
{
const Elf32_Sym *const refsym = sym;
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
- Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
+ Elf32_Addr value = SYMBOL_ADDRESS (sym_map, sym, true);
switch (r_type)
{