summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2019-02-05 21:23:02 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2019-02-05 21:23:02 +0000
commit0722f2b58a9e37122c399a8a085bfe1a6ad9f39a (patch)
treefdabea2a0f10ba69225a064c9840bcbc7e429e48 /gnu
parent2fb3e1484aaf551916ad2e144a75149b73bcd2e2 (diff)
Fix addend handling for relaxing R_PPC_PLTREL24 relocations. This issue has
been fixed in a much more complicated way upstream which we can't easily backport and involves GPLv3 code as well. So instead simply nuke the addend in the most convenient spot. Makes -Wl,-relax work well enough to link base clang. ok guenther@
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/binutils-2.17/bfd/elf32-ppc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gnu/usr.bin/binutils-2.17/bfd/elf32-ppc.c b/gnu/usr.bin/binutils-2.17/bfd/elf32-ppc.c
index d4f4cf2bf8e..328031bbe7e 100644
--- a/gnu/usr.bin/binutils-2.17/bfd/elf32-ppc.c
+++ b/gnu/usr.bin/binutils-2.17/bfd/elf32-ppc.c
@@ -5235,6 +5235,9 @@ ppc_elf_relax_section (bfd *abfd,
irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
stub_rtype);
irel->r_offset = trampoff + insn_offset;
+ if (r_type == R_PPC_PLTREL24 &&
+ (stub_rtype == R_PPC_RELAX32 || stub_rtype == R_PPC_RELAX32PC))
+ irel->r_addend = 0;
/* Record the fixup so we don't do it again this section. */
f = bfd_malloc (sizeof (*f));