95
|
1 //===-- ObjDumper.h ---------------------------------------------*- C++ -*-===//
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 //
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 // The LLVM Compiler Infrastructure
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 //
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 // This file is distributed under the University of Illinois Open Source
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 // License. See LICENSE.TXT for details.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 //
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 //===----------------------------------------------------------------------===//
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9
|
77
|
10 #ifndef LLVM_TOOLS_LLVM_READOBJ_OBJDUMPER_H
|
|
11 #define LLVM_TOOLS_LLVM_READOBJ_OBJDUMPER_H
|
|
12
|
|
13 #include <memory>
|
|
14 #include <system_error>
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 namespace llvm {
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 namespace object {
|
95
|
18 class COFFImportFile;
|
|
19 class ObjectFile;
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 class StreamWriter;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 class ObjDumper {
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 public:
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 ObjDumper(StreamWriter& Writer);
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 virtual ~ObjDumper();
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 virtual void printFileHeaders() = 0;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 virtual void printSections() = 0;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 virtual void printRelocations() = 0;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 virtual void printSymbols() = 0;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
33 virtual void printDynamicSymbols() = 0;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
34 virtual void printUnwindInfo() = 0;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
35
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
36 // Only implemented for ELF at this time.
|
95
|
37 virtual void printDynamicRelocations() { }
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
38 virtual void printDynamicTable() { }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39 virtual void printNeededLibraries() { }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
40 virtual void printProgramHeaders() { }
|
95
|
41 virtual void printHashTable() { }
|
|
42 virtual void printLoadName() {}
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
43
|
77
|
44 // Only implemented for ARM ELF at this time.
|
|
45 virtual void printAttributes() { }
|
|
46
|
|
47 // Only implemented for MIPS ELF at this time.
|
|
48 virtual void printMipsPLTGOT() { }
|
95
|
49 virtual void printMipsABIFlags() { }
|
|
50 virtual void printMipsReginfo() { }
|
77
|
51
|
83
|
52 // Only implemented for PE/COFF.
|
|
53 virtual void printCOFFImports() { }
|
|
54 virtual void printCOFFExports() { }
|
|
55 virtual void printCOFFDirectives() { }
|
|
56 virtual void printCOFFBaseReloc() { }
|
|
57
|
95
|
58 // Only implemented for MachO.
|
|
59 virtual void printMachODataInCode() { }
|
|
60 virtual void printMachOVersionMin() { }
|
|
61 virtual void printMachODysymtab() { }
|
|
62 virtual void printMachOSegment() { }
|
|
63 virtual void printMachOIndirectSymbols() { }
|
|
64 virtual void printMachOLinkerOptions() { }
|
|
65
|
|
66 virtual void printStackMap() const = 0;
|
|
67
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
68 protected:
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
69 StreamWriter& W;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
70 };
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
71
|
77
|
72 std::error_code createCOFFDumper(const object::ObjectFile *Obj,
|
|
73 StreamWriter &Writer,
|
|
74 std::unique_ptr<ObjDumper> &Result);
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
75
|
77
|
76 std::error_code createELFDumper(const object::ObjectFile *Obj,
|
|
77 StreamWriter &Writer,
|
|
78 std::unique_ptr<ObjDumper> &Result);
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
79
|
77
|
80 std::error_code createMachODumper(const object::ObjectFile *Obj,
|
|
81 StreamWriter &Writer,
|
|
82 std::unique_ptr<ObjDumper> &Result);
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
83
|
95
|
84 void dumpCOFFImportFile(const object::COFFImportFile *File);
|
|
85
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
86 } // namespace llvm
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
87
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
88 #endif
|