readobj: Dump PE/COFF optional records.

These records are mandatory for executables and are used by the loader.

Reviewers: rafael

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D939

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183852 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rui Ueyama
2013-06-12 19:10:33 +00:00
parent 100fbdd06b
commit 4bf771b4e6
8 changed files with 201 additions and 52 deletions

View File

@@ -188,7 +188,8 @@ struct coff_aux_section_definition {
class COFFObjectFile : public ObjectFile {
private:
const coff_file_header *Header;
const coff_file_header *COFFHeader;
const pe32_header *PE32Header;
const coff_section *SectionTable;
const coff_symbol *SymbolTable;
const char *StringTable;
@@ -272,6 +273,8 @@ public:
virtual StringRef getLoadName() const;
error_code getHeader(const coff_file_header *&Res) const;
error_code getCOFFHeader(const coff_file_header *&Res) const;
error_code getPE32Header(const pe32_header *&Res) const;
error_code getSection(int32_t index, const coff_section *&Res) const;
error_code getSymbol(uint32_t index, const coff_symbol *&Res) const;
template <typename T>