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: Fix for PR ld/20815 doesn't allow to build a working kernel


On Sun, Nov 27, 2016 at 07:51:42PM +0100, Matthias Klose wrote:
> Hi Nick,
> 
> https://bugs.debian.org/845690 reports that trunk 20161124 doesn't allow to
> build a working kernel on at least x86_64.  I verified that reverting the fix
> for PR ld/20815 allows to build a working kernel again.

At a guess it is the PT_LOAD program header sorting.  I strongly
believe we should not be sorting when the user supplies PHDRS,
regardless of what the ELF spec says about ordering of PT_LOAD.

In fact, perhaps we should lobby for a change in the spec..  Sorting
on p_vaddr seems odd to me.  p_vaddr isn't always unique (overlays)
and if we leave the PT_LOAD headers sorted by p_offset, which is how
ld creates them, then we'll have sequential reads from the file when
ld.so processes PT_LOAD headers.  What's more the sort we have at the
moment is unstable for overlays.

-- 
Alan Modra
Australia Development Lab, IBM


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