1 //===- HexagonAbsoluteStub.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_HEXAGON_HEXAGONABSOLUTESTUB_H_
10 #define TARGET_HEXAGON_HEXAGONABSOLUTESTUB_H_
11 
12 #include "mcld/Fragment/Stub.h"
13 #include <llvm/Support/DataTypes.h>
14 #include <string>
15 #include <vector>
16 
17 namespace mcld {
18 
19 class Relocation;
20 class ResolveInfo;
21 
22 /** \class HexagonAbsoluteStub
23  *  \brief Hexagon stub for abs long call from source to target
24  *
25  */
26 class HexagonAbsoluteStub : public Stub {
27  public:
28   explicit HexagonAbsoluteStub(bool pIsOutputPIC);
29 
30   ~HexagonAbsoluteStub();
31 
32   // isMyDuty
33   bool isMyDuty(const class Relocation& pReloc,
34                 uint64_t pSource,
35                 uint64_t pTargetSymValue) const;
36 
37   // observers
38   const std::string& name() const;
39 
40   const uint8_t* getContent() const;
41 
42   size_t size() const;
43 
44   size_t alignment() const;
45 
46  private:
47   HexagonAbsoluteStub(const HexagonAbsoluteStub&);
48 
49   HexagonAbsoluteStub& operator=(const HexagonAbsoluteStub&);
50 
51   /// for doClone
52   HexagonAbsoluteStub(const uint32_t* pData,
53                       size_t pSize,
54                       const_fixup_iterator pBegin,
55                       const_fixup_iterator pEnd);
56 
57   /// doClone
58   Stub* doClone();
59 
60  private:
61   std::string m_Name;
62   static const uint32_t TEMPLATE[];
63   const uint32_t* m_pData;
64   size_t m_Size;
65 };
66 
67 }  // namespace mcld
68 
69 #endif  // TARGET_HEXAGON_HEXAGONABSOLUTESTUB_H_
70