This is the mail archive of the
mailing list for the binutils project.
Re: Fix for PR ld/20815 doesn't allow to build a working kernel
- From: Alan Modra <amodra at gmail dot com>
- To: Matthias Klose <doko at debian dot org>
- Cc: Nick Clifton <nickc at redhat dot com>, binutils <binutils at sourceware dot org>
- Date: Mon, 28 Nov 2016 08:48:12 +1030
- Subject: Re: Fix for PR ld/20815 doesn't allow to build a working kernel
- Authentication-results: sourceware.org; auth=none
- References: <email@example.com>
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.
Australia Development Lab, IBM