This is the mail archive of the
mailing list for the Cygwin project.
Invalid Win32 executable
- From: Tim Gift <timg at garagegames dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 27 Oct 2003 10:40:57 -0800
- Subject: Invalid Win32 executable
Cygwin gcc/ld sometimes generates executable that won't load (I'm using
Windows 2000) unless I remove the .stab and .stabstr sections using
strip. This currently only happens for one of my executables, others
compile and run/debug fine. There are several older references in the
mailing list archives about similar loading problems, but their causes
appeared to be different (ie. memory gaps in the PE sections, or ordering
problems). I'm using the gcc 3.3.1, and ld version 2.14.90.
The executable appears to be correct, it's "MS Windows PE 32-bit Intel
80386 console executable not relocatable" and information obtained from
objdump appears to be fine, except for the SizeOfHeaders field which
is 0. Comparing the "objdump -fhp" output of the stripped and unstripped
versions revealed that the SizeOfHeaders is the only difference
(besides the removed .stab sections and the expected checksum, image
size, and flag differences); SizeOfHeaders is 0 on the unstripped exe,
but is 400 in the stripped version.... the stripped exe loads and runs
I don't know enough about the PE format to know if this is really a
problem, but it's the only difference I've found so far. If the 0
SizeOfHeaders is the problem... is it a known bug with the linker?
Any thoughts or clues would be appreciated.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html