This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: Add GNU_PROPERTY_NEED_PHDRS
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Michael Matz <matz at suse dot de>
- Cc: Rich Felker <dalias at libc dot org>, Cary Coutant <ccoutant at gmail dot com>, "Carlos O'Donell" <carlos at redhat dot com>, Florian Weimer <fweimer at redhat dot com>, Szabolcs Nagy <nsz at port70 dot net>, Jan Beulich <JBeulich at suse dot com>, Binutils <binutils at sourceware dot org>, gnu-gabi at sourceware dot org
- Date: Tue, 2 Oct 2018 08:35:33 -0700
- Subject: Re: RFC: Add GNU_PROPERTY_NEED_PHDRS
- References: <CAMe9rOrrshfuAEx3J1E6bZwk7zyMpud-_=YU7rWpj8nx8cgfwQ@mail.gmail.com> <alpine.LSU.2.21.1810021447240.7867@wotan.suse.de> <CAMe9rOq38bLRyNMaMDfdbK=NvFg2YxEwSL3SERL=iapPZ+4COg@mail.gmail.com> <alpine.LSU.2.21.1810021504450.7867@wotan.suse.de>
On Tue, Oct 2, 2018 at 8:13 AM Michael Matz <matz@suse.de> wrote:
>
> Hi,
>
> On Tue, 2 Oct 2018, H.J. Lu wrote:
>
> > A .note.gnu.property section will lead to a read-only data PT_LOAD segment
> > as the first PT_LOAD segment:
>
> Yes, and it's a hack. This section isn't necessary, it merely is the
> easiest (?) way you found to force ld to create the PT_LOAD segment you
> want. What about linker scripts that filter out all .note sections? You
> _still_ want the phdrs to be mapped in that case. You basically replace
> the current state (where the phdrs are mapped by accident) with a
> different state that still only works by accident. It would be better to
> make this work by design not accident.
>
If linker script discards a section, all bets are off. Anything can happen.
--
H.J.