Yasm and bad Windows executables using Mingw/ld

Peter Johnson peter at tortall.net
Wed Dec 13 11:11:04 PST 2006


On Tue, 12 Dec 2006, Peter Tanski wrote:
> The .comment section in the output is created from the GHC-default directive:
>
> .ident "GHC 6.6"
>
> at the end of the assembler file.  (You already know this has the value 
> IMAGE_SCN_LNK_INFO (or STYP_INFO), value 0x00000200.)
>
> For compatibility with binutils/ld, which loads .comment sections into memory 
> (invalid in PE-COFF files), and since the section must be read only, GAS 
> outputs the .comment section to a specially named ".rdata" section: 
> ".rdata$zzz".
>
<SNIP>
>
> So modification would only be necessary for compatibility with binutils/ld. 
> I can look into modifications to Yasm to save you some time; I am not sure 
> whether you would *want* to modify Yasm's output just for compatibility with 
> binutils/ld, unless that was specified by a different output format than 
> win32.

I'll go ahead and handle it for compatibility's sake.  It makes it 
significantly easier that it comes in through the .ident directive (I 
should have guessed that was the case).

Thanks for tracking down the cause.  I'll take care of getting it patched 
in Yasm.

Peter


More information about the yasm-devel mailing list