public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Michael Matz <matz@suse.de>
To: "Richard Earnshaw (lists)" <Richard.Earnshaw@arm.com>
Cc: binutils@sourceware.org
Subject: Re: [PATCH] PR30437 aarch64: make RELA relocs idempotent
Date: Thu, 25 May 2023 12:29:42 +0000 (UTC)	[thread overview]
Message-ID: <alpine.LSU.2.20.2305251212000.13548@wotan.suse.de> (raw)
In-Reply-To: <1ed54fc8-8ba0-9106-377e-61400af6c00c@arm.com>

Hello,

On Thu, 25 May 2023, Richard Earnshaw (lists) wrote:

> Thanks for the detailed explanation.  That makes sense, overall.  However...
> 
> I didn't think we had separate relocation rules for REL/RELA format 
> relocs.  I know that we recommend RELA for aarch64, but how would an 
> object file with REL format relocs be handled if src_mask is always 
> zero?

Right now the aarch64 bfd backend only support RELA 
(elf_backend_may_use_rel_p is off).  elf64-mips is an example that 
supports both, and it has separate howto tables for rel and rela 
descriptors (e.g. mips_elf64_howto_table_rel and 
mips_elf64_howto_table_rela), with the appropriate 
src_mask/partial_inplace settings depending on rel/rela:

  HOWTO (R_MIPS_32,             /* type */
         ...
         true,                  /* partial_inplace */
         0xffffffff,            /* src_mask */
         0xffffffff,            /* dst_mask */

vs.

  HOWTO (R_MIPS_32,             /* type */
         ...
         false,                 /* partial_inplace */
         0,                     /* src_mask */
         0xffffffff,            /* dst_mask */

the rtype_to_howto backend routine appropriately switches between those 
depending on side-info passed in parameters.  (Whereas the name_lookup and 
type_lookup routines always use the rela tables and contain a FIXME 
comment to that effect :) ).  Various non-mips embedded targets try to 
also support this, but often only for read-in, not for generating both 
types of relocs, and so get away with only one howto table.  (I believe (!)
mips is the only one that actively tries to get REL+RELA support correct).


Ciao,
Michael.

  reply	other threads:[~2023-05-25 12:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-10 14:04 Michael Matz
2023-05-17 14:35 ` Nick Clifton
2023-05-24 15:26 ` Richard Earnshaw (lists)
2023-05-24 16:03   ` Michael Matz
2023-05-25  9:35     ` Richard Earnshaw (lists)
2023-05-25 12:29       ` Michael Matz [this message]
2023-05-25 13:22         ` Richard Earnshaw (lists)
2023-05-25 14:12           ` Michael Matz
2023-05-25 15:56             ` Richard Earnshaw (lists)
2023-05-25 16:01               ` Michael Matz
2023-05-24 22:54   ` Alan Modra

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=alpine.LSU.2.20.2305251212000.13548@wotan.suse.de \
    --to=matz@suse.de \
    --cc=Richard.Earnshaw@arm.com \
    --cc=binutils@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).