This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: Add GNU_PROPERTY_NEED_PHDRS
- From: Michael Matz <matz at suse dot de>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- 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 14:52:02 +0000 (UTC)
- Subject: Re: RFC: Add GNU_PROPERTY_NEED_PHDRS
- References: <CAMe9rOrrshfuAEx3J1E6bZwk7zyMpud-_=YU7rWpj8nx8cgfwQ@mail.gmail.com>
Hi,
On Fri, 28 Sep 2018, H.J. Lu wrote:
> >> AT_PHDR to main, which points to the unmmaped address. We can ask
> >> for kernel change or make kernel happy.
> >
> > Kernel change does not help because nobody is obligated to use a new
> > kernel. Binutils would be producing binaries that don't work on
> > existing kernels (if the note hack were reverted or if similar changes
> > were added to other archs without a note hack; right now of course
> > it's working again).
>
> True.
>
> >> My current .note.gnu.property patch only works for x86. We can add
> >>
> >> #define GNU_PROPERTY_PHDRS 3
> >>
> >> so that it can be used for all targets.
> >
> > What would this do?
>
> These are what I have in mind.
I don't see how the patches fix anything, in particular making sure that
the phdrs are always mapped. If your intention is (it would be good if
you can explain it with words) that they only would be made mapped if this
new property is set, then I'd disagree. I think they should always be
made mapped unconditionally. There are two ways for this: (a) add a new
PT_LOAD that covers them, (b) move the phdrs into the ro data segment. I
find all approaches that add properties or new section types or anything
else that needs documentation and definition dubious.
Ciao,
Michael.