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 
12 #include "mcld/Support/MemoryRegion.h"
13 #include "mcld/Target/GOT.h"
14 #include <llvm/ADT/DenseMap.h>
15 
16 namespace mcld {
17 
18 class LDSection;
19 
20 /** \class MipsGOTPLT
21  *  \brief Mips .got.plt section.
22  */
23 class MipsGOTPLT : public GOT {
24  public:
25   explicit MipsGOTPLT(LDSection& pSection);
26 
27   // hasGOT1 - return if this section has any GOT1 entry
28   bool hasGOT1() const;
29 
30   uint64_t getEntryAddr(size_t num) const;
31 
32   uint64_t emit(MemoryRegion& pRegion);
33 
34   Fragment* consume();
35 
36   void applyAllGOTPLT(uint64_t pltAddr);
37 
38  public:
39   // GOT
40   void reserve(size_t pNum = 1);
41 
42  private:
43   // the last consumed entry.
44   SectionData::iterator m_Last;
45 };
46 
47 }  // namespace mcld
48 
49 #endif  // TARGET_MIPS_MIPSGOTPLT_H_
50