HexagonPLT.h revision 6f75755c9204b1d8817ae5a65a2f7e5af0ec3f70
1//===- HexagonPLT.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 MCLD_TARGET_HEXAGON_PLT_H 10#define MCLD_TARGET_HEXAGON_PLT_H 11 12#include "HexagonGOT.h" 13#include <mcld/Target/PLT.h> 14 15namespace { 16 17const uint8_t hexagon_dyn_plt0[] = { 18 0 19}; 20 21const uint8_t hexagon_exec_plt0[] = { 22 0 23}; 24 25} // anonymous namespace 26 27namespace mcld { 28 29class GOTEntry; 30class LinkerConfig; 31 32//===----------------------------------------------------------------------===// 33// HexagonPLT Entry 34//===----------------------------------------------------------------------===// 35class HexagonDynPLT0 : public PLT::Entry<sizeof(hexagon_dyn_plt0)> 36{ 37public: 38 HexagonDynPLT0(SectionData& pParent); 39}; 40 41class HexagonExecPLT0 : public PLT::Entry<sizeof(hexagon_exec_plt0)> 42{ 43public: 44 HexagonExecPLT0(SectionData& pParent); 45}; 46 47//===----------------------------------------------------------------------===// 48// HexagonPLT 49//===----------------------------------------------------------------------===// 50/** \class HexagonPLT 51 * \brief Hexagon Procedure Linkage Table 52 */ 53class HexagonPLT : public PLT 54{ 55public: 56 HexagonPLT(LDSection& pSection, 57 HexagonGOT& pGOTPLT, 58 const LinkerConfig& pConfig); 59 ~HexagonPLT(); 60 61 // finalizeSectionSize - set LDSection size 62 void finalizeSectionSize(); 63 64 void reserveEntry(size_t pNum = 1) ; 65 66private: 67 PLTEntryBase* getPLT0() const; 68 69private: 70 HexagonGOT& m_GOT; 71 72 // the last consumed entry. 73 SectionData::iterator m_Last; 74 75 const uint8_t *m_PLT0; 76 unsigned int m_PLT0Size; 77 78 const LinkerConfig& m_Config; 79}; 80 81} // namespace of mcld 82 83#endif 84 85