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]

i386-mingw32 binaries don't run on Windows NT


Hello,

yes, this sounds similar as the problem mentioned by Jan-Jaap van der Heijden
in http://sourceware.cygnus.com/ml/binutils/1999-10/msg00008.html but I
haven't found a patch or solution so far.

BTW, the patch from Nick Clifton fixing core dumps displaying PE DLLs
(http://sourceware.cygnus.com/ml/binutils/1999-11/msg00092.html) should
definitely make it into the snapshots.

I'm trying to build a CROSS on a host hppa1.1-hp-hpux10.20 for the target
i386-mingw32, prefix is /opt/mingw32. I'm building this using gcc-2.95.2 and
binutils-991107. I've followed Mumit Khan's advises on how to build such a
CROSS.

I built the holy hello_world and tried to run it on NT. The message box says:
    The application failed to initialize properly (0xc0000005). ...

I then built hello_world on NT using egcs-1.1.2-mingw32.zip (this one worked)
and compared it with the bad one. Objdump -p hello[.exe] showed some
differences. The important one seems to be in the output labeled as The Data
Directory, Entry 1 (Import Directory). The working program showed 00004000 as
the first number whereas the bad one showed 00304000.

I even tried to narrow the problem down to ld. I transfered all the object
files and libraries from the NT version (including hello.o) to the UNIX system
and started the ld command there. Same effect: the output is bad.

If I patch the generated programs (using XEmacs, hexl-mode) at that specific
position so that objdump also shows 00004000 the program runs on NT.

Now I also have seen code in peigen.c:_bfd_pei_final_link_postscript() that
modifies DataDirectory[1].VirtualAddress if .idata$2 is found and doesn't do
anything if the program only has .idata, but I don't know if that is related.

Another difference objdump shows: the characteristics on the NT generated
program include "32 bit words" where this bit (F_AR32WR) is not set in the
UNIX generated program.

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