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: linker bug 10515


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


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