From 8c6bfd1c241c6833f31eb61fc1e6a5fa75911f0e Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Tue, 17 Aug 2010 21:05:54 +0000 Subject: [PATCH] Add some win64 coff goodness. Patch by Cameron Esfahani! llvm-svn: 111287 --- include/llvm/MC/MCAssembler.h | 2 +- include/llvm/Support/COFF.h | 25 ++++++++++++++++++++++++- test/Scripts/coff-dump.py | 21 ++++++++++++++++++++- 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h index 201df5eeaf0..d193b986a93 100644 --- a/include/llvm/MC/MCAssembler.h +++ b/include/llvm/MC/MCAssembler.h @@ -164,7 +164,7 @@ class MCInstFragment : public MCFragment { /// Inst - The instruction this is a fragment for. MCInst Inst; - /// InstSize - The size of the currently encoded instruction. + /// Code - Binary data for the currently encoded instruction. SmallString<8> Code; /// Fixups - The list of fixups in this fragment. diff --git a/include/llvm/Support/COFF.h b/include/llvm/Support/COFF.h index 5af4b29bca1..a25cc78183b 100644 --- a/include/llvm/Support/COFF.h +++ b/include/llvm/Support/COFF.h @@ -48,6 +48,11 @@ namespace COFF { uint16_t Characteristics; }; + enum MachineTypes { + IMAGE_FILE_MACHINE_I386 = 0x14C, + IMAGINE_FILE_MACHINE_AMD64 = 0x8664 + }; + struct symbol { char Name[NameSize]; uint32_t Value; @@ -199,7 +204,25 @@ namespace COFF { IMAGE_REL_I386_SECREL = 0x000B, IMAGE_REL_I386_TOKEN = 0x000C, IMAGE_REL_I386_SECREL7 = 0x000D, - IMAGE_REL_I386_REL32 = 0x0014 + IMAGE_REL_I386_REL32 = 0x0014, + + IMAGE_REL_AMD64_ABSOLUTE = 0x0000, + IMAGE_REL_AMD64_ADDR64 = 0x0001, + IMAGE_REL_AMD64_ADDR32 = 0x0002, + IMAGE_REL_AMD64_ADDR32NB = 0x0003, + IMAGE_REL_AMD64_REL32 = 0x0004, + IMAGE_REL_AMD64_REL32_1 = 0x0005, + IMAGE_REL_AMD64_REL32_2 = 0x0006, + IMAGE_REL_AMD64_REL32_3 = 0x0007, + IMAGE_REL_AMD64_REL32_4 = 0x0008, + IMAGE_REL_AMD64_REL32_5 = 0x0009, + IMAGE_REL_AMD64_SECTION = 0x000A, + IMAGE_REL_AMD64_SECREL = 0x000B, + IMAGE_REL_AMD64_SECREL7 = 0x000C, + IMAGE_REL_AMD64_TOKEN = 0x000D, + IMAGE_REL_AMD64_SREL32 = 0x000E, + IMAGE_REL_AMD64_PAIR = 0x000F, + IMAGE_REL_AMD64_SSPAN32 = 0x0010 }; enum COMDATType { diff --git a/test/Scripts/coff-dump.py b/test/Scripts/coff-dump.py index 57a58134702..464ab3110b4 100755 --- a/test/Scripts/coff-dump.py +++ b/test/Scripts/coff-dump.py @@ -32,7 +32,7 @@ file = ('struct', [ ('MachineType', ('enum', '