This patch adds the initial ELF/AArch64 support to lld. Only a basic "Hello World" app has been successfully tested for both dynamic and static compiling. Differential Revision: http://reviews.llvm.org/D4778 Patch by Daniel Stewart <stewartd@codeaurora.org>! llvm-svn: 215544
58 lines
1.7 KiB
C++
58 lines
1.7 KiB
C++
//===- lib/ReaderWriter/ELF/AArch64/AArch64TargetHandler.h ----------------===//
|
|
//
|
|
// The LLVM Linker
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLD_READER_WRITER_ELF_AARCH64_AARCH64_TARGET_HANDLER_H
|
|
#define LLD_READER_WRITER_ELF_AARCH64_AARCH64_TARGET_HANDLER_H
|
|
|
|
#include "DefaultTargetHandler.h"
|
|
#include "ELFFile.h"
|
|
#include "AArch64RelocationHandler.h"
|
|
#include "TargetLayout.h"
|
|
|
|
#include "lld/Core/Simple.h"
|
|
|
|
namespace lld {
|
|
namespace elf {
|
|
typedef llvm::object::ELFType<llvm::support::little, 2, true> AArch64ELFType;
|
|
class AArch64LinkingContext;
|
|
|
|
template <class ELFT> class AArch64TargetLayout : public TargetLayout<ELFT> {
|
|
public:
|
|
AArch64TargetLayout(AArch64LinkingContext &context)
|
|
: TargetLayout<ELFT>(context) {}
|
|
};
|
|
|
|
class AArch64TargetHandler final : public DefaultTargetHandler<AArch64ELFType> {
|
|
public:
|
|
AArch64TargetHandler(AArch64LinkingContext &context);
|
|
|
|
AArch64TargetLayout<AArch64ELFType> &getTargetLayout() override {
|
|
return *(_AArch64TargetLayout.get());
|
|
}
|
|
|
|
void registerRelocationNames(Registry ®istry) override;
|
|
|
|
const AArch64TargetRelocationHandler &getRelocationHandler() const override {
|
|
return *(_AArch64RelocationHandler.get());
|
|
}
|
|
|
|
std::unique_ptr<Writer> getWriter() override;
|
|
|
|
private:
|
|
static const Registry::KindStrings kindStrings[];
|
|
AArch64LinkingContext &_context;
|
|
std::unique_ptr<AArch64TargetLayout<AArch64ELFType>> _AArch64TargetLayout;
|
|
std::unique_ptr<AArch64TargetRelocationHandler> _AArch64RelocationHandler;
|
|
};
|
|
|
|
} // end namespace elf
|
|
} // end namespace lld
|
|
|
|
#endif
|