Home | History | Annotate | Download | only in ARM
      1 //===-  ARMRelocationFactory.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 ARM_RELOCATION_FACTORY_H
     10 #define ARM_RELOCATION_FACTORY_H
     11 #ifdef ENABLE_UNITTEST
     12 #include <gtest.h>
     13 #endif
     14 
     15 #include <mcld/LD/RelocationFactory.h>
     16 #include <mcld/Target/GOT.h>
     17 #include "ARMLDBackend.h"
     18 
     19 namespace mcld
     20 {
     21 
     22 /** \class ARMRelocationFactory
     23  *  \brief ARMRelocationFactory creates and destroys the ARM relocations.
     24  *
     25  */
     26 class ARMRelocationFactory : public RelocationFactory
     27 {
     28 public:
     29   /** \enum Reloc
     30    *  \brief Reloc is the result of applying functions.
     31    */
     32   enum Result
     33   {
     34     OK,
     35     Overflow,
     36     BadReloc,
     37     Unsupport
     38   };
     39 
     40 public:
     41   ARMRelocationFactory(size_t pNum, ARMGNULDBackend& pParent);
     42   ~ARMRelocationFactory();
     43 
     44   void applyRelocation(Relocation& pRelocation, const MCLDInfo& pLDInfo);
     45 
     46   ARMGNULDBackend& getTarget()
     47   { return m_Target; }
     48 
     49   const ARMGNULDBackend& getTarget() const
     50   { return m_Target; }
     51 
     52 private:
     53   ARMGNULDBackend& m_Target;
     54 };
     55 
     56 } // namespace of mcld
     57 
     58 #endif
     59