diff options
author | Rui Ueyama <ruiu@google.com> | 2016-01-12 23:28:42 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2016-01-12 23:28:42 +0000 |
commit | 6161b38dbc3ea873de87743c536a379031bdef89 (patch) | |
tree | 16ab786d4923f98474a341c193b607ec6f8af68a /llvm/lib/Object/COFFObjectFile.cpp | |
parent | 21d73d2e0af7a4b91bdda5f2286b97f7f71d647d (diff) | |
download | bcm5719-llvm-6161b38dbc3ea873de87743c536a379031bdef89.tar.gz bcm5719-llvm-6161b38dbc3ea873de87743c536a379031bdef89.zip |
COFF: Teach llvm-objdump how to dump DLL forwarder symbols.
llvm-svn: 257539
Diffstat (limited to 'llvm/lib/Object/COFFObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/COFFObjectFile.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp index 1f2111759a0..4cd6aff5f17 100644 --- a/llvm/lib/Object/COFFObjectFile.cpp +++ b/llvm/lib/Object/COFFObjectFile.cpp @@ -1336,6 +1336,30 @@ ExportDirectoryEntryRef::getSymbolName(StringRef &Result) const { return std::error_code(); } +std::error_code ExportDirectoryEntryRef::isForwarder(bool &Result) const { + const data_directory *DataEntry; + if (auto EC = OwningObject->getDataDirectory(COFF::EXPORT_TABLE, DataEntry)) + return EC; + uint32_t RVA; + if (auto EC = getExportRVA(RVA)) + return EC; + uint32_t Begin = DataEntry->RelativeVirtualAddress; + uint32_t End = DataEntry->RelativeVirtualAddress + DataEntry->Size; + Result = (Begin <= RVA && RVA < End); + return std::error_code(); +} + +std::error_code ExportDirectoryEntryRef::getForwardTo(StringRef &Result) const { + uint32_t RVA; + if (auto EC = getExportRVA(RVA)) + return EC; + uintptr_t IntPtr = 0; + if (auto EC = OwningObject->getRvaPtr(RVA, IntPtr)) + return EC; + Result = StringRef(reinterpret_cast<const char *>(IntPtr)); + return std::error_code(); +} + bool ImportedSymbolRef:: operator==(const ImportedSymbolRef &Other) const { return Entry32 == Other.Entry32 && Entry64 == Other.Entry64 |