summaryrefslogtreecommitdiff
path: root/lib/ReaderWriter/ELF/ARM/ARMLinkingContext.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-03-24 21:31:36 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-03-24 21:31:36 +0000
commitfb911942f1434f3d1750f83f25f5e42c80e60638 (patch)
tree1678c4a4f0182e4029a86d135aa4a1b7d09e3c41 /lib/ReaderWriter/ELF/ARM/ARMLinkingContext.cpp
Notes
Diffstat (limited to 'lib/ReaderWriter/ELF/ARM/ARMLinkingContext.cpp')
-rw-r--r--lib/ReaderWriter/ELF/ARM/ARMLinkingContext.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/ReaderWriter/ELF/ARM/ARMLinkingContext.cpp b/lib/ReaderWriter/ELF/ARM/ARMLinkingContext.cpp
new file mode 100644
index 000000000000..5f2436674268
--- /dev/null
+++ b/lib/ReaderWriter/ELF/ARM/ARMLinkingContext.cpp
@@ -0,0 +1,34 @@
+//===--------- lib/ReaderWriter/ELF/ARM/ARMLinkingContext.cpp -------------===//
+//
+// The LLVM Linker
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "ARMLinkingContext.h"
+#include "ARMRelocationPass.h"
+#include "ARMTargetHandler.h"
+
+using namespace lld;
+using namespace lld::elf;
+
+std::unique_ptr<ELFLinkingContext>
+elf::ARMLinkingContext::create(llvm::Triple triple) {
+ if (triple.getArch() == llvm::Triple::arm)
+ return std::unique_ptr<ELFLinkingContext>(
+ new elf::ARMLinkingContext(triple));
+ return nullptr;
+}
+
+elf::ARMLinkingContext::ARMLinkingContext(llvm::Triple triple)
+ : ELFLinkingContext(triple, std::unique_ptr<TargetHandlerBase>(
+ new ARMTargetHandler(*this))) {}
+
+void elf::ARMLinkingContext::addPasses(PassManager &pm) {
+ auto pass = createARMRelocationPass(*this);
+ if (pass)
+ pm.add(std::move(pass));
+ ELFLinkingContext::addPasses(pm);
+}