[PATCH] Fix EXTERN_FORCE_RELOC for PE COFF

Donn Terry donnte@microsoft.com
Sun Nov 10 18:28:00 GMT 2002


Probably what's going on here is that there are OTHER patches that are
needed as
well to get this working.

MS PE appears to expect this to be true (AFAICT: I have no more official
access than
anyone else; I'm outside that firewall), but there are a number of
compensating
"errors" (let's not get into religion about that here) in bfd and gas
such that
this patch alone may not work.  The complete set of patches that handles
this
correctly was originally submitted sometime in '98 or early '99 (at this
remove,
I forget) and has been progressing slowly into place.  When *all* the
patches
are in place, I get a complete and internally consistent .o file that is
also
consistent with .obj files from MSVC as far as relocations are
concerned.  I'm
not sure it's possible to do that AND be backwards compatible with
cygwin
generated object files.

Let me suggest a strategy here: in a few places in the (still pending)
patches
I use the symbol "STRICT_PE_FORMAT" as an ifdef to indicate that this is
a place
where other PE formats and a strict interpretation of MS documents (and
comparison
of objects and executables) yield different results.  How about that as
changes
go in (either from Joel or me) that if there is a concern about the
change that
we wrap it in that symbol.  Once all the changes get in, we can look at
it as a
whole and determine both the backwards compatability issues (if any) and
which
of the various PE implementations want to use that.  Interix, of course,
will.

Donn

-----Original Message-----
From: Christopher Faylor [mailto:cgf@redhat.com] 
Sent: Sunday, November 10, 2002 3:22 PM
To: binutils@sources.redhat.com
Cc: Casper Hornstrup; Donn Terry; Joel Brobecker
Subject: Re: [PATCH] Fix EXTERN_FORCE_RELOC for PE COFF


On Mon, Nov 11, 2002 at 09:18:24AM +1030, Alan Modra wrote:
>On Sun, Nov 10, 2002 at 12:32:37PM +0100, Casper Hornstrup wrote:
>> I'm not sure if I'm just patching symptoms here, but I'm developing 
>> an OS that will not boot when built with binutils from CVS without 
>> this change.
>> 
>> 	* config/tc-i386.h (EXTERN_FORCE_RELOC): Return false for
>> 	output flavour bfd_target_coff_flavour.
>
>See http://sources.redhat.com/ml/binutils/2002-10/msg00346.html

Strange that this should come up.  I just released a new version of
binutils for cygwin and many people complained about strange behavior.

The most obvious behavior was that the cygwin dll itself wasn't built
correctly.  Calls into the dll seemed to be going to pseudo-random
locations in the dll rather than to the correct function.

I eventually tracked this down to the above patch to config/tc-i386.h.
Backing this out made things work correctly.

So, I think something is not right here, unfortunately.

cgf



More information about the Binutils mailing list