summaryrefslogtreecommitdiff
path: root/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp')
-rw-r--r--lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp b/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp
index 9eb98f447709..ba883f7f59db 100644
--- a/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp
+++ b/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp
@@ -12,22 +12,34 @@
#include "AArch64TargetHandler.h"
using namespace lld;
+using namespace lld::elf;
std::unique_ptr<ELFLinkingContext>
-elf::AArch64LinkingContext::create(llvm::Triple triple) {
+elf::createAArch64LinkingContext(llvm::Triple triple) {
if (triple.getArch() == llvm::Triple::aarch64)
- return std::unique_ptr<ELFLinkingContext>(
- new elf::AArch64LinkingContext(triple));
+ return llvm::make_unique<AArch64LinkingContext>(triple);
return nullptr;
}
-elf::AArch64LinkingContext::AArch64LinkingContext(llvm::Triple triple)
- : ELFLinkingContext(triple, std::unique_ptr<TargetHandlerBase>(
- new AArch64TargetHandler(*this))) {}
+AArch64LinkingContext::AArch64LinkingContext(llvm::Triple triple)
+ : ELFLinkingContext(triple, std::unique_ptr<TargetHandler>(
+ new AArch64TargetHandler(*this))) {}
-void elf::AArch64LinkingContext::addPasses(PassManager &pm) {
+void AArch64LinkingContext::addPasses(PassManager &pm) {
auto pass = createAArch64RelocationPass(*this);
if (pass)
pm.add(std::move(pass));
ELFLinkingContext::addPasses(pm);
}
+
+static const Registry::KindStrings kindStrings[] = {
+#define ELF_RELOC(name, value) LLD_KIND_STRING_ENTRY(name),
+#include "llvm/Support/ELFRelocs/AArch64.def"
+#undef ELF_RELOC
+ LLD_KIND_STRING_END
+};
+
+void AArch64LinkingContext::registerRelocationNames(Registry &registry) {
+ registry.addKindTable(Reference::KindNamespace::ELF,
+ Reference::KindArch::AArch64, kindStrings);
+}