summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
index c5eed251f9..ee424db6af 100644
--- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
+++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
@@ -529,9 +529,13 @@ void RuntimeDyldELF::findOPDEntrySection(ObjectImage &Obj,
error_code err;
for (section_iterator si = Obj.begin_sections(),
se = Obj.end_sections(); si != se; si.increment(err)) {
- StringRef SectionName;
- check(si->getName(SectionName));
- if (SectionName != ".opd")
+ section_iterator RelSecI = si->getRelocatedSection();
+ if (RelSecI == Obj.end_sections())
+ continue;
+
+ StringRef RelSectionName;
+ check(RelSecI->getName(RelSectionName));
+ if (RelSectionName != ".opd")
continue;
for (relocation_iterator i = si->begin_relocations(),