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