[PECOFF] Add a field for machine type to PECOFFLinkingContext.
So that we can determine what the target architecture is. Adding this
field does not mean that we are going to support non-i386 architectures
soon; there are many things to do to support them, and I'm focusing on
i386 now. But this is the first step toward multi architecture support.
llvm-svn: 190627
diff --git a/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp b/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
index 48ee6cb..542e1e9 100644
--- a/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
+++ b/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
@@ -55,6 +55,12 @@
return true;
}
+ // Architectures other than i386 is not supported yet.
+ if (_machineType != llvm::COFF::IMAGE_FILE_MACHINE_I386) {
+ diagnostics << "Machine type other than x86 is not supported.\n";
+ return true;
+ }
+
_reader = createReaderPECOFF(*this);
_writer = createWriterPECOFF(*this);
return false;