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_READOBJ_OBJDUMPER_H
11 #define LLVM_READOBJ_OBJDUMPER_H
14 #include <system_error>
17 using std::error_code;
26 ObjDumper(StreamWriter& Writer);
29 virtual void printFileHeaders() = 0;
30 virtual void printSections() = 0;
31 virtual void printRelocations() = 0;
32 virtual void printSymbols() = 0;
33 virtual void printDynamicSymbols() = 0;
34 virtual void printUnwindInfo() = 0;
36 // Only implemented for ELF at this time.
37 virtual void printDynamicTable() { }
38 virtual void printNeededLibraries() { }
39 virtual void printProgramHeaders() { }
41 // Only implemented for ARM ELF at this time.
42 virtual void printAttributes() { }
48 error_code createCOFFDumper(const object::ObjectFile *Obj, StreamWriter &Writer,
49 std::unique_ptr<ObjDumper> &Result);
51 error_code createELFDumper(const object::ObjectFile *Obj, StreamWriter &Writer,
52 std::unique_ptr<ObjDumper> &Result);
54 error_code createMachODumper(const object::ObjectFile *Obj,
56 std::unique_ptr<ObjDumper> &Result);