llvm-readobj: print out the fields of the COFF delay-import table

llvm-svn: 218996
This commit is contained in:
Rui Ueyama 2014-10-03 18:07:18 +00:00
parent 95772cea0c
commit fefc07dd5d
4 changed files with 28 additions and 0 deletions

View File

@ -712,6 +712,8 @@ public:
imported_symbol_iterator imported_symbol_end() const;
std::error_code getName(StringRef &Result) const;
std::error_code getDelayImportTable(
const delay_import_directory_table_entry *&Result) const;
private:
const delay_import_directory_table_entry *Table;

View File

@ -1179,6 +1179,12 @@ std::error_code DelayImportDirectoryEntryRef::getName(StringRef &Result) const {
return object_error::success;
}
std::error_code DelayImportDirectoryEntryRef::
getDelayImportTable(const delay_import_directory_table_entry *&Result) const {
Result = Table;
return object_error::success;
}
bool ExportDirectoryEntryRef::
operator==(const ExportDirectoryEntryRef &Other) const {
return ExportTable == Other.ExportTable && Index == Other.Index;

View File

@ -28,6 +28,12 @@ X86-NEXT: Symbol: (3)
X86-NEXT: }
X86-NEXT: DelayImport {
X86-NEXT: Name: lazyload.dll
X86-NEXT: Attributes: 0x1
X86-NEXT: ModuleHandle: 0x301C
X86-NEXT: ImportAddressTable: 0x3010
X86-NEXT: ImportNameTable: 0x2090
X86-NEXT: BoundDelayImportTable: 0x20AC
X86-NEXT: UnloadDelayImportTable: 0x0
X86-NEXT: Symbol: Func5 (0)
X86-NEXT: Symbol: Func4 (0)
X86-NEXT: }
@ -59,6 +65,12 @@ X64-NEXT: Symbol: (3)
X64-NEXT: }
X64-NEXT: DelayImport {
X64-NEXT: Name: lazyload.dll
X64-NEXT: Attributes: 0x1
X64-NEXT: ModuleHandle: 0x3028
X64-NEXT: ImportAddressTable: 0x3010
X64-NEXT: ImportNameTable: 0x20E0
X64-NEXT: BoundDelayImportTable: 0x2108
X64-NEXT: UnloadDelayImportTable: 0x0
X64-NEXT: Symbol: Func5 (0)
X64-NEXT: Symbol: Func4 (0)
X64-NEXT: }

View File

@ -921,6 +921,14 @@ void COFFDumper::printCOFFImports() {
StringRef Name;
if (error(I->getName(Name))) return;
W.printString("Name", Name);
const delay_import_directory_table_entry *Table;
if (error(I->getDelayImportTable(Table))) return;
W.printHex("Attributes", Table->Attributes);
W.printHex("ModuleHandle", Table->ModuleHandle);
W.printHex("ImportAddressTable", Table->DelayImportAddressTable);
W.printHex("ImportNameTable", Table->DelayImportNameTable);
W.printHex("BoundDelayImportTable", Table->BoundDelayImportTable);
W.printHex("UnloadDelayImportTable", Table->UnloadDelayImportTable);
printImportedSymbols(I->imported_symbol_begin(), I->imported_symbol_end());
}
}