summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/RuntimeDyld
diff options
context:
space:
mode:
authorAndrew Kaylor <andrew.kaylor@intel.com>2012-10-12 23:53:16 +0000
committerAndrew Kaylor <andrew.kaylor@intel.com>2012-10-12 23:53:16 +0000
commitfa8cd9d64a3bd090d9176ea019a6d1b6b2051dd0 (patch)
treee189f5246734f955e7c64b4a215fbb9b0c0dac83 /lib/ExecutionEngine/RuntimeDyld
parente6c3cc8dc5437069f71a38188173835ba4fb0dc1 (diff)
downloadllvm-fa8cd9d64a3bd090d9176ea019a6d1b6b2051dd0.tar.gz
llvm-fa8cd9d64a3bd090d9176ea019a6d1b6b2051dd0.tar.bz2
llvm-fa8cd9d64a3bd090d9176ea019a6d1b6b2051dd0.tar.xz
Check section type rather than assuming it's code when emitting sections while processing relocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165854 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld')
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
index 414957c356..08aba64e46 100644
--- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
+++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
@@ -413,7 +413,13 @@ void RuntimeDyldELF::processRelocationRef(const ObjRelocationInfo &Rel,
if (si == Obj.end_sections())
llvm_unreachable("Symbol section not found, bad object file format!");
DEBUG(dbgs() << "\t\tThis is section symbol\n");
- Value.SectionID = findOrEmitSection(Obj, (*si), true, ObjSectionToID);
+ // Default to 'true' in case isText fails (though it never does).
+ bool isCode = true;
+ si->isText(isCode);
+ Value.SectionID = findOrEmitSection(Obj,
+ (*si),
+ isCode,
+ ObjSectionToID);
Value.Addend = Addend;
break;
}