[PATCH] packing sections into elf segments

Alan Modra amodra@bigpond.net.au
Mon Oct 29 16:34:00 GMT 2001


On Fri, Oct 26, 2001 at 06:44:51PM +0100, Richard Earnshaw wrote:
> 
> I'd like to submit the following patch for consideration, it fixes a 
> problem I reported earlier today when the bfd backend would perform seeks 
> to negative file offsets when a segment contains sections that are linked 
> for different virtual addresses, but are to be loaded at one physical 
> address.
> 
> It makes more sense to me that when we are trying to adjust for the 
> alignment padding between sections by adjusting file positions, that we 
> should be using the LMAs not the VMAs, after all, the code later in the 
> same loop uses LMAs for adjusting the file size.

Seems like no one is willing to stick their neck out and comment. :)
Oh well, here goes.

a) The ELF spec seems far more interested in virtual addresses than
   physical ones.  I'm worried that this change may remove some required
   adjustment.  What about m->p_paddr_valid ?  No, I don't have any
   specific complaint..
b) If this patch goes in, then the PT_LOAD adjustments a little later
   aren't needed.

> The patch should have no effect on the behaviour of the normal case, where 
> the VMA and LMA are identical.



More information about the Binutils mailing list