• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/Target/GOT.h>
13 #include <mcld/Support/MemoryRegion.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 {
25 public:
26   MipsGOTPLT(LDSection &pSection);
27 
28   // hasGOT1 - return if this section has any GOT1 entry
29   bool hasGOT1() const;
30 
31   uint64_t getEntryAddr(size_t num) const;
32 
33   uint64_t emit(MemoryRegion& pRegion);
34 
35   Fragment* consume();
36 
37   void applyAllGOTPLT(uint64_t pltAddr);
38 
39 public:
40   // GOT
41   void reserve(size_t pNum = 1);
42 
43 private:
44   // the last consumed entry.
45   SectionData::iterator m_Last;
46 };
47 
48 } // namespace of mcld
49 
50 #endif
51