From 785f5c9c50808998c3a6834eb7c254d530d6ef2b Mon Sep 17 00:00:00 2001 From: Martell Malone Date: Tue, 28 Jul 2015 16:18:17 +0000 Subject: [PATCH] Summary: Object: add IMAGE_FILE_MACHINE_ARM64 The official specifications state that the value of IMAGE_FILE_MACHINE_ARM64 is 0xAA64 (as per the Microsoft Portable Executable and Common Object Format Specification v8.3). Reviewers: rnk Subscribers: llvm-commits, compnerd, ruiu Differential Revision: http://reviews.llvm.org/D11511 llvm-svn: 243434 --- docs/yaml2obj.rst | 1 + include/llvm/Support/COFF.h | 1 + lib/Object/COFFObjectFile.cpp | 4 ++++ lib/Object/COFFYAML.cpp | 1 + 4 files changed, 7 insertions(+) diff --git a/docs/yaml2obj.rst b/docs/yaml2obj.rst index 1812e58914a..d18ce02a336 100644 --- a/docs/yaml2obj.rst +++ b/docs/yaml2obj.rst @@ -65,6 +65,7 @@ Here's a simplified Kwalify_ schema with an extension to allow alternate types. , IMAGE_FILE_MACHINE_AMD64 , IMAGE_FILE_MACHINE_ARM , IMAGE_FILE_MACHINE_ARMNT + , IMAGE_FILE_MACHINE_ARM64 , IMAGE_FILE_MACHINE_EBC , IMAGE_FILE_MACHINE_I386 , IMAGE_FILE_MACHINE_IA64 diff --git a/include/llvm/Support/COFF.h b/include/llvm/Support/COFF.h index 3c5ee06969d..4de21313eaa 100644 --- a/include/llvm/Support/COFF.h +++ b/include/llvm/Support/COFF.h @@ -88,6 +88,7 @@ namespace COFF { IMAGE_FILE_MACHINE_AMD64 = 0x8664, IMAGE_FILE_MACHINE_ARM = 0x1C0, IMAGE_FILE_MACHINE_ARMNT = 0x1C4, + IMAGE_FILE_MACHINE_ARM64 = 0xAA64, IMAGE_FILE_MACHINE_EBC = 0xEBC, IMAGE_FILE_MACHINE_I386 = 0x14C, IMAGE_FILE_MACHINE_IA64 = 0x200, diff --git a/lib/Object/COFFObjectFile.cpp b/lib/Object/COFFObjectFile.cpp index bcca9839b47..1ae8059a021 100644 --- a/lib/Object/COFFObjectFile.cpp +++ b/lib/Object/COFFObjectFile.cpp @@ -744,6 +744,8 @@ StringRef COFFObjectFile::getFileFormatName() const { return "COFF-x86-64"; case COFF::IMAGE_FILE_MACHINE_ARMNT: return "COFF-ARM"; + case COFF::IMAGE_FILE_MACHINE_ARM64: + return "COFF-ARM64"; default: return "COFF-"; } @@ -757,6 +759,8 @@ unsigned COFFObjectFile::getArch() const { return Triple::x86_64; case COFF::IMAGE_FILE_MACHINE_ARMNT: return Triple::thumb; + case COFF::IMAGE_FILE_MACHINE_ARM64: + return Triple::aarch64; default: return Triple::UnknownArch; } diff --git a/lib/Object/COFFYAML.cpp b/lib/Object/COFFYAML.cpp index 9a24b531da9..213b6bf9e30 100644 --- a/lib/Object/COFFYAML.cpp +++ b/lib/Object/COFFYAML.cpp @@ -56,6 +56,7 @@ void ScalarEnumerationTraits::enumeration( ECase(IMAGE_FILE_MACHINE_AMD64); ECase(IMAGE_FILE_MACHINE_ARM); ECase(IMAGE_FILE_MACHINE_ARMNT); + ECase(IMAGE_FILE_MACHINE_ARM64); ECase(IMAGE_FILE_MACHINE_EBC); ECase(IMAGE_FILE_MACHINE_I386); ECase(IMAGE_FILE_MACHINE_IA64);