1 //===- X86GOTPLT.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_X86_X86GOTPLT_H_
10 #define TARGET_X86_X86GOTPLT_H_
11 
12 #include "X86GOT.h"
13 
14 #include <llvm/ADT/DenseMap.h>
15 
16 namespace mcld {
17 
18 class LDSection;
19 class X86PLT;
20 
21 const unsigned int X86GOTPLT0Num = 3;
22 
23 /** \class X86_32GOTPLT
24  *  \brief X86_32 .got.plt section.
25  */
26 class X86_32GOTPLT : public X86_32GOT {
27  public:
28   explicit X86_32GOTPLT(LDSection& pSection);
29 
30   ~X86_32GOTPLT();
31 
32   // hasGOT1 - return if this section has any GOT1 entry
33   bool hasGOT1() const;
34 
35   void applyGOT0(uint64_t pAddress);
36 
37   void applyAllGOTPLT(const X86PLT& pPLT);
38 };
39 
40 /** \class X86_64GOTPLT
41  *  \brief X86_64 .got.plt section.
42  */
43 class X86_64GOTPLT : public X86_64GOT {
44  public:
45   explicit X86_64GOTPLT(LDSection& pSection);
46 
47   ~X86_64GOTPLT();
48 
49   // hasGOT1 - return if this section has any GOT1 entry
50   bool hasGOT1() const;
51 
52   void applyGOT0(uint64_t pAddress);
53 
54   void applyAllGOTPLT(const X86PLT& pPLT);
55 };
56 
57 }  // namespace mcld
58 
59 #endif  // TARGET_X86_X86GOTPLT_H_
60