Home | History | Annotate | Download | only in Hexagon
      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 
     15 namespace {
     16 
     17 const uint8_t hexagon_dyn_plt0[] = {
     18   0
     19 };
     20 
     21 const uint8_t hexagon_exec_plt0[] = {
     22   0
     23 };
     24 
     25 } // anonymous namespace
     26 
     27 namespace mcld {
     28 
     29 class GOTEntry;
     30 class LinkerConfig;
     31 
     32 //===----------------------------------------------------------------------===//
     33 // HexagonPLT Entry
     34 //===----------------------------------------------------------------------===//
     35 class HexagonDynPLT0 : public PLT::Entry<sizeof(hexagon_dyn_plt0)>
     36 {
     37 public:
     38   HexagonDynPLT0(SectionData& pParent);
     39 };
     40 
     41 class HexagonExecPLT0 : public PLT::Entry<sizeof(hexagon_exec_plt0)>
     42 {
     43 public:
     44   HexagonExecPLT0(SectionData& pParent);
     45 };
     46 
     47 //===----------------------------------------------------------------------===//
     48 // HexagonPLT
     49 //===----------------------------------------------------------------------===//
     50 /** \class HexagonPLT
     51  *  \brief Hexagon Procedure Linkage Table
     52  */
     53 class HexagonPLT : public PLT
     54 {
     55 public:
     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 
     66 private:
     67   PLTEntryBase* getPLT0() const;
     68 
     69 private:
     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