diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-08 17:12:57 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-08 17:12:57 +0000 |
commit | c46e6a5940c50058e00c0c5f9123fd82e338d29a (patch) | |
tree | 89a719d723035c54a190b1f81d329834f1f93336 /lib/ExecutionEngine | |
parent | 148779df305667b6942fee7e758fdf81a6498f38 (diff) | |
download | src-c46e6a5940c50058e00c0c5f9123fd82e338d29a.tar.gz src-c46e6a5940c50058e00c0c5f9123fd82e338d29a.zip |
Vendor import of llvm trunk r302418:vendor/llvm/llvm-trunk-r302418
Notes
Notes:
svn path=/vendor/llvm/dist/; revision=317948
svn path=/vendor/llvm/llvm-trunk-r302418/; revision=317950; tag=vendor/llvm/llvm-trunk-r302418
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r-- | lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp | 14 | ||||
-rw-r--r-- | lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp index 7bfa79445584..e45fdc7aee18 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp @@ -861,6 +861,15 @@ RuntimeDyldCheckerImpl::getSubsectionStartingAt(StringRef Name) const { SymInfo.getOffset()); } +Optional<uint64_t> +RuntimeDyldCheckerImpl::getSectionLoadAddress(void *LocalAddress) const { + for (auto &S : getRTDyld().Sections) { + if (S.getAddress() == LocalAddress) + return S.getLoadAddress(); + } + return Optional<uint64_t>(); +} + void RuntimeDyldCheckerImpl::registerSection( StringRef FilePath, unsigned SectionID) { StringRef FileName = sys::path::filename(FilePath); @@ -935,3 +944,8 @@ RuntimeDyldChecker::getSectionAddr(StringRef FileName, StringRef SectionName, bool LocalAddress) { return Impl->getSectionAddr(FileName, SectionName, LocalAddress); } + +Optional<uint64_t> +RuntimeDyldChecker::getSectionLoadAddress(void *LocalAddress) const { + return Impl->getSectionLoadAddress(LocalAddress); +} diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h index b7263be09934..b462ef2c00ce 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h @@ -60,6 +60,8 @@ private: bool IsInsideLoad) const; StringRef getSubsectionStartingAt(StringRef Name) const; + Optional<uint64_t> getSectionLoadAddress(void *LocalAddr) const; + void registerSection(StringRef FilePath, unsigned SectionID); void registerStubMap(StringRef FilePath, unsigned SectionID, const RuntimeDyldImpl::StubMap &RTDyldStubs); |