Home | History | Annotate | Download | only in LD
      1 //===- ELFDynObjReader.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_ELF_DYNAMIC_SHARED_OBJECT_READER_H
     10 #define MCLD_ELF_DYNAMIC_SHARED_OBJECT_READER_H
     11 #ifdef ENABLE_UNITTEST
     12 #include <gtest.h>
     13 #endif
     14 #include <mcld/LD/DynObjReader.h>
     15 #include <llvm/Support/system_error.h>
     16 
     17 namespace mcld
     18 {
     19 
     20 class Input;
     21 class MCLinker;
     22 class GNULDBackend;
     23 class ELFReaderIF;
     24 
     25 /** \class ELFDynObjReader
     26  *  \brief ELFDynObjReader reads ELF dynamic shared objects.
     27  *
     28  */
     29 class ELFDynObjReader : public DynObjReader
     30 {
     31 public:
     32   ELFDynObjReader(GNULDBackend& pBackend, MCLinker& pLinker);
     33   ~ELFDynObjReader();
     34 
     35   // -----  observers  ----- //
     36   bool isMyFormat(Input &pFile) const;
     37 
     38   // -----  readers  ----- //
     39   bool readDSO(Input& pFile);
     40 
     41   bool readSymbols(Input& pInput);
     42 
     43 private:
     44   ELFReaderIF *m_pELFReader;
     45   MCLinker& m_Linker;
     46 };
     47 
     48 } // namespace of mcld
     49 
     50 #endif
     51