2013-04-03 18:31:38 +00: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-13 16:26:38 +00:00
|
|
|
#ifndef LLVM_TOOLS_LLVM_READOBJ_OBJDUMPER_H
|
|
|
|
#define LLVM_TOOLS_LLVM_READOBJ_OBJDUMPER_H
|
2013-04-03 18:31:38 +00:00
|
|
|
|
2014-03-06 05:51:42 +00:00
|
|
|
#include <memory>
|
2014-06-12 17:38:55 +00:00
|
|
|
#include <system_error>
|
2014-03-06 05:51:42 +00:00
|
|
|
|
2013-04-03 18:31:38 +00: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 04:07:39 +00:00
|
|
|
virtual void printProgramHeaders() { }
|
2013-04-03 18:31:38 +00:00
|
|
|
|
2014-01-30 04:46:33 +00:00
|
|
|
// Only implemented for ARM ELF at this time.
|
|
|
|
virtual void printAttributes() { }
|
|
|
|
|
2014-06-18 08:47:09 +00:00
|
|
|
// Only implemented for MIPS ELF at this time.
|
|
|
|
virtual void printMipsPLTGOT() { }
|
|
|
|
|
2014-10-02 17:02:18 +00:00
|
|
|
// Only implemented for PE/COFF.
|
|
|
|
virtual void printCOFFImports() { }
|
2015-01-03 21:35:09 +00:00
|
|
|
virtual void printCOFFExports() { }
|
2014-10-07 19:37:52 +00:00
|
|
|
virtual void printCOFFDirectives() { }
|
2014-11-19 00:18:07 +00:00
|
|
|
virtual void printCOFFBaseReloc() { }
|
2014-10-02 17:02:18 +00:00
|
|
|
|
2013-04-03 18:31:38 +00:00
|
|
|
protected:
|
|
|
|
StreamWriter& W;
|
|
|
|
};
|
|
|
|
|
2014-06-13 01:25:41 +00:00
|
|
|
std::error_code createCOFFDumper(const object::ObjectFile *Obj,
|
|
|
|
StreamWriter &Writer,
|
|
|
|
std::unique_ptr<ObjDumper> &Result);
|
2013-04-03 18:31:38 +00:00
|
|
|
|
2014-06-13 01:25:41 +00:00
|
|
|
std::error_code createELFDumper(const object::ObjectFile *Obj,
|
|
|
|
StreamWriter &Writer,
|
|
|
|
std::unique_ptr<ObjDumper> &Result);
|
2013-04-03 18:31:38 +00:00
|
|
|
|
2014-06-13 01:25:41 +00:00
|
|
|
std::error_code createMachODumper(const object::ObjectFile *Obj,
|
|
|
|
StreamWriter &Writer,
|
|
|
|
std::unique_ptr<ObjDumper> &Result);
|
2013-04-03 18:31:38 +00:00
|
|
|
|
|
|
|
} // namespace llvm
|
|
|
|
|
|
|
|
#endif
|