This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: linker bug 10515
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: binutils <binutils at sources dot redhat dot com>
- Date: Fri, 2 Oct 2009 16:10:54 +0930
- Subject: Re: linker bug 10515
- References: <4AC4A775.4000106@codesourcery.com>
On Thu, Oct 01, 2009 at 01:58:29PM +0100, Nathan Sidwell wrote:
> We could improve this by processing the PHDRS list such that a segment
> that must include the file headers is processed before the other segment
> placements.
Agreed. I came to the same conclusion when looking at this bug.
> But as the PHDRs statement is there for exactly when the
> linker's automatic segment placement algorithm is insufficient, it seems
> rude for the linker to go altering the placement specified in the PHDRS
> list.
You could argue that if a phdr is marked with FILEHDRS then it must
start at file offset zero, so you had better process that segment
first in assign_file_positions_for_load_sections. Do we promise that
PT_LOAD headers are allocated increasing file offsets? Not that I'm
saying we should implement this.
> 2) make it an error to have FILEHDRS and/or PHDRS in not-the-first
> segment of the PHDRS statement.
This is the best option IMO.
--
Alan Modra
Australia Development Lab, IBM