[fpc-devel] Masm

Adriaan van Os fpc at microbizz.nl
Fri Nov 7 11:25:02 CET 2014


Marco van de Voort wrote:
> In our previous episode, Adriaan van Os said:
>> It is rather unfortunate that fpc can only link OMF, not COFF on Windows (I read on some previous 
>> posts that it is the other way round, but according to 
>> <http://stackoverflow.com/questions/966597/whats-the-difference-between-the-omf-and-coff-format> 
>> and <http://www.iecc.com/linker/linker03.html> that doesn't seem to be the case).
> 
> Easiest is to check the files with cygwin "file", and then you'll see:
> 
> C:\pp32\units\i386-win32\ptc>file ptc.o
> ptc.o: MS Windows COFF Intel 80386 object file
> 
> FPC is COFF, and I don't see anything in the referenced links saying
> otherwise. The stackoverflow link is quite old.
> 
> The first link seems to indicate that VSS can generate both omf and coff, so
> let it generate COFF ?

Well, according to <http://msdn.microsoft.com/en-us/library/s0ksfwcf.aspx>

omf
Generates object module file format (OMF) type of object module. /omf implies /c; ML.exe does not 
support linking OMF objects.
Not available in ml64.exe.

So, COFF seems to be the standard for VCC. When I run mingw-objdump I get "file format pe-i386" for 
both a VCC .obj and an FPC .o.

But .... if the formats are the same, what is the cause of the error message " Illegal COFF Magic" 
when trying to statically link with FPC a VCC produced .obj or .lib ?

Regards,

Adriaan van Os



More information about the fpc-devel mailing list