ELFBinaryReader.h revision f33f6de54db174aa679a4b6d1e040d37e95541c0
1//===- ELFBinaryReader.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_LD_ELFBINARYREADER_H
10#define MCLD_LD_ELFBINARYREADER_H
11#ifdef ENABLE_UNITTEST
12#include <gtest.h>
13#endif
14
15#include <mcld/LD/BinaryReader.h>
16
17namespace mcld {
18
19class Module;
20class Input;
21class IRBuilder;
22class LinkerConfig;
23
24/** \lclass ELFBinaryReader
25 *  \brief ELFBinaryReader reads target-independent parts of Binary file
26 */
27class ELFBinaryReader : public BinaryReader
28{
29public:
30  ELFBinaryReader(IRBuilder& pBuilder, const LinkerConfig& pConfig);
31
32  ~ELFBinaryReader();
33
34  bool isMyFormat(Input& pInput, bool &pContinue) const;
35
36  bool readBinary(Input& pInput);
37
38private:
39  IRBuilder& m_Builder;
40  const LinkerConfig& m_Config;
41};
42
43} // namespace of mcld
44
45#endif
46
47