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: ELF phdrs in .debug files


On Mon, May 21, 2007 at 10:38:58PM -0700, Roland McGrath wrote:
> I think that's a sign of a fundamentally flawed implementation (unless
> you're only talking about p_offset values, which I've said don't matter).
> strip-to-debug should not be recomputing anything having to do with memory
> layout at all, just copying it verbatim.  Even as a generic tool, if
> objcopy changes program headers (unless you're changing section addresses
> explicitly) then it's not doing a faithful copying and that is just broken.

Well, that's what we do.  We take the old program headers, calculate a
segment map from that, then build a new set of program headers.  Yes,
that's broken if your criterion is that objcopy not change program
headers, but I'm not convinced that keeping the program headers
unchanged is generally a good idea.  Recalculating the program header
is very nice if you can cure a bad program header simply by passing a
file through objcopy.  ("Bad" can be lots of things.  eg. PR3535 where
apparently the Solaris linker doesn't set p_memsz of some headers.)

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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