This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: Proposed objcopy patch
- To: nickc@cygnus.com
- Subject: Re: Proposed objcopy patch
- From: Ian Lance Taylor <ian@airs.com>
- Date: 14 May 1999 21:16:18 -0400
- CC: binutils@sourceware.cygnus.com
- References: <199905142116.OAA18159@elmo.cygnus.com>
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