1 //===- MipsPLT.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_MIPSPLT_H_
10 #define TARGET_MIPS_MIPSPLT_H_
11 
12 #include "mcld/Support/MemoryRegion.h"
13 #include "mcld/Target/PLT.h"
14 
15 namespace mcld {
16 
17 class MipsGOTPLT;
18 
19 //===----------------------------------------------------------------------===//
20 // MipsPLT
21 //===----------------------------------------------------------------------===//
22 /** \class MipsPLT
23  *  \brief Mips Procedure Linkage Table
24  */
25 class MipsPLT : public PLT {
26  public:
27   explicit MipsPLT(LDSection& pSection);
28 
29   // hasPLT1 - return if this PLT has any PLTA/PLTB entries
30   bool hasPLT1() const;
31 
32   uint64_t emit(MemoryRegion& pRegion);
33 
34   Fragment* consume();
35 
36   void applyAllPLT(MipsGOTPLT& pGOTPLT);
37 
38  public:
39   // PLT
40   void reserveEntry(size_t pNum = 1);
41   void finalizeSectionSize();
42 
43  private:
44   // the last consumed entry.
45   SectionData::iterator m_Last;
46 };
47 
48 }  // namespace mcld
49 
50 #endif  // TARGET_MIPS_MIPSPLT_H_
51