summaryrefslogtreecommitdiff
path: root/include/mcld/LD/ELFDynObjReader.h
blob: 72a3336323ac7ea59cea9e2a2ba44e63bba48d40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//===- ELFDynObjReader.h --------------------------------------------------===//
//
//                     The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef MCLD_ELF_DYNAMIC_SHARED_OBJECT_READER_H
#define MCLD_ELF_DYNAMIC_SHARED_OBJECT_READER_H
#ifdef ENABLE_UNITTEST
#include <gtest.h>
#endif
#include <mcld/LD/DynObjReader.h>
#include <llvm/Support/system_error.h>

namespace mcld
{

class Input;
class MCLinker;
class GNULDBackend;
class ELFReaderIF;

/** \class ELFDynObjReader
 *  \brief ELFDynObjReader reads ELF dynamic shared objects.
 *
 */
class ELFDynObjReader : public DynObjReader
{
public:
  ELFDynObjReader(GNULDBackend& pBackend, MCLinker& pLinker);
  ~ELFDynObjReader();

  // -----  observers  ----- //
  bool isMyFormat(Input &pFile) const;

  // -----  readers  ----- //
  bool readDSO(Input& pFile);

  bool readSymbols(Input& pInput);

private:
  ELFReaderIF *m_pELFReader;
  MCLinker& m_Linker;
};

} // namespace of mcld

#endif