summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit046709f06ba0ee770c3abd78abaa0e1a679ae64f (patch)
treedaf1bf880469bf2df1f798bce8f5bc057108d80d /llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
parent997a923eeb3972ff2bcb4122d52bee310d97dce2 (diff)
downloadbcm5719-llvm-046709f06ba0ee770c3abd78abaa0e1a679ae64f.tar.gz
bcm5719-llvm-046709f06ba0ee770c3abd78abaa0e1a679ae64f.zip
[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> llvm-svn: 204439
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
index 310b206a067..5c3cc008e3a 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud