[PATCH] [RuntimeDyldELF] Fold Placeholder into Addend
Keno Fischer
kfischer at college.harvard.edu
Thu Apr 30 14:45:43 PDT 2015
I tried a few things for expression evaluation and they worked fine. I'm looking into it more. For the record the patch I thought would fix the problem is:
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
index a13ecb7..24a3ec1 100644
--- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
+++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
@@ -574,10 +574,16 @@ unsigned RuntimeDyldImpl::emitSection(const ObjectFile &Obj,
uint8_t *Addr;
const char *pData = nullptr;
+ // In either case, set the location of the unrelocated section in memory,
+ // since we still process relocations for it even if we're not applying them.
+ Check(Section.getContents(data));
+ // Virtual sections have no data in the object image, so leave pData = 0
+ if (!IsVirtual)
+ pData = data.data();
+
// Some sections, such as debug info, don't need to be loaded for execution.
// Leave those where they are.
if (IsRequired) {
- Check(Section.getContents(data));
Allocate = DataSize + PaddingSize + StubBufSize;
if (!Allocate)
Allocate = 1;
@@ -588,10 +594,6 @@ unsigned RuntimeDyldImpl::emitSection(const ObjectFile &Obj,
if (!Addr)
report_fatal_error("Unable to allocate section memory!");
- // Virtual sections have no data in the object image, so leave pData = 0
- if (!IsVirtual)
- pData = data.data();
-
// Zero-initialize or copy the data from the image
if (IsZeroInit || IsVirtual)
memset(Addr, 0, DataSize);
REPOSITORY
rL LLVM
http://reviews.llvm.org/D9028
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list