diff options
author | Rui Ueyama <ruiu@google.com> | 2015-04-14 00:59:04 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2015-04-14 00:59:04 +0000 |
commit | a5b6859ac44079a7d0c9aefe25d2a87016edd87c (patch) | |
tree | cfb4ed30f760ce6d029aeab6bc0959182cc24526 /lld/lib/ReaderWriter/ELF/ARM/ARMExecutableWriter.h | |
parent | e7515ebf66af838bcec6720c78c716f46a7bc8e3 (diff) | |
download | bcm5719-llvm-a5b6859ac44079a7d0c9aefe25d2a87016edd87c.tar.gz bcm5719-llvm-a5b6859ac44079a7d0c9aefe25d2a87016edd87c.zip |
ELF: Use less templates for ELF types.
These classes are templated but actually instantiated for only
one ELF type.
llvm-svn: 234830
Diffstat (limited to 'lld/lib/ReaderWriter/ELF/ARM/ARMExecutableWriter.h')
-rw-r--r-- | lld/lib/ReaderWriter/ELF/ARM/ARMExecutableWriter.h | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/lld/lib/ReaderWriter/ELF/ARM/ARMExecutableWriter.h b/lld/lib/ReaderWriter/ELF/ARM/ARMExecutableWriter.h index 7374a5365c2..fd8d89986b8 100644 --- a/lld/lib/ReaderWriter/ELF/ARM/ARMExecutableWriter.h +++ b/lld/lib/ReaderWriter/ELF/ARM/ARMExecutableWriter.h @@ -22,10 +22,9 @@ const char *gotSymbol = "_GLOBAL_OFFSET_TABLE_"; namespace lld { namespace elf { -template <class ELFT> -class ARMExecutableWriter : public ExecutableWriter<ELFT> { +class ARMExecutableWriter : public ExecutableWriter<ELF32LE> { public: - ARMExecutableWriter(ARMLinkingContext &ctx, ARMTargetLayout<ELFT> &layout); + ARMExecutableWriter(ARMLinkingContext &ctx, ARMTargetLayout &layout); protected: // Add any runtime files and their atoms to the output @@ -34,34 +33,31 @@ protected: void finalizeDefaultAtomValues() override; /// \brief Create symbol table. - unique_bump_ptr<SymbolTable<ELFT>> createSymbolTable() override; + unique_bump_ptr<SymbolTable<ELF32LE>> createSymbolTable() override; void processUndefinedSymbol(StringRef symName, - RuntimeFile<ELFT> &file) const override; + RuntimeFile<ELF32LE> &file) const override; // Setup the ELF header. std::error_code setELFHeader() override; private: ARMLinkingContext &_ctx; - ARMTargetLayout<ELFT> &_armLayout; + ARMTargetLayout &_armLayout; }; -template <class ELFT> -ARMExecutableWriter<ELFT>::ARMExecutableWriter(ARMLinkingContext &ctx, - ARMTargetLayout<ELFT> &layout) - : ExecutableWriter<ELFT>(ctx, layout), _ctx(ctx), _armLayout(layout) {} +ARMExecutableWriter::ARMExecutableWriter(ARMLinkingContext &ctx, + ARMTargetLayout &layout) + : ExecutableWriter<ELF32LE>(ctx, layout), _ctx(ctx), _armLayout(layout) {} -template <class ELFT> -void ARMExecutableWriter<ELFT>::createImplicitFiles( +void ARMExecutableWriter::createImplicitFiles( std::vector<std::unique_ptr<File>> &result) { - ExecutableWriter<ELFT>::createImplicitFiles(result); + ExecutableWriter<ELF32LE>::createImplicitFiles(result); } -template <class ELFT> -void ARMExecutableWriter<ELFT>::finalizeDefaultAtomValues() { +void ARMExecutableWriter::finalizeDefaultAtomValues() { // Finalize the atom values that are part of the parent. - ExecutableWriter<ELFT>::finalizeDefaultAtomValues(); + ExecutableWriter<ELF32LE>::finalizeDefaultAtomValues(); AtomLayout *gotAtom = _armLayout.findAbsoluteAtom(gotSymbol); if (gotAtom) { if (auto gotpltSection = _armLayout.findOutputSection(".got.plt")) @@ -74,16 +70,13 @@ void ARMExecutableWriter<ELFT>::finalizeDefaultAtomValues() { // TODO: resolve addresses of __exidx_start/_end atoms } -template <class ELFT> -unique_bump_ptr<SymbolTable<ELFT>> -ARMExecutableWriter<ELFT>::createSymbolTable() { - return unique_bump_ptr<SymbolTable<ELFT>>( - new (this->_alloc) ARMSymbolTable<ELFT>(this->_ctx)); +unique_bump_ptr<SymbolTable<ELF32LE>> ARMExecutableWriter::createSymbolTable() { + return unique_bump_ptr<SymbolTable<ELF32LE>>(new (this->_alloc) + ARMSymbolTable(this->_ctx)); } -template <class ELFT> -void ARMExecutableWriter<ELFT>::processUndefinedSymbol( - StringRef symName, RuntimeFile<ELFT> &file) const { +void ARMExecutableWriter::processUndefinedSymbol( + StringRef symName, RuntimeFile<ELF32LE> &file) const { if (symName == gotSymbol) { file.addAbsoluteAtom(gotSymbol); } else if (symName.startswith("__exidx")) { @@ -92,9 +85,8 @@ void ARMExecutableWriter<ELFT>::processUndefinedSymbol( } } -template <class ELFT> -std::error_code ARMExecutableWriter<ELFT>::setELFHeader() { - if (std::error_code ec = ExecutableWriter<ELFT>::setELFHeader()) +std::error_code ARMExecutableWriter::setELFHeader() { + if (std::error_code ec = ExecutableWriter<ELF32LE>::setELFHeader()) return ec; // Set ARM-specific flags. |