summaryrefslogtreecommitdiff
path: root/lib/ReaderWriter/ELF/X86_64/ExampleSubTarget/ExampleLinkingContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ReaderWriter/ELF/X86_64/ExampleSubTarget/ExampleLinkingContext.cpp')
-rw-r--r--lib/ReaderWriter/ELF/X86_64/ExampleSubTarget/ExampleLinkingContext.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/ReaderWriter/ELF/X86_64/ExampleSubTarget/ExampleLinkingContext.cpp b/lib/ReaderWriter/ELF/X86_64/ExampleSubTarget/ExampleLinkingContext.cpp
new file mode 100644
index 0000000000000..dbbb3ad3bc90d
--- /dev/null
+++ b/lib/ReaderWriter/ELF/X86_64/ExampleSubTarget/ExampleLinkingContext.cpp
@@ -0,0 +1,35 @@
+//===- lib/ReaderWriter/ELF/X86_64/ExampleTarget/ExampleLinkingContext.cpp ----===//
+//
+// The LLVM Linker
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "ExampleLinkingContext.h"
+#include "ExampleTargetHandler.h"
+
+using namespace lld;
+using namespace elf;
+
+std::unique_ptr<ELFLinkingContext>
+ExampleLinkingContext::create(llvm::Triple triple) {
+ if (triple.getVendorName() == "example")
+ return llvm::make_unique<ExampleLinkingContext>(triple);
+ return nullptr;
+}
+
+ExampleLinkingContext::ExampleLinkingContext(llvm::Triple triple)
+ : X86_64LinkingContext(triple, std::unique_ptr<TargetHandlerBase>(
+ new ExampleTargetHandler(*this))) {
+ _outputELFType = llvm::ELF::ET_LOPROC;
+}
+
+StringRef ExampleLinkingContext::entrySymbolName() const {
+ return "_start";
+}
+
+void ExampleLinkingContext::addPasses(PassManager &p) {
+ ELFLinkingContext::addPasses(p);
+}