Yasm and bad Windows executables using Mingw/ld

Peter Tanski p.tanski at gmail.com
Tue Dec 12 05:59:51 PST 2006


On Dec 12, 2006, at 2:30 AM, Peter Johnson wrote:

> On Tue, 12 Dec 2006, Peter Tanski wrote:
>> 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.

Good idea.  Removing the .comment section before linking causes the  
linker to produce "undefined symbol" errors.  However, stripping  
the .comment section on the executable (after linking) produces a  
good executable.  I will look for something related to this issue in  
the gas source code...

Cheers,
Pete


More information about the yasm-devel mailing list