1 //===-- ObjDumper.h -------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_TOOLS_LLVM_READOBJ_OBJDUMPER_H
11 #define LLVM_TOOLS_LLVM_READOBJ_OBJDUMPER_H
14 #include <system_error>
25 ObjDumper(StreamWriter& Writer);
28 virtual void printFileHeaders() = 0;
29 virtual void printSections() = 0;
30 virtual void printRelocations() = 0;
31 virtual void printSymbols() = 0;
32 virtual void printDynamicSymbols() = 0;
33 virtual void printUnwindInfo() = 0;
35 // Only implemented for ELF at this time.
36 virtual void printDynamicTable() { }
37 virtual void printNeededLibraries() { }
38 virtual void printProgramHeaders() { }
40 // Only implemented for ARM ELF at this time.
41 virtual void printAttributes() { }
43 // Only implemented for MIPS ELF at this time.
44 virtual void printMipsPLTGOT() { }
46 // Only implemented for PE/COFF.
47 virtual void printCOFFImports() { }
48 virtual void printCOFFExports() { }
49 virtual void printCOFFDirectives() { }
50 virtual void printCOFFBaseReloc() { }
56 std::error_code createCOFFDumper(const object::ObjectFile *Obj,
58 std::unique_ptr<ObjDumper> &Result);
60 std::error_code createELFDumper(const object::ObjectFile *Obj,
62 std::unique_ptr<ObjDumper> &Result);
64 std::error_code createMachODumper(const object::ObjectFile *Obj,
66 std::unique_ptr<ObjDumper> &Result);