//===- lld/ReaderWriter/ELF/Mips/MipsRelocationHandler.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_RELOCATION_HANDLER_H #define LLD_READER_WRITER_ELF_MIPS_MIPS_RELOCATION_HANDLER_H #include "MipsLinkingContext.h" namespace lld { namespace elf { class MipsTargetHandler; class MipsTargetRelocationHandler final : public TargetRelocationHandler { public: MipsTargetRelocationHandler(MipsTargetLayout &layout) : _mipsTargetLayout(layout) {} ~MipsTargetRelocationHandler(); error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &, const lld::AtomLayout &, const Reference &) const override; private: typedef std::vector PairedRelocationsT; typedef std::unordered_map PairedRelocationMapT; mutable PairedRelocationMapT _pairedRelocations; void savePairedRelocation(const lld::AtomLayout &atom, const Reference &ref) const; void applyPairedRelocations(ELFWriter &writer, llvm::FileOutputBuffer &buf, const lld::AtomLayout &atom, int64_t gpAddr, int64_t loAddend) const; MipsTargetLayout &_mipsTargetLayout; }; } // elf } // lld #endif