summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2014-10-21 23:41:15 +0000
committerLang Hames <lhames@gmail.com>2014-10-21 23:41:15 +0000
commit41d95947cfc4b143cd0ca922e93cc582a6d10e96 (patch)
tree90ab43c53b594ccb692875be15411ab97fb67c97 /llvm/lib
parent915fbb35901d21fd2e8234e6274738e085c16925 (diff)
downloadbcm5719-llvm-41d95947cfc4b143cd0ca922e93cc582a6d10e96.tar.gz
bcm5719-llvm-41d95947cfc4b143cd0ca922e93cc582a6d10e96.zip
[MCJIT] Defer application of AArch64 MachO GOT relocations until resolve time.
On AArch64, GOT references are page relative (ADRP + LDR), so they can't be applied until we know exactly where, within a page, the GOT entry will be in the target address space. Fixes <rdar://problem/18693976>. llvm-svn: 220347
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h b/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h
index 980daaaf625..f5cf9ac29bf 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h
@@ -368,9 +368,9 @@ private:
assert(RE.Size == 2);
SectionEntry &Section = Sections[RE.SectionID];
StubMap::const_iterator i = Stubs.find(Value);
- uintptr_t Addr;
+ int64_t Offset;
if (i != Stubs.end())
- Addr = reinterpret_cast<uintptr_t>(Section.Address) + i->second;
+ Offset = static_cast<int64_t>(i->second);
else {
// FIXME: There must be a better way to do this then to check and fix the
// alignment every time!!!
@@ -391,11 +391,11 @@ private:
else
addRelocationForSection(GOTRE, Value.SectionID);
Section.StubOffset = StubOffset + getMaxStubSize();
- Addr = StubAddress;
+ Offset = static_cast<int64_t>(StubOffset);
}
- RelocationEntry TargetRE(RE.SectionID, RE.Offset, RE.RelType, /*Addend=*/0,
+ RelocationEntry TargetRE(RE.SectionID, RE.Offset, RE.RelType, Offset,
RE.IsPCRel, RE.Size);
- resolveRelocation(TargetRE, static_cast<uint64_t>(Addr));
+ addRelocationForSection(TargetRE, RE.SectionID);
}
};
}
OpenPOWER on IntegriCloud