MipsGOTPLT.h revision 551ae4ebd3e9d137ea668fb83ae4a55b8cfba451
1//===- MipsGOTPLT.h -------------------------------------------------------===// 2// 3// The MCLinker Project 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9#ifndef TARGET_MIPS_MIPSGOTPLT_H 10#define TARGET_MIPS_MIPSGOTPLT_H 11#ifdef ENABLE_UNITTEST 12#include <gtest.h> 13#endif 14 15#include <mcld/Target/GOT.h> 16#include <mcld/Support/MemoryRegion.h> 17#include <llvm/ADT/DenseMap.h> 18 19namespace mcld { 20 21class LDSection; 22 23/** \class MipsGOTPLT 24 * \brief Mips .got.plt section. 25 */ 26class MipsGOTPLT : public GOT 27{ 28public: 29 MipsGOTPLT(LDSection &pSection); 30 31 // hasGOT1 - return if this section has any GOT1 entry 32 bool hasGOT1() const; 33 34 uint64_t getEntryAddr(size_t num) const; 35 36 uint64_t emit(MemoryRegion& pRegion); 37 38 Fragment* consume(); 39 40 void applyAllGOTPLT(uint64_t pltAddr); 41 42public: 43 // GOT 44 void reserve(size_t pNum = 1); 45 46private: 47 // the last consumed entry. 48 SectionData::iterator m_Last; 49}; 50 51} // namespace of mcld 52 53#endif 54