[llvm-commits] [PATCH][System::Path] Add x86-64 COFF to IdentifyFileType

Michael Spencer bigcheesegs at gmail.com
Wed Sep 15 14:48:45 PDT 2010


On Wed, Sep 15, 2010 at 3:23 PM, Rafael Espindola <espindola at google.com> wrote:
> On 14 September 2010 17:12, Michael Spencer <bigcheesegs at gmail.com> wrote:
>> The attached patch adds x86-64 COFF to Path::IdentifyFileType. This patch is a
>> prerequisite for the object file library I am writing, although makes
>> sense in general.
>
> Coff uses the same magic for all objecs (relocatable, libs and executables)?
>
> I think this is fine anyway. Can you just add a comment saying it is
> x86-64 windows? There are similar comments for the other windows
> arches.

There are actually two different formats on windows that people refer
to as COFF. The first is pure COFF, which has no magic number, and the
first uint16_t of the file is the machine type. This file is only ever
an object file. It's never anything else on windows. And there is no
difference between a i386 COFF file and a x86-64 one except for these
first two bytes.

The second format is PE/COFF. This is what windows uses for images
such as exe's and dll's. This format does have magic number 0x3c bytes
into the file.

I'll add a comment saying what type it is.

Thanks for the review!

- Michael Spencer

>> - Michael Spencer
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
>
>
> Cheers,
> --
> Rafael Ávila de Espíndola
>




More information about the llvm-commits mailing list