[llvm] r218996 - llvm-readobj: print out the fields of the COFF delay-import table
Rui Ueyama
ruiu at google.com
Fri Oct 3 11:07:18 PDT 2014
Author: ruiu
Date: Fri Oct 3 13:07:18 2014
New Revision: 218996
URL: http://llvm.org/viewvc/llvm-project?rev=218996&view=rev
Log:
llvm-readobj: print out the fields of the COFF delay-import table
Modified:
llvm/trunk/include/llvm/Object/COFF.h
llvm/trunk/lib/Object/COFFObjectFile.cpp
llvm/trunk/test/tools/llvm-readobj/imports.test
llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
Modified: llvm/trunk/include/llvm/Object/COFF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/COFF.h?rev=218996&r1=218995&r2=218996&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/COFF.h (original)
+++ llvm/trunk/include/llvm/Object/COFF.h Fri Oct 3 13:07:18 2014
@@ -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;
Modified: llvm/trunk/lib/Object/COFFObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/COFFObjectFile.cpp?rev=218996&r1=218995&r2=218996&view=diff
==============================================================================
--- llvm/trunk/lib/Object/COFFObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/COFFObjectFile.cpp Fri Oct 3 13:07:18 2014
@@ -1179,6 +1179,12 @@ std::error_code DelayImportDirectoryEntr
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;
Modified: llvm/trunk/test/tools/llvm-readobj/imports.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/imports.test?rev=218996&r1=218995&r2=218996&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/imports.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/imports.test Fri Oct 3 13:07:18 2014
@@ -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: }
Modified: llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/COFFDumper.cpp?rev=218996&r1=218995&r2=218996&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/COFFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/COFFDumper.cpp Fri Oct 3 13:07:18 2014
@@ -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());
}
}
More information about the llvm-commits
mailing list