.stab & .stabstr must be included in the linker input
file [-T linker-input-file] to generate a valid pe-i386
or pei-i386 executable. Any idea why?
Sample Linker Input File
Logged In: YES
Those sections must be marked as NOLOAD. So iff any of
the object files in your link contain these debug
sections, the linker script must include them.
You should be able to fix your invalid exe by stripping
the debug sections.
This is not really a mingw bug. You could probably get a
better explanation on the binutils list.