From: "Lawrence Rust" Newsgroups: comp.os.msdos.djgpp References: <9bflht$l1$1 AT jake DOT esu DOT edu> Subject: Re: Using MASM generated COFF files with GPP (solution) Lines: 39 Organization: Software Systems X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: Date: Tue, 17 Apr 2001 10:37:11 +0100 NNTP-Posting-Host: 62.253.150.165 X-Complaints-To: abuse AT ntlworld DOT com X-Trace: news6-win.server.ntlworld.com 987500246 62.253.150.165 (Tue, 17 Apr 2001 10:37:26 BST) NNTP-Posting-Date: Tue, 17 Apr 2001 10:37:26 BST To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com There's a couple of extra wrinkles to this though. Microsoft and GNU differ about the format of relocation records in COFF files. As a result of this: 1. A call to an external subroutine from the assembler code is incorrectly fixed up by ld (the linker). 2. References to local static data are incorrectly fixed up by ld. To overcome these problems the COFF file produced by MASM must be patched before linking. I wrote a simple utility to do this which can be downloaded (with C source) from www.softsystem.co.uk/masm2djg.zip -- Lawrence Rust Software Systems www.softsystem.co.uk "Tom Hunt" wrote in message news:9bflht$l1$1 AT jake DOT esu DOT edu... > I posted a question about this a while back and just found a solution to the > problem. If someone posts a similar question in the future, this will fix > it. > > say we're writing a function foo and assembling it with MASM using the > command line > ml /c /coff foo.asm > > MASM will generate an object file instead of an exe file in COFF format > instead of its usual OMF format. [snip] > that's all there is too it. When I compiled the whole thing, the link phase > took a lot longer than it usually does, so just minimize the dos window > you're using if you're running Windows and do something else for a bit.