This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PT_NOTE alignment, NT_GNU_PROPERTY_TYPE_0, glibc and gold


On 08/23/2018 01:36 AM, Cary Coutant wrote:
Why should the loader have to go parsing everything in a generic PT_NOTE
segment anyway?

With 8-byte alignment, in practice, it is currently quite fast to discover
the new notes because the other notes have 4-byte alignment, so the PT_NOTE
segment with the property notes should be pleasantly short.

I understand the benefit of having a PT_NOTE segment containing
nothing but the one note, and this is certainly expedient, but it's
quite ugly and, I think, fragile. This really underscores the value of
defining a bespoke segment type for this one purpose.

Yes, the existing note processing in linkers makes this fragile.

How difficult would it be for glibc if the linker would consume the
existing .note.gnu.property sections, then generate an output section
with the same format (maybe minus the SHT_NOTE overhead), but using a
new section type in its own new segment type? You could continue to
look for 8-byte aligned legacy PT_NOTE segments, but could also look
for the new PT_GNU_PROPERTY segment.

It does not sound difficult to implement. This is based on the assumption that the current dynamic loader ignores unknown segment types (which I think is true).

But I don't view this a win because it doesn't take the 8-byte notes out of circulation. We'd still have to support both indefinitely, and would have update GCC as well. We can just keep using the existing code.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]