[llvm] r199518 - llvm-objdump/COFF: Print ordinal base number.
Rui Ueyama
ruiu at google.com
Fri Jan 17 14:02:24 PST 2014
Author: ruiu
Date: Fri Jan 17 16:02:24 2014
New Revision: 199518
URL: http://llvm.org/viewvc/llvm-project?rev=199518&view=rev
Log:
llvm-objdump/COFF: Print ordinal base number.
Modified:
llvm/trunk/include/llvm/Object/COFF.h
llvm/trunk/lib/Object/COFFObjectFile.cpp
llvm/trunk/test/tools/llvm-objdump/coff-private-headers.test
llvm/trunk/tools/llvm-objdump/COFFDump.cpp
Modified: llvm/trunk/include/llvm/Object/COFF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/COFF.h?rev=199518&r1=199517&r2=199518&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/COFF.h (original)
+++ llvm/trunk/include/llvm/Object/COFF.h Fri Jan 17 16:02:24 2014
@@ -408,6 +408,7 @@ public:
error_code getNext(ExportDirectoryEntryRef &Result) const;
error_code getDllName(StringRef &Result) const;
+ error_code getOrdinalBase(uint32_t &Result) const;
error_code getOrdinal(uint32_t &Result) const;
error_code getExportRVA(uint32_t &Result) const;
error_code getSymbolName(StringRef &Result) const;
Modified: llvm/trunk/lib/Object/COFFObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/COFFObjectFile.cpp?rev=199518&r1=199517&r2=199518&view=diff
==============================================================================
--- llvm/trunk/lib/Object/COFFObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/COFFObjectFile.cpp Fri Jan 17 16:02:24 2014
@@ -959,6 +959,12 @@ error_code ExportDirectoryEntryRef::getD
return object_error::success;
}
+// Returns the starting ordinal number.
+error_code ExportDirectoryEntryRef::getOrdinalBase(uint32_t &Result) const {
+ Result = ExportTable->OrdinalBase;
+ return object_error::success;
+}
+
// Returns the export ordinal of the current export symbol.
error_code ExportDirectoryEntryRef::getOrdinal(uint32_t &Result) const {
Result = ExportTable->OrdinalBase + Index;
Modified: llvm/trunk/test/tools/llvm-objdump/coff-private-headers.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/coff-private-headers.test?rev=199518&r1=199517&r2=199518&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/coff-private-headers.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/coff-private-headers.test Fri Jan 17 16:02:24 2014
@@ -12,6 +12,7 @@ IMPORT-NEXT: 365 ExitProcess
EXPORT: Export Table:
EXPORT-NEXT: DLL name: export.test.tmp3.dll
+EXPORT-NEXT: Ordinal base: 5
EXPORT-NEXT: Ordinal RVA Name
EXPORT-NEXT: 5 0x2008
EXPORT-NEXT: 6 0x2010 exportfn2
Modified: llvm/trunk/tools/llvm-objdump/COFFDump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/COFFDump.cpp?rev=199518&r1=199517&r2=199518&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/COFFDump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/COFFDump.cpp Fri Jan 17 16:02:24 2014
@@ -286,9 +286,13 @@ static void printExportTable(const COFFO
if (I == E)
return;
StringRef DllName;
+ uint32_t OrdinalBase;
if (I->getDllName(DllName))
return;
+ if (I->getOrdinalBase(OrdinalBase))
+ return;
outs() << " DLL name: " << DllName << "\n";
+ outs() << " Ordinal base: " << OrdinalBase << "\n";
outs() << " Ordinal RVA Name\n";
error_code EC;
for (; I != E; I = I.increment(EC)) {
More information about the llvm-commits
mailing list