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