[PATCH] ld/ELF: explicitly place .note.gnu.property
Alan Modra
amodra@gmail.com
Mon Aug 18 09:44:15 GMT 2025
On Mon, Aug 18, 2025 at 10:00:59AM +0200, Jan Beulich wrote:
> On 18.08.2025 09:59, Jan Beulich wrote:
> > On 18.08.2025 09:49, Alan Modra wrote:
> >> On Mon, Aug 18, 2025 at 09:20:17AM +>> While I have your attention - do you have any insight into the PPC aspect
> >>> mentioned in one of the remarks?
> >>
> >> I don't know without looking at it under gdb, but at a guess a stub is
> >> being created with associated linker generated .eh_frame. Later,
> >> since you say .eh_frame is empty, another pass of section sizing makes
> >> the stub no longer needed.
> >
> > And whether a stub needs generating can be influenced by the placement of
> > .note.* sections?
>
> Oh, and - isn't SEC_KEEP then getting set prematurely for .eh_frame?
I had a look, it isn't anything to do with stubs. The linker
generated .eh_frame stays zero sized. It's there both with and
without your script change, but prior to the script change we had
.note.gnu.property, .text, .eh_frame. Afterwards it is .text,
.eh_frame, .note.gnu.property.
As you know there isn't any mapping of sections to segments in ELF
executables. The readelf -l display is calculated based on section
and segment addresses, and it can be confused by zero size sections.
The testsuite change is fine. I'm not even going to look at SEC_KEEP
and whether the section could be dropped. It's one of those sections
that is sized too late.
--
Alan Modra
More information about the Binutils
mailing list