Yasm and bad Windows executables using Mingw/ld

Peter Johnson peter at tortall.net
Mon Dec 11 23:30:28 PST 2006


On Tue, 12 Dec 2006, Peter Tanski wrote:
> Maybe I was wrong about the original problem--it may not be due to the 
> presence or absence of the .stab and .stabstr sections.  Instead, the 
> .comment section seems to be the real difference:

<SNIP>

> The big difference between these two is the .comment and the PE-COFF 
> read-only data section, .rdata$zzz.  Yasm seems to follow the Nasm model for 
> putting the section header table into the .comment section (at the top, 
> following the ELF format), correct?.

Interesting.  No, Yasm only outputs a .comment section for PE/COFF if one 
is specified in the input file.  It doesn't add one otherwise. 
Apparently the GAS or binutils folks have run into this and ignore/drop 
the section for PE output?  I can certainly have yasm do the same thing. 
Alternatively, there's probably a way you can throw it away in the ld 
script (if you can modify it for your application).

Another thing to try would be using "strip --remove-section=.comment" on 
yasm's output file to verify the .comment section is really what's causing 
the problem.

Thanks,
Peter


More information about the yasm-devel mailing list