[PATCH] D34833: [LLD] [COFF] Add initial support for linking ARM64 binaries

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 13:32:49 PDT 2017


mstorsjo created this revision.
Herald added subscribers: kristof.beyls, aemerson.

A plain empty main function, linked with "lld-link test.o -out:test.exe -entry:main" seems to load fine in wine.


https://reviews.llvm.org/D34833

Files:
  COFF/Config.h


Index: COFF/Config.h
===================================================================
--- COFF/Config.h
+++ COFF/Config.h
@@ -33,6 +33,7 @@
 static const auto AMD64 = llvm::COFF::IMAGE_FILE_MACHINE_AMD64;
 static const auto ARMNT = llvm::COFF::IMAGE_FILE_MACHINE_ARMNT;
 static const auto I386 = llvm::COFF::IMAGE_FILE_MACHINE_I386;
+static const auto ARM64 = llvm::COFF::IMAGE_FILE_MACHINE_ARM64;
 
 // Represents an /export option.
 struct Export {
@@ -73,7 +74,7 @@
 // Global configuration.
 struct Configuration {
   enum ManifestKind { SideBySide, Embed, No };
-  bool is64() { return Machine == AMD64; }
+  bool is64() { return Machine == AMD64 || Machine == ARM64; }
 
   llvm::COFF::MachineTypes Machine = IMAGE_FILE_MACHINE_UNKNOWN;
   bool Verbose = false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34833.104730.patch
Type: text/x-patch
Size: 771 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170629/bb89bf66/attachment.bin>


More information about the llvm-commits mailing list