Fix for PR ld/20815 doesn't allow to build a working kernel
Alan Modra
amodra@gmail.com
Sun Nov 27 22:18:00 GMT 2016
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
More information about the Binutils
mailing list