2013-04-04 02:31:38 +08:00
|
|
|
//===-- ObjDumper.h -------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_TOOLS_LLVM_READOBJ_OBJDUMPER_H
|
|
|
|
#define LLVM_TOOLS_LLVM_READOBJ_OBJDUMPER_H
|
2013-04-04 02:31:38 +08:00
|
|
|
|
2014-03-06 13:51:42 +08:00
|
|
|
#include <memory>
|
2014-06-13 01:38:55 +08:00
|
|
|
#include <system_error>
|
2014-03-06 13:51:42 +08:00
|
|
|
|
2013-04-04 02:31:38 +08:00
|
|
|
namespace llvm {
|
|
|
|
namespace object {
|
|
|
|
class ObjectFile;
|
|
|
|
}
|
|
|
|
|
|
|
|
class StreamWriter;
|
|
|
|
|
|
|
|
class ObjDumper {
|
|
|
|
public:
|
|
|
|
ObjDumper(StreamWriter& Writer);
|
|
|
|
virtual ~ObjDumper();
|
|
|
|
|
|
|
|
virtual void printFileHeaders() = 0;
|
|
|
|
virtual void printSections() = 0;
|
|
|
|
virtual void printRelocations() = 0;
|
|
|
|
virtual void printSymbols() = 0;
|
|
|
|
virtual void printDynamicSymbols() = 0;
|
|
|
|
virtual void printUnwindInfo() = 0;
|
|
|
|
|
|
|
|
// Only implemented for ELF at this time.
|
|
|
|
virtual void printDynamicTable() { }
|
|
|
|
virtual void printNeededLibraries() { }
|
2013-04-12 12:07:39 +08:00
|
|
|
virtual void printProgramHeaders() { }
|
2013-04-04 02:31:38 +08:00
|
|
|
|
2014-01-30 12:46:33 +08:00
|
|
|
// Only implemented for ARM ELF at this time.
|
|
|
|
virtual void printAttributes() { }
|
|
|
|
|
2014-06-18 16:47:09 +08:00
|
|
|
// Only implemented for MIPS ELF at this time.
|
|
|
|
virtual void printMipsPLTGOT() { }
|
|
|
|
|
2014-10-03 01:02:18 +08:00
|
|
|
// Only implemented for PE/COFF.
|
|
|
|
virtual void printCOFFImports() { }
|
|
|
|
|
2013-04-04 02:31:38 +08:00
|
|
|
protected:
|
|
|
|
StreamWriter& W;
|
|
|
|
};
|
|
|
|
|
2014-06-13 09:25:41 +08:00
|
|
|
std::error_code createCOFFDumper(const object::ObjectFile *Obj,
|
|
|
|
StreamWriter &Writer,
|
|
|
|
std::unique_ptr<ObjDumper> &Result);
|
2013-04-04 02:31:38 +08:00
|
|
|
|
2014-06-13 09:25:41 +08:00
|
|
|
std::error_code createELFDumper(const object::ObjectFile *Obj,
|
|
|
|
StreamWriter &Writer,
|
|
|
|
std::unique_ptr<ObjDumper> &Result);
|
2013-04-04 02:31:38 +08:00
|
|
|
|
2014-06-13 09:25:41 +08:00
|
|
|
std::error_code createMachODumper(const object::ObjectFile *Obj,
|
|
|
|
StreamWriter &Writer,
|
|
|
|
std::unique_ptr<ObjDumper> &Result);
|
2013-04-04 02:31:38 +08:00
|
|
|
|
|
|
|
} // namespace llvm
|
|
|
|
|
|
|
|
#endif
|