blob: c972a1438f4ae016c189c2423eeeb4d5d6d80b7b (
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
|
//===- Reader.h -------------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TOOLS_OBJCOPY_COFF_READER_H
#define LLVM_TOOLS_OBJCOPY_COFF_READER_H
#include "Buffer.h"
#include "llvm/BinaryFormat/COFF.h"
#include "llvm/Object/COFF.h"
#include "llvm/Support/Error.h"
namespace llvm {
namespace objcopy {
namespace coff {
struct Object;
using object::COFFObjectFile;
class Reader {
public:
virtual ~Reader();
virtual Expected<std::unique_ptr<Object>> create() const = 0;
};
class COFFReader : public Reader {
const COFFObjectFile &COFFObj;
Error readExecutableHeaders(Object &Obj) const;
Error readSections(Object &Obj) const;
Error readSymbols(Object &Obj, bool IsBigObj) const;
Error setRelocTargets(Object &Obj) const;
public:
explicit COFFReader(const COFFObjectFile &O) : COFFObj(O) {}
Expected<std::unique_ptr<Object>> create() const override;
};
} // end namespace coff
} // end namespace objcopy
} // end namespace llvm
#endif // LLVM_TOOLS_OBJCOPY_COFF_READER_H
|