summaryrefslogtreecommitdiffstats
path: root/lib/Object/COFFObjectFile.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2016-01-13 19:58:01 +0000
committerdim <dim@FreeBSD.org>2016-01-13 19:58:01 +0000
commite39b9e36e5f2d2dd312004cf5f84bb382be47dcd (patch)
tree7376a0c71aad05d327e5b1dcbceb3311a10f9f29 /lib/Object/COFFObjectFile.cpp
parentff2ba393a56d9d99dcb76ceada542233db28af9a (diff)
downloadFreeBSD-src-e39b9e36e5f2d2dd312004cf5f84bb382be47dcd.zip
FreeBSD-src-e39b9e36e5f2d2dd312004cf5f84bb382be47dcd.tar.gz
Vendor import of llvm trunk r257626:
https://llvm.org/svn/llvm-project/llvm/trunk@257626
Diffstat (limited to 'lib/Object/COFFObjectFile.cpp')
-rw-r--r--lib/Object/COFFObjectFile.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/Object/COFFObjectFile.cpp b/lib/Object/COFFObjectFile.cpp
index 1f21117..4cd6aff 100644
--- a/lib/Object/COFFObjectFile.cpp
+++ b/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
OpenPOWER on IntegriCloud