summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsLA25Stub.h
blob: c74cd0d85fe205ba27fabb47839fba4013b8a57c (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
//===- MipsLA25Stub.h -----------------------------------------------------===//
//
//                     The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef TARGET_MIPS_MIPSLA25STUB_H
#define TARGET_MIPS_MIPSLA25STUB_H

#include <mcld/Fragment/Stub.h>

namespace mcld
{

class MipsGNULDBackend;
class Relocation;

//===----------------------------------------------------------------------===//
// MipsLA25Stub
//===----------------------------------------------------------------------===//
/** \class MipsLA25Stub
 *  \brief Mips stub for a non-PIC interface to a PIC function.
 */
class MipsLA25Stub : public Stub
{
public:
  MipsLA25Stub(const MipsGNULDBackend& pTarget);

private:
  // Stub
  Stub* doClone();
  bool isMyDuty(const Relocation& pReloc,
                uint64_t pSource,
                uint64_t pTargetSymValue) const;
  const std::string& name() const;
  const uint8_t* getContent() const;
  size_t size() const;
  size_t alignment() const;

private:
  MipsLA25Stub(const MipsLA25Stub&);
  MipsLA25Stub& operator=(const MipsLA25Stub&);

  MipsLA25Stub(const MipsGNULDBackend& pTarget,
               const uint32_t* pData,
               size_t pSize,
               const_fixup_iterator pBegin,
               const_fixup_iterator pEnd);

private:
  const MipsGNULDBackend& m_Target;
  const std::string m_Name;
  const uint32_t* m_pData;
  const size_t m_Size;
};

} // namespace of mcld

#endif