blob: 9dbe9aca7cd9f6b097ea734237ca9a72d78fca13 (
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
//===- ObjectReader.h -----------------------------------------------------===//
//
// The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef MCLD_OBJECT_READER_H
#define MCLD_OBJECT_READER_H
#ifdef ENABLE_UNITTEST
#include <gtest.h>
#endif
#include "mcld/LD/LDReader.h"
#include <llvm/Support/system_error.h>
#include <mcld/ADT/HashTable.h>
#include <mcld/ADT/StringHash.h>
#include <mcld/LD/ResolveInfo.h>
#include <mcld/LD/ResolveInfoFactory.h>
namespace mcld
{
class Input;
/** \class ObjectReader
* \brief ObjectReader provides an common interface for different object
* formats.
*/
class ObjectReader : public LDReader
{
protected:
typedef HashTable<ResolveInfo,
StringHash<ELF>,
ResolveInfoFactory> GroupSignatureMap;
protected:
ObjectReader()
{ }
public:
virtual ~ObjectReader() { }
virtual bool readObject(Input& pFile) = 0;
virtual bool readSymbols(Input& pFile) = 0;
virtual bool readSections(Input& pFile) = 0;
/// readRelocations - read relocation sections
///
/// This function should be called after symbol resolution.
virtual bool readRelocations(Input& pFile) = 0;
GroupSignatureMap& signatures()
{ return f_GroupSignatureMap; }
const GroupSignatureMap& signatures() const
{ return f_GroupSignatureMap; }
protected:
GroupSignatureMap f_GroupSignatureMap;
};
} // namespace of mcld
#endif
|