From 0722f2b58a9e37122c399a8a085bfe1a6ad9f39a Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Tue, 5 Feb 2019 21:23:02 +0000 Subject: 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@ --- gnu/usr.bin/binutils-2.17/bfd/elf32-ppc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gnu') 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)); -- cgit v1.2.3