[rx,head,2.21] fix lma/vma swap when reading executables in

Alan Modra amodra@gmail.com
Tue May 24 06:27:00 GMT 2011


On Mon, May 23, 2011 at 11:58:15PM -0400, DJ Delorie wrote:
> 
> > On Mon, May 23, 2011 at 03:50:43PM -0400, DJ Delorie wrote:
> > > +  /* For each PHDR in the object, we must find some section that
> > 
> > Limit to just PT_LOAD phdrs?
> 
> You could, but it shouldn't matter - it only affects the VMA of
> segments and the LMA of sections.  The segments would only be used by,
> for example, SREC outputs, which only use PT_LOAD anyway, and sections
> are normally used for their VMA, not LMA.  I haven't verified this,
> but I think it might compute the correct values anyway - the altered
> field is not used in computations on read-in.
> 
> I'll add one if you want, though.  It would add symmetry :-) (and
> paranoia)

I think it might work better..  Other phdrs (with zero p_offset and
p_filesz) will match all sections the way you've written the tests.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list