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: binutils ld and new PT_GNU_PROPERTY segment


On Tue, Feb 18, 2020 at 4:38 AM Mark Wielaard <mark@klomp.org> wrote:
>
> Hi,
>
> binutils 2.32 ld emits a new PT_GNU_PROPERTY (PT_LOOS + 0x474e553)
> segment that overlaps with the PT_NOTE segment covering the
> .note.gnu.property section data.
>
> I cannot tell if this is an accident/experiment that happened to end up
> in a release or if it is proposed as an official new segment type.

https://sourceware.org/ml/gnu-gabi/2018-q4/msg00027.html
https://github.com/hjl-tools/linux-abi/wiki/Linux-Extensions-to-gABI

> As far as I can tell binutils ld is the only linker which adds this

Annita, does lld generate PT_GNU_PROPERTY segment with CET? If not,
it is an lld bug.

> extra segment and there is no runtime loader which uses it. It doesn't
> provide any new information that cannot be found in the existing
> PT_NOTE segment.

Kernel loader uses it for both ARM and x86.

> On 64 bit architectures it simply covers the extra existing PT_NOTE
> with 8 byte alignment (normal PT_NOTE segments are 4 byte aligned). On
> 32bit architectures it covers a sub-range of the existing PT_NOTE
> segment.
>
> It isn't clear to me how other tools should handle this. It seems to
> prevent normal merging of note sections. Since some notes are probably
> special if they need to be covered by this new segment type. And it
> isn't clear how the linker knows which of the SHT_NOTE sections is what
> needs to be covered by the new segment type. Or is the idea that this
> will eventually come with a new section type too and GNU properties
> will no longer use NOTE sections?
>

PT_GNU_PROPERTY covers .note.gnu.property section.


-- 
H.J.


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