This message was previously on the mailing lists, (then
improperly posted here), but has been
reposted here as it appears to have slipped through the cracks.
Attached is a diff which adds a new subformat to the 'COFF'
object module formats, called 'gnuwin32'. It is the result of my
work to resolve a failure of .bss sections emitted from NASM
under '-f win32' to function properly when linked against
MinGW32. I would assume that Cygwin's object module format
has the same difference, but I have not tested it.
The difference is in the value the 'Virtual Size of Section'
receives. Note 4 in the 'Notes on COFF' in outcoff.c mentions that
both DJGPP/standard COFF and MS Win32 COFF seem to
agree on the value set to this field. MinGW32 with gcc 3.1-
20020516-1 and binutils 2.12.90-20020518-1 appears to disagree
with both, as did an older MinGW32 (binutils 2.10.91-20010114
and gcc 2.95.2 snapshot 3). The disagreement appears to have
zero set to that field in non-.bss sections, and the section size set
to it in .bss sections (and the data size section set to zero).
Adding a new NASM COFF subformat which follows those
guidelines appears to resolve the .bss-related issues.
Ultimately, this fix is a hack, since the incompatibility is likely not
between NASM and MinGW32/Cygwin, but between
MinGW32/Cygwin and MS Win32 COFF.
Charles Bilyue'
Relevent patches against NASM 0.98.34
Is this still relevant?