Pierre Free Pascal
pierre at freepascal.org
Fri Nov 7 15:01:40 CET 2014
The is no COFF magic.
the first 2 bytes indicate normally a MACHINE type.
The files I produced start etiher by:
0x8664 indicating a x86 coff header
0x014c indicating a i386 coff header.
0x0000 is also listed as IMAGE_FILE_MACHINE_UNKNOWN
Could it be that your coff object only contains raw data,
so that it is usable on different formats?
After some searching, I think that the
answer to your problem is here:
Your header looks like a BigObjHeader
This means that the object is prepared to handle relocation that are not in
range... A feature that Free Pascal indeed does not support IIRC...
There is probably an option somewhere to use normal 32-bit relocation type
objects in you Visual C++ configuration, unless you really need those 64-bit
> -----Message d'origine-----
> De : fpc-devel-bounces at lists.freepascal.org [mailto:fpc-devel-
> bounces at lists.freepascal.org] De la part de Adriaan van Os
> Envoyé : vendredi 7 novembre 2014 13:10
> À : FPC developers' list
> Objet : Re: [fpc-devel] Masm
> > 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
> > VCC produced .obj or .lib ?
> I found the COFF docs here <http://wiki.osdev.org/COFF> and here
> the Visual C++ produced .obj has a header that starts with
> 00 00 FF FF 01 00 4C 01 ....
> The FPC .o has a header that starts with
> 4C 01 ....
> which indicates a standard COFF header (as checked by
> I can not make anything of the Visual C++ produced .obj with the
> Microsoft provides docs. If that
> isn't typically Microsoft ... How to corrupt any standard by "slightly
> modifying" it .... I will
> look further to dig up some meaningful info.
> Adriaan van Os
> fpc-devel maillist - fpc-devel at lists.freepascal.org
More information about the fpc-devel