diff options
Diffstat (limited to 'lld/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp')
-rw-r--r-- | lld/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/lld/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp b/lld/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp index 060e4a72eba..ec0891a3284 100644 --- a/lld/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp +++ b/lld/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp @@ -12,21 +12,34 @@ #include "AArch64TargetHandler.h" using namespace lld; +using namespace lld::elf; std::unique_ptr<ELFLinkingContext> -elf::AArch64LinkingContext::create(llvm::Triple triple) { +AArch64LinkingContext::create(llvm::Triple triple) { if (triple.getArch() == llvm::Triple::aarch64) - return llvm::make_unique<elf::AArch64LinkingContext>(triple); + return llvm::make_unique<AArch64LinkingContext>(triple); return nullptr; } -elf::AArch64LinkingContext::AArch64LinkingContext(llvm::Triple triple) +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 ®istry) { + registry.addKindTable(Reference::KindNamespace::ELF, + Reference::KindArch::AArch64, kindStrings); +} |