[PATCH] gold: Place .note.gnu.property section before other note sections

Cary Coutant ccoutant@gmail.com
Tue Oct 26 23:08:46 GMT 2021


>         PR gold/28494
>         * layout.cc (Layout::create_note): Set order to ORDER_PROPERTY_NOTE
>         for the .note.gnu.property section.
>         * layout.h (Output_section_order): Add ORDER_PROPERTY_NOTE.

I'd prefer something more general, but it would be considerably more
involved. Ideally, we'd recognize which sections would be broken by
internal padding (like SHT_NOTE sections, but also perhaps others),
and we could set the "must sort attached input sections" flag, then
sort the input sections so that 8-byte-aligned sections always come
first.

This is OK, but it's a reluctant OK.

I'm telling myself that this treatment is more compatible with the
notion that these particular SHT_NOTE sections really ought to be
SHT_GNU_PROPERTY sections, and would go into a PT_GNU_PROPERTY
segment. Except for the SHT_ and PT_ names, this is probably how we
would have handled it in that alternate universe.

-cary


More information about the Binutils mailing list