RFC: Add GNU_PROPERTY_NEED_PHDRS

Michael Matz matz@suse.de
Tue Oct 2 14:52:00 GMT 2018


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.



More information about the Binutils mailing list