//===- lib/ReaderWriter/ELF/Mips/MipsTargetHandler.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_MIPS_MIPS_TARGET_HANDLER_H #define LLD_READER_WRITER_ELF_MIPS_MIPS_TARGET_HANDLER_H #include "MipsAbiInfoHandler.h" #include "MipsLinkingContext.h" #include "MipsTargetLayout.h" #include "TargetHandler.h" namespace lld { namespace elf { class MipsBaseTargetHandler : public TargetHandler { public: virtual MipsAbi getAbi() const = 0; }; /// \brief TargetHandler for Mips template class MipsTargetHandler final : public MipsBaseTargetHandler { public: MipsTargetHandler(MipsLinkingContext &ctx); MipsAbiInfoHandler &getAbiInfoHandler() { return _abiInfoHandler; } std::unique_ptr getObjReader() override; std::unique_ptr getDSOReader() override; const TargetRelocationHandler &getRelocationHandler() const override; std::unique_ptr getWriter() override; MipsAbi getAbi() const override; private: MipsLinkingContext &_ctx; MipsAbiInfoHandler _abiInfoHandler; std::unique_ptr> _targetLayout; std::unique_ptr _relocationHandler; }; template class MipsSymbolTable : public SymbolTable { public: typedef llvm::object::Elf_Sym_Impl Elf_Sym; MipsSymbolTable(const ELFLinkingContext &ctx); void addDefinedAtom(Elf_Sym &sym, const DefinedAtom *da, int64_t addr) override; void finalize(bool sort) override; }; template class MipsDynamicSymbolTable : public DynamicSymbolTable { public: MipsDynamicSymbolTable(const ELFLinkingContext &ctx, MipsTargetLayout &layout); void sortSymbols() override; void finalize() override; private: MipsTargetLayout &_targetLayout; }; } // end namespace elf } // end namespace lld #endif