[PATCH] PR30437 aarch64: make RELA relocs idempotent

Michael Matz matz@suse.de
Thu May 25 16:01:47 GMT 2023


Hello,

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

> > (And of course, it's always possible that REL relocations cannot always be
> > used to achieve idempotence even in presence of 'ld -r', in which case
> > RELA must be used.  The aarch64 psABI thankfully even spells this out.)
> 
> There's no fundamental reason why a toolchain doing 'ld -r' can't always emit
> RELA format relocs, even if the input format was REL.  In fact, I'd argue that
> really it has to in most cases as 'ld -r' destroys the information that's
> needed to reprocess the relocations.

Right.

> But I agree with you, this is all likely broken in BFD because we have 
> no way of testing it (gas can't create multiple relocs to a single 
> location to the best of my knowledge).

With the .reloc directive it should be possible.  But if you try to do 
that you probably go down a rabbit hole of strange and wonderful 
proportions :)


Ciao,
Michael.


More information about the Binutils mailing list