This is the mail archive of the binutils@sourceware.cygnus.com 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]

Re: Proposed objcopy patch


   Date: Fri, 14 May 1999 14:16:02 -0700
   From: Nick Clifton <nickc@cygnus.com>

     Would anyone care to comment on the patch below ?  It is a nasty hack
     which fixes a problem encountered when using objcopy to convert from
     a PE format image file into SRECs.  The PE format uses the LMA field
     as a virtual size rather a physical address, which confuses BFD when
     it comes to try to generate SRECs.

Please, no.  The LMA in isection->lma is in a BFD internal structure.
Those structures should be storing generic information.  That is, the
LMA field should always hold the LMA.  If the section lma field does
not hold the LMA for PE, then the correct solution is to change the PE
backend to store the correct value in the section lma field.  Right
now PE is probably simply setting the LMA field from the s_paddr
field; that would have to change.

Of course, the PE backend may rely on this on other ways, so the true
section size would to be stored elsewhere in PE specific information,
and any code which expected to see the section size in the lma field
would have to be changed.

Basically, though, it's unacceptable to change objcopy in order to
support a specific file format.  That destroys the whole point of
using BFD in the first place.

Ian

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