summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp')
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
index 310b206a06..5c3cc008e3 100644
--- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
+++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
@@ -165,18 +165,19 @@ ObjectImage* RuntimeDyldImpl::loadObject(ObjectImage *InputObject) {
StubMap Stubs;
section_iterator RelocatedSection = SI->getRelocatedSection();
- if ((SI->relocation_begin() != SI->relocation_end()) ||
- ProcessAllSections) {
- bool IsCode = false;
- Check(RelocatedSection->isText(IsCode));
- SectionID =
- findOrEmitSection(*Obj, *RelocatedSection, IsCode, LocalSections);
- DEBUG(dbgs() << "\tSectionID: " << SectionID << "\n");
- }
+ if (SI->relocation_empty() && !ProcessAllSections)
+ continue;
+
+ bool IsCode = false;
+ Check(RelocatedSection->isText(IsCode));
+ SectionID =
+ findOrEmitSection(*Obj, *RelocatedSection, IsCode, LocalSections);
+ DEBUG(dbgs() << "\tSectionID: " << SectionID << "\n");
- for (const RelocationRef &Reloc : SI->relocations())
- processRelocationRef(SectionID, Reloc, *Obj, LocalSections, LocalSymbols,
- Stubs);
+ for (relocation_iterator I = SI->relocation_begin(),
+ E = SI->relocation_end(); I != E;)
+ I = processRelocationRef(SectionID, I, *Obj, LocalSections, LocalSymbols,
+ Stubs);
}
// Give the subclasses a chance to tie-up any loose ends.