summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2014-02-18 21:46:39 +0000
committerLang Hames <lhames@gmail.com>2014-02-18 21:46:39 +0000
commit9b2dc930d7c8d1d83153bd4af4500d355b309e96 (patch)
tree6c0cfeb8e48a6335d3f4dcc2cdf8ce1a2b335934 /llvm/lib
parentc5afd06a0d0c082aefb3fdd1e5656f72a8dcac5c (diff)
downloadbcm5719-llvm-9b2dc930d7c8d1d83153bd4af4500d355b309e96.tar.gz
bcm5719-llvm-9b2dc930d7c8d1d83153bd4af4500d355b309e96.zip
Consistently check 'IsCode' when allocating sections in RuntimeDyld (via
findOrEmitSection). Vaidas Gasiunas's patch, r201259, fixed one instance where we were always allocating sections as text. This patch fixes the remaining buggy call sites. No test case: This isn't breaking anything that I know of, it's just inconsistent. <rdar://problem/15943542> llvm-svn: 201605
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp4
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
index 52f33ca11ca..c3736691c28 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
@@ -709,7 +709,9 @@ void RuntimeDyldELF::findOPDEntrySection(ObjectImage &Obj,
section_iterator tsi(Obj.end_sections());
check(TargetSymbol->getSection(tsi));
- Rel.SectionID = findOrEmitSection(Obj, (*tsi), true, LocalSections);
+ bool IsCode = false;
+ tsi->isText(IsCode);
+ Rel.SectionID = findOrEmitSection(Obj, (*tsi), IsCode, LocalSections);
Rel.Addend = (intptr_t)Addend;
return;
}
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
index 0408337fff7..be80cbcfda7 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
@@ -378,7 +378,9 @@ void RuntimeDyldMachO::processRelocationRef(unsigned SectionID,
}
} else {
SectionRef Sec = MachO->getRelocationSection(RE);
- Value.SectionID = findOrEmitSection(Obj, Sec, true, ObjSectionToID);
+ bool IsCode = false;
+ Sec.isText(IsCode);
+ Value.SectionID = findOrEmitSection(Obj, Sec, IsCode, ObjSectionToID);
uint64_t Addr;
Sec.getAddress(Addr);
Value.Addend = Addend - Addr;
OpenPOWER on IntegriCloud