1 //===- X86GOT.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_X86GOT_H_
10 #define TARGET_X86_X86GOT_H_
11 
12 #include "mcld/Target/GOT.h"
13 
14 namespace mcld {
15 
16 class LDSection;
17 class SectionData;
18 
19 /** \class X86_32GOTEntry
20  *  \brief GOT Entry with size of 4 bytes
21  */
22 class X86_32GOTEntry : public GOT::Entry<4> {
23  public:
X86_32GOTEntry(uint64_t pContent,SectionData * pParent)24   X86_32GOTEntry(uint64_t pContent, SectionData* pParent)
25       : GOT::Entry<4>(pContent, pParent) {}
26 };
27 
28 /** \class X86_32GOT
29  *  \brief X86_32 Global Offset Table.
30  */
31 
32 class X86_32GOT : public GOT {
33  public:
34   explicit X86_32GOT(LDSection& pSection);
35 
36   ~X86_32GOT();
37 
38   X86_32GOTEntry* create();
39 };
40 
41 /** \class X86_64GOTEntry
42  *  \brief GOT Entry with size of 8 bytes
43  */
44 class X86_64GOTEntry : public GOT::Entry<8> {
45  public:
X86_64GOTEntry(uint64_t pContent,SectionData * pParent)46   X86_64GOTEntry(uint64_t pContent, SectionData* pParent)
47       : GOT::Entry<8>(pContent, pParent) {}
48 };
49 
50 /** \class X86_64GOT
51  *  \brief X86_64 Global Offset Table.
52  */
53 
54 class X86_64GOT : public GOT {
55  public:
56   explicit X86_64GOT(LDSection& pSection);
57 
58   ~X86_64GOT();
59 
60   X86_64GOTEntry* create();
61 };
62 
63 }  // namespace mcld
64 
65 #endif  // TARGET_X86_X86GOT_H_
66