Menu

#53 MinGW32 object format incompatbility *RP

open
nobody
None
5
2002-10-18
2002-10-18
No

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'

Discussion

  • Charles Bilyue

    Charles Bilyue - 2002-10-18

    Relevent patches against NASM 0.98.34

     
  • H. Peter Anvin

    H. Peter Anvin - 2008-10-15

    Is this still relevant?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.