Cross problem
Ian Lance Taylor
ian@cygnus.com
Thu Dec 18 08:34:00 GMT 1997
Date: Thu, 18 Dec 1997 13:53:03 +0100
From: Martin Kahlert <kahlert@martin.kahlert@mchp.siemens.de>
I think i found a hint for my problem:
nm exefile says, that main starts at a position like 00000050,
but when I do the same with the native NT compiler, I get about
00400050. The strangest thing is, that the linux hosted nm
thinks, main is at about 00400050, but the NT hosted nm
has a different opinion....
You may do better to send cygwin32 problems to gnu-win32@cygnus.com.
Problems like NT failing to execute binaries most likely have nothing
to do with egcs per se.
The b18 cygwin32 release, and the binutils 2.8.1 release, produce NT
object files using i386 COFF. Unfortunately, Microsoft choose to use
an object file format, known as PE, which, though quite similar to
COFF, differs in some crucial details. One of those details is the
meaning of the value of a defined symbol. In standard COFF, the value
of a defined symbol includes the address of the section in which it is
defined. In the PE format, the value of a defined symbol is relative
to the start of a section.
I believe this explains the discrepancy in the nm output that you are
seeing.
The next cygwin32 release, and the next binutils release, will
generate objects in the correct PE format. Of course, this will force
people to recompile or reassemble all of their object files.
The discrepancy in the symbol table does not, however, explain why NT
will not execute your binaries. I do not know why that is happening.
One possibility is that your executables have sections which NT does
not recognize, perhaps exception handling sections generated by egcs
(in which case I suppose this would be an egcs related problem after
all). You may have to change your linker script to stuff any such
sections into the .text section of the executable.
Ian
More information about the Gcc-bugs
mailing list