summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
diff options
context:
space:
mode:
authorJuergen Ributzka <juergen@apple.com>2014-03-21 07:26:41 +0000
committerJuergen Ributzka <juergen@apple.com>2014-03-21 07:26:41 +0000
commit4923eea4f6a5c547cfa87e2da7ba788100df4982 (patch)
tree02263154642555f0e803f9aaf1186b36f24a8018 /lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
parentfc029f2983a69de3ccca576f2cee23292d1b04ef (diff)
downloadllvm-4923eea4f6a5c547cfa87e2da7ba788100df4982.tar.gz
llvm-4923eea4f6a5c547cfa87e2da7ba788100df4982.tar.bz2
llvm-4923eea4f6a5c547cfa87e2da7ba788100df4982.tar.xz
[RuntimeDyld] Allow processRelocationRef to process more than one relocation entry at a time.
Some targets require more than one relocation entry to perform a relocation. This change allows processRelocationRef to process more than one relocation entry at a time by passing the relocation iterator itself instead of just the relocation entry. Related to <rdar://problem/16199095> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204439 91177308-0d34-0410-b5e6-96231b3b80d8
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.