public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb/binutils-2_38-branch] PowerPC64 pcrel got relocs against local symbols
Date: Fri, 16 Sep 2022 09:40:13 +0000 (GMT)	[thread overview]
Message-ID: <20220916094013.2BBA23856964@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=737e29d05eb6bbad8510bdedd5ffc5a5562897fb

commit 737e29d05eb6bbad8510bdedd5ffc5a5562897fb
Author: Alan Modra <amodra@gmail.com>
Date:   Fri Sep 16 18:08:44 2022 +0930

    PowerPC64 pcrel got relocs against local symbols
    
    Not that anyone would want to indirect via the GOT when an address can
    be loaded directly with pla, the following:
    
     pld 3,x@got@pcrel
    x:
    
    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.
    
            * config/tc-ppc.c (ppc_force_relocation): Add PLT_PCREL34 and
            assorted GOT_PCREL34 relocs.
    
    (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 89bc7d3f9b9..2676133e8ce 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -6765,6 +6765,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:

                 reply	other threads:[~2022-09-16  9:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220916094013.2BBA23856964@sourceware.org \
    --to=amodra@sourceware.org \
    --cc=bfd-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).