aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-11-30 15:34:11 +1030
committerAlan Modra <amodra@gmail.com>2018-11-30 16:18:58 +1030
commitba85c15dabe144e4bcee5a1b388b32bee10729e1 (patch)
treeddf634de67d2a3d2c662c569788b3607b9995048 /bfd
parentf746c08f26dd71fdd809bad8cb92a6cbb8336ec4 (diff)
downloadgdb-ba85c15dabe144e4bcee5a1b388b32bee10729e1.zip
gdb-ba85c15dabe144e4bcee5a1b388b32bee10729e1.tar.gz
gdb-ba85c15dabe144e4bcee5a1b388b32bee10729e1.tar.bz2
PR23937, powerpc64le local ifunc IRELATIVE relocs are wrong
IFUNC resolvers must always be called via their global entry point. They will be called from ld.so rather than from the local executable. PR 23937 bfd/ * elf64-ppc.c (write_plt_relocs_for_local_syms): Don't add local entry offset for ifuncs. ld/ * testsuite/ld-powerpc/pr23937.d, * testsuite/ld-powerpc/pr23937.s: New test. * testsuite/ld-powerpc/powerpc.exp: Run it.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf64-ppc.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 602e0a2..8f455ae 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2018-11-30 Alan Modra <amodra@gmail.com>
+
+ PR 23937
+ * elf64-ppc.c (write_plt_relocs_for_local_syms): Don't add local
+ entry offset for ifuncs.
+
2018-11-29 H.J. Lu <hongjiu.lu@intel.com>
PR ld/23929
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 7c3534a..a2d3ea0 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -12882,7 +12882,8 @@ write_plt_relocs_for_local_syms (struct bfd_link_info *info)
}
val = sym->st_value + ent->addend;
- val += PPC64_LOCAL_ENTRY_OFFSET (sym->st_other);
+ if (ELF_ST_TYPE (sym->st_info) != STT_GNU_IFUNC)
+ val += PPC64_LOCAL_ENTRY_OFFSET (sym->st_other);
if (sym_sec != NULL && sym_sec->output_section != NULL)
val += sym_sec->output_offset + sym_sec->output_section->vma;