summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a2a8bbb)
raw | patch | inline | side by side (parent: a2a8bbb)
author | Rui Ueyama <ruiu@google.com> | |
Thu, 16 Jan 2014 20:50:34 +0000 (20:50 +0000) | ||
committer | Rui Ueyama <ruiu@google.com> | |
Thu, 16 Jan 2014 20:50:34 +0000 (20:50 +0000) |
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199422 91177308-0d34-0410-b5e6-96231b3b80d8
index f9d0c6e525a5ceea3c02d7e5cd60a9984c8c5187..b8555370e05fa4b69773c907d2cc24505aed2dcf 100644 (file)
bool operator==(const ExportDirectoryEntryRef &Other) const;
error_code getNext(ExportDirectoryEntryRef &Result) const;
+
+ error_code getDllName(StringRef &Result) const;
error_code getOrdinal(uint32_t &Result) const;
error_code getExportRVA(uint32_t &Result) const;
- error_code getName(StringRef &Result) const;
+ error_code getSymbolName(StringRef &Result) const;
private:
const export_directory_table_entry *ExportTable;
index 3663cd9c9a65d0f54ad8aef76ea9c4c08436b652..4709612167ce986d71b0b803258c626347e57808 100644 (file)
return object_error::success;
}
+// Returns the name of the current export symbol. If the symbol is exported only
+// by ordinal, the empty string is set as a result.
+error_code ExportDirectoryEntryRef::getDllName(StringRef &Result) const {
+ uintptr_t IntPtr = 0;
+ if (error_code EC = OwningObject->getRvaPtr(ExportTable->NameRVA, IntPtr))
+ return EC;
+ Result = StringRef(reinterpret_cast<const char *>(IntPtr));
+ 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;
// Returns the name of the current export symbol. If the symbol is exported only
// by ordinal, the empty string is set as a result.
-error_code ExportDirectoryEntryRef::getName(StringRef &Result) const {
+error_code ExportDirectoryEntryRef::getSymbolName(StringRef &Result) const {
uintptr_t IntPtr = 0;
if (error_code EC = OwningObject->getRvaPtr(
ExportTable->OrdinalTableRVA, IntPtr))
diff --git a/test/tools/llvm-objdump/coff-private-headers.test b/test/tools/llvm-objdump/coff-private-headers.test
index bc16443bbaffe3745c50664613b8f6b79757fa00..7d1bde72a0050d00d60f3dadacf50686198d66b2 100644 (file)
// RUN: FileCheck -check-prefix=EXPORT %s
EXPORT: Export Table:
+EXPORT-NEXT: DLL name: export.test.tmp3.dll
EXPORT-NEXT: Ordinal RVA Name
EXPORT-NEXT: 5 0x2008
EXPORT-NEXT: 6 0x2010 exportfn2
index df9c2cf2dac94d35270365072bfd00d3c98a70ac..10f34ecd589c235525ec449ea175f206c7d6a045 100644 (file)
export_directory_iterator E = Obj->export_directory_end();
if (I == E)
return;
+ StringRef DllName;
+ if (I->getDllName(DllName))
+ return;
+ outs() << " DLL name: " << DllName << "\n";
outs() << " Ordinal RVA Name\n";
error_code EC;
for (; I != E; I = I.increment(EC)) {
outs() << format(" % 4d %# 8x", Ordinal, RVA);
StringRef Name;
- if (I->getName(Name))
+ if (I->getSymbolName(Name))
continue;
if (!Name.empty())
outs() << " " << Name;