summaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86GOTPLT.h
blob: 8e13facffc22413b16f4a90b1b82192261d75ea1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//===- X86GOTPLT.h --------------------------------------------------------===//
//
//                     The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef MCLD_X86_GOTPLT_H
#define MCLD_X86_GOTPLT_H
#ifdef ENABLE_UNITTEST
#include <gtest.h>
#endif

#include <llvm/ADT/DenseMap.h>

#include "X86GOT.h"

namespace mcld {

class X86PLT;
class LDSection;

const unsigned int X86GOTPLT0Num = 3;

/** \class X86_32GOTPLT
 *  \brief X86_32 .got.plt section.
 */
class X86_32GOTPLT : public X86_32GOT
{
public:
  X86_32GOTPLT(LDSection &pSection);

  ~X86_32GOTPLT();

  // hasGOT1 - return if this section has any GOT1 entry
  bool hasGOT1() const;

  void applyGOT0(uint64_t pAddress);

  void applyAllGOTPLT(const X86PLT& pPLT);
};

/** \class X86_64GOTPLT
 *  \brief X86_64 .got.plt section.
 */
class X86_64GOTPLT : public X86_64GOT
{
public:
  X86_64GOTPLT(LDSection &pSection);

  ~X86_64GOTPLT();

  // hasGOT1 - return if this section has any GOT1 entry
  bool hasGOT1() const;

  void applyGOT0(uint64_t pAddress);

  void applyAllGOTPLT(const X86PLT& pPLT);
};

} // namespace of mcld

#endif