[llvm] r201605 - Consistently check 'IsCode' when allocating sections in RuntimeDyld (via
Lang Hames
lhames at gmail.com
Tue Feb 18 13:46:40 PST 2014
Author: lhames
Date: Tue Feb 18 15:46:39 2014
New Revision: 201605
URL: http://llvm.org/viewvc/llvm-project?rev=201605&view=rev
Log:
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>
Modified:
llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp?rev=201605&r1=201604&r2=201605&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp Tue Feb 18 15:46:39 2014
@@ -709,7 +709,9 @@ void RuntimeDyldELF::findOPDEntrySection
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;
}
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp?rev=201605&r1=201604&r2=201605&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp Tue Feb 18 15:46:39 2014
@@ -378,7 +378,9 @@ void RuntimeDyldMachO::processRelocation
}
} 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;
More information about the llvm-commits
mailing list