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: bfd/peigen.c problems and fix


I finally(!!) found some time to look at this more closely.
Here's the story:

1) I have some pending patches (Ian has a copy, but it's probably
   pretty rotten by now) whose purpose is to remove the zillions
   of special cases for ImageBase throughout the code and consolidate
   them to a few critical places.

2) The patch that we're discussing here (1.9) to peigen.c has
   four themes (at least) in it.  One is to deal with the consequences
   of the patch above not having been applied.  Those are reasonable
   for now (until the pending patch is refreshed and applied).  (That
   patch also trips an issue that Ian and I are still trying to work
   out the details on; that's why it got delayed.)  (I believe that
   there's a technical reason as well as simple clarity to fix ImageBase
   this way, but it will be until I'm submitting patches before I get the
   time to re-explore that).  (An example of the kind of thing that
   just goes away is the stuff about ImageBase in the vicinity of line
   480 in peigen.c.  The number of mentions of ImageBase (and thus
   the number of possible future bugs in that regard) drops significantly.

3) The other themes in the patch are:
   whether "adj" is positive or negative.  That's a subjective call.
   The way it is now (after the patch) is fine.  It would be a bit
   clearer the other way after the ImageBase cleanup occurs, but it
   is a subjective call.

4) Changing so it will believe the DataDirectory even in the presence
   of an .idata or .edata section.  I've never seen a situation where
   there is a .idata or .edata, AND the DataDirectory doesn't point to
   .idata (resp .edata) but I don't see that the change hurts anything.
   (My objective in writing the code that way was to preserve the (long)
   prior behavior of using .idata or .edata exclusively, and to fall
   back to the DataDirectory only in their absence.  If no-one cares
   to preserve that ancient behavior, then the patch is an improvement.)
   (If I may speculate... this was the first fix made, and when it still
   didn't work then the ImageBase fix came next.  Or did someone actually
   run into an file with .[ie]data and a DataDirectory that didn't match?)

5) Adding dumping of a new data directory entry.  No comment.

I built the exact CVS bits (from a few days ago), without change (and
just tested objdump).  It works fine on MSVC4 executables, but for MSVC5
(and 6) executables, it still chokes due to an object file format change.
(It doesn't recognize the file type.  That includes DLLs included in win2k,
by experiment).  There's code there to fix it, but it doesn't quite
work.  I have a fix for that, so if folks can wait until I get that
signature....

Speaking only for myself.

Donn

> -----Original Message-----
> From: Alan Modra [mailto:alan@linuxcare.com.au]
> Sent: Tuesday, May 09, 2000 4:29 PM
> To: Donn Terry
> Cc: 'Szabolcs Szakacsits'; binutils@sourceware.cygnus.com
> Subject: RE: bfd/peigen.c problems and fix
> 
> 
> On Tue, 9 May 2000, Donn Terry wrote:
> 
> > However, the code that finds 
> > the import and export tables when they're not in .idata
> > and .edata is still applicable.  Please restore it
> > so that it can find them.
> 
> That code is still there, Donn.  The part that was removed 
> was the code
> that _only_ looked in .idata/.edata if .idata/.edata was present.
> 
> In any case, if it's wrong, you're welcome to send patches ;-)
> 
> Regards, Alan Modra
> -- 
> Linuxcare.  Support for the Revolution.
> 

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