[PATCH] bfd/ELF: don't lose trailing globals from SHF_MERGE sections

Michael Matz matz@suse.de
Tue Oct 7 12:13:26 GMT 2025


Hello,

On Tue, 7 Oct 2025, Jan Beulich wrote:

> >> I actually wonder whether we shouldn't also respect offset > sec->rawsize,
> >> by adding offset - sec->rawsize to the return value.
> >>
> >> If, for whatever reason, this adjustment was unacceptable, the SEC_EXCLUDE
> >> check in elf_link_output_extsym() may want extending to also look for
> >> SEC_KEEP, which replaced sections will have set (afaict).
> > 
> > Have you found testcases taking that code path?
> 
> Yes (if "testcases" isn't meant to be limited to what is in the tree 
> right now),

Then consider me fairly interested :)  Anything I can try myself?

> and that other change was in fact the fix I had first tried. 
> Having thought of the (posted) alternative, I considered that the 
> hopefully more "clean" approach.

As said, I think it makes sense, but I'd love to watch it in action.


Ciao,
Michael.


More information about the Binutils mailing list