aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2014-07-29 23:43:13 +0000
committerLang Hames <lhames@gmail.com>2014-07-29 23:43:13 +0000
commit9cb7353e0b5a4c6a5f240fc99cb79e45dd65d168 (patch)
treedc4ada8fd9998cae3a54d7933777f812329f7b7a /llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
parent245076825158af3e8682c77856a2ae02de79dfb9 (diff)
downloadllvm-9cb7353e0b5a4c6a5f240fc99cb79e45dd65d168.zip
llvm-9cb7353e0b5a4c6a5f240fc99cb79e45dd65d168.tar.gz
llvm-9cb7353e0b5a4c6a5f240fc99cb79e45dd65d168.tar.bz2
[MCJIT] Add options to llvm-rtdyld to describe a phony target address space for
use in -verify mode. This patch adds three hidden command line options to llvm-rtdyld: -target-addr-start <start-addr> : Specify the start of the virtual address space on the phony target. -target-addr-end <end-addr> : Specify the end of the virtual address space on the phony target. -target-section-sep <sep> : Specify the separation (in bytes) between the end of one section and the start of the next. These options automatically default to sane values for the target platform. In particular, they allow narrow (e.g. 32-bit, 16-bit) targets to be tested from wider (e.g. 64-bit, 32-bit) hosts without overflowing pointers. The section separation option defaults to zero, but can be set to a large number (e.g. 1 << 32) to force large separations between sections in order to stress-test large-code-model code. llvm-svn: 214255
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
index 9873897f..d244f45 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
@@ -749,12 +749,12 @@ std::pair<uint64_t, std::string> RuntimeDyldCheckerImpl::getStubAddrFor(
uint64_t Addr;
if (IsInsideLoad) {
- uint64_t SectionBase = getRTDyld().Sections[SectionID].LoadAddress;
- Addr = SectionBase + StubOffset;
- } else {
uintptr_t SectionBase =
reinterpret_cast<uintptr_t>(getRTDyld().Sections[SectionID].Address);
Addr = static_cast<uint64_t>(SectionBase) + StubOffset;
+ } else {
+ uint64_t SectionBase = getRTDyld().Sections[SectionID].LoadAddress;
+ Addr = SectionBase + StubOffset;
}
return std::make_pair(Addr, std::string(""));