Files
clang-p2996/lld/lib/ReaderWriter/ELF/ARM/ARMTargetHandler.cpp
Denis Protivensky 91141e87b1 [ARM] Implement static (initial exec) TLS model
This includes handling of R_ARM_TLS_IE32 and R_ARM_TLS_LE32 relocs.

Differential Revision: http://reviews.llvm.org/D8353

llvm-svn: 232708
2015-03-19 06:47:44 +00:00

45 lines
1.4 KiB
C++

//===--------- lib/ReaderWriter/ELF/ARM/ARMTargetHandler.cpp --------------===//
//
// The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "Atoms.h"
#include "ARMExecutableWriter.h"
#include "ARMTargetHandler.h"
#include "ARMLinkingContext.h"
using namespace lld;
using namespace elf;
ARMTargetHandler::ARMTargetHandler(ARMLinkingContext &context)
: _context(context), _armTargetLayout(
new ARMTargetLayout<ARMELFType>(context)),
_armRelocationHandler(new ARMTargetRelocationHandler(
*_armTargetLayout.get())) {}
void ARMTargetHandler::registerRelocationNames(Registry &registry) {
registry.addKindTable(Reference::KindNamespace::ELF, Reference::KindArch::ARM,
kindStrings);
}
std::unique_ptr<Writer> ARMTargetHandler::getWriter() {
switch (this->_context.getOutputELFType()) {
case llvm::ELF::ET_EXEC:
return std::unique_ptr<Writer>(
new ARMExecutableWriter<ARMELFType>(_context, *_armTargetLayout.get()));
default:
llvm_unreachable("unsupported output type");
}
}
#define ELF_RELOC(name, value) LLD_KIND_STRING_ENTRY(name),
const Registry::KindStrings ARMTargetHandler::kindStrings[] = {
#include "llvm/Support/ELFRelocs/ARM.def"
LLD_KIND_STRING_END
};