This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: binutils ld and new PT_GNU_PROPERTY segment
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Mark Wielaard <mark at klomp dot org>
- Cc: Rahul Chaudhry via gnu-gabi <gnu-gabi at sourceware dot org>, Binutils <binutils at sourceware dot org>, "Zhang, Annita" <annita dot zhang at intel dot com>
- Date: Tue, 18 Feb 2020 04:48:02 -0800
- Subject: Re: binutils ld and new PT_GNU_PROPERTY segment
- References: <a7078f74881daf23ca4af4983bac212a6c971b5a.camel@klomp.org>
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.