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