diff options
Diffstat (limited to 'lib/ReaderWriter/ELF/AArch64/AArch64ExecutableWriter.h')
-rw-r--r-- | lib/ReaderWriter/ELF/AArch64/AArch64ExecutableWriter.h | 48 |
1 files changed, 9 insertions, 39 deletions
diff --git a/lib/ReaderWriter/ELF/AArch64/AArch64ExecutableWriter.h b/lib/ReaderWriter/ELF/AArch64/AArch64ExecutableWriter.h index 73963f56ef70f..eef825040ffaf 100644 --- a/lib/ReaderWriter/ELF/AArch64/AArch64ExecutableWriter.h +++ b/lib/ReaderWriter/ELF/AArch64/AArch64ExecutableWriter.h @@ -9,59 +9,29 @@ #ifndef AARCH64_EXECUTABLE_WRITER_H #define AARCH64_EXECUTABLE_WRITER_H -#include "AArch64LinkingContext.h" #include "ExecutableWriter.h" namespace lld { namespace elf { -template <class ELFT> -class AArch64ExecutableWriter : public ExecutableWriter<ELFT> { +class AArch64TargetLayout; +class AArch64LinkingContext; + +class AArch64ExecutableWriter : public ExecutableWriter<ELF64LE> { public: - AArch64ExecutableWriter(AArch64LinkingContext &context, - AArch64TargetLayout<ELFT> &layout); + AArch64ExecutableWriter(AArch64LinkingContext &ctx, + AArch64TargetLayout &layout); protected: // Add any runtime files and their atoms to the output - bool createImplicitFiles(std::vector<std::unique_ptr<File>> &) override; - - void finalizeDefaultAtomValues() override { - return ExecutableWriter<ELFT>::finalizeDefaultAtomValues(); - } + void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override; - void addDefaultAtoms() override{ - return ExecutableWriter<ELFT>::addDefaultAtoms(); - } + void buildDynamicSymbolTable(const File &file) override; private: - class GOTFile : public SimpleFile { - public: - GOTFile(const ELFLinkingContext &eti) : SimpleFile("GOTFile") {} - llvm::BumpPtrAllocator _alloc; - }; - - std::unique_ptr<GOTFile> _gotFile; - AArch64LinkingContext &_context; - AArch64TargetLayout<ELFT> &_AArch64Layout; + AArch64TargetLayout &_targetLayout; }; -template <class ELFT> -AArch64ExecutableWriter<ELFT>::AArch64ExecutableWriter( - AArch64LinkingContext &context, AArch64TargetLayout<ELFT> &layout) - : ExecutableWriter<ELFT>(context, layout), _gotFile(new GOTFile(context)), - _context(context), _AArch64Layout(layout) {} - -template <class ELFT> -bool AArch64ExecutableWriter<ELFT>::createImplicitFiles( - std::vector<std::unique_ptr<File>> &result) { - ExecutableWriter<ELFT>::createImplicitFiles(result); - _gotFile->addAtom(*new (_gotFile->_alloc) GLOBAL_OFFSET_TABLEAtom(*_gotFile)); - if (_context.isDynamic()) - _gotFile->addAtom(*new (_gotFile->_alloc) DYNAMICAtom(*_gotFile)); - result.push_back(std::move(_gotFile)); - return true; -} - } // namespace elf } // namespace lld |