This includes handling of R_ARM_TLS_IE32 and R_ARM_TLS_LE32 relocs. Differential Revision: http://reviews.llvm.org/D8353 llvm-svn: 232708
45 lines
1.4 KiB
C++
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 ®istry) {
|
|
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
|
|
};
|