From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1062) id 2A30C3856964; Fri, 16 Sep 2022 09:40:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A30C3856964 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Alan Modra To: bfd-cvs@sourceware.org Subject: [binutils-gdb/binutils-2_39-branch] PowerPC64 pcrel got relocs against local symbols X-Act-Checkin: binutils-gdb X-Git-Author: Alan Modra X-Git-Refname: refs/heads/binutils-2_39-branch X-Git-Oldrev: 4d4e9337d1eb26a0cc24b4f8b70d718eeadbf682 X-Git-Newrev: 4d7bba23a39fba18d6d13a2941a3c232011a7064 Message-Id: <20220916094004.2A30C3856964@sourceware.org> Date: Fri, 16 Sep 2022 09:40:04 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2022 09:40:04 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D4d7bba23a39f= ba18d6d13a2941a3c232011a7064 commit 4d7bba23a39fba18d6d13a2941a3c232011a7064 Author: Alan Modra Date: Fri Sep 16 18:08:44 2022 +0930 PowerPC64 pcrel got relocs against local symbols =20 Not that anyone would want to indirect via the GOT when an address can be loaded directly with pla, the following: =20 pld 3,x@got@pcrel x: =20 leads to "Internal error in md_apply_fix", because the generic parts of assembler fixup handling convert the fx_pcrel fixup to one without a symbol. Stop that happening. =20 * config/tc-ppc.c (ppc_force_relocation): Add PLT_PCREL34 and assorted GOT_PCREL34 relocs. =20 (cherry picked from commit 49c3ed081fed6b8e2b48fdc48f805f11e4589514) Diff: --- gas/config/tc-ppc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 25550528c05..1a68ca26705 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -6676,6 +6676,12 @@ ppc_force_relocation (fixS *fix) case BFD_RELOC_PPC_BA16_BRNTAKEN: case BFD_RELOC_24_PLT_PCREL: case BFD_RELOC_PPC64_TOC: + case BFD_RELOC_PPC64_PLT_PCREL34: + case BFD_RELOC_PPC64_GOT_PCREL34: + case BFD_RELOC_PPC64_GOT_TLSGD_PCREL34: + case BFD_RELOC_PPC64_GOT_TLSLD_PCREL34: + case BFD_RELOC_PPC64_GOT_TPREL_PCREL34: + case BFD_RELOC_PPC64_GOT_DTPREL_PCREL34: return 1; case BFD_RELOC_PPC_B26: case BFD_RELOC_PPC_BA26: