[RFC 4/4] ld: bfd: sframe: fix incorrect r_addend in RELA entries
Michael Matz
matz@suse.de
Mon Mar 24 16:08:00 GMT 2025
Hello,
On Mon, 24 Mar 2025, Jan Beulich wrote:
> > That's true. But overall this section rewriting by the link editor
> > (instead of just cat-ing selected individual sections together into one
> > output blob) is not something new. string section merging is doing the
> > same on a smaller scale, and relocations into those need to be rewritten
> > in a similar vain, and in particular by understanding the section
> > content/format (in string sections that's of course very simple, but it's
> > still interpreting the section content).
> >
> > I don't know if the sframe merging is optional or not (like string merging
> > is), to retain normal reloc behaviour it better should be (so that, as you
> > say, unaware tools would still do the right thing). But either way,
> > there's precedent for reloc-mangling based on section content.
>
> Yes and no. SHF_MERGE (alone or together with SHF_STRING) properly describes
> the contents, as to what needs doing to it when linking. Whereas here each
> tool needs to learn what to do about sections of a certain, special name,
> which aren't even otherwise recognizable or distinguishable.
Yes, a separate ELF section type would have been definitely proper here
:-/
Ciao,
Michael.
(and sorry for reviving an old thread, I had some backlog and didn't
notice)
More information about the Binutils
mailing list