1//===- MipsLA25Stub.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_MIPS_MIPSLA25STUB_H_
10#define TARGET_MIPS_MIPSLA25STUB_H_
11
12#include "mcld/Fragment/Stub.h"
13
14namespace mcld {
15
16class MipsGNULDBackend;
17class Relocation;
18
19//===----------------------------------------------------------------------===//
20// MipsLA25Stub
21//===----------------------------------------------------------------------===//
22/** \class MipsLA25Stub
23 *  \brief Mips stub for a non-PIC interface to a PIC function.
24 */
25class MipsLA25Stub : public Stub {
26 public:
27  explicit MipsLA25Stub(const MipsGNULDBackend& pTarget);
28
29 private:
30  // Stub
31  Stub* doClone();
32  bool isMyDuty(const Relocation& pReloc,
33                uint64_t pSource,
34                uint64_t pTargetSymValue) const;
35  const std::string& name() const;
36  const uint8_t* getContent() const;
37  size_t size() const;
38  size_t alignment() const;
39
40 private:
41  MipsLA25Stub(const MipsLA25Stub&);
42  MipsLA25Stub& operator=(const MipsLA25Stub&);
43
44  MipsLA25Stub(const MipsGNULDBackend& pTarget,
45               const uint32_t* pData,
46               size_t pSize,
47               const_fixup_iterator pBegin,
48               const_fixup_iterator pEnd);
49
50 private:
51  const MipsGNULDBackend& m_Target;
52  const std::string m_Name;
53  const uint32_t* m_pData;
54  const size_t m_Size;
55};
56
57}  // namespace mcld
58
59#endif  // TARGET_MIPS_MIPSLA25STUB_H_
60