mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-23 01:25:32 +00:00
[C++11] Introduce SectionRef::relocations() to use range-based loops
Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3077 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203927 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -263,9 +263,7 @@ void MCObjectSymbolizer::buildRelocationByAddrMap() {
|
||||
RelSecI->isRequiredForExecution(RequiredForExec);
|
||||
if (RequiredForExec == false || Size == 0)
|
||||
continue;
|
||||
for (relocation_iterator RI = Section.relocation_begin(),
|
||||
RE = Section.relocation_end();
|
||||
RI != RE; ++RI) {
|
||||
for (const RelocationRef &Reloc : Section.relocations()) {
|
||||
// FIXME: libObject is inconsistent regarding error handling. The
|
||||
// overwhelming majority of methods always return object_error::success,
|
||||
// and assert for simple errors.. Here, ELFObjectFile::getRelocationOffset
|
||||
@@ -277,18 +275,18 @@ void MCObjectSymbolizer::buildRelocationByAddrMap() {
|
||||
if (ELFObj == 0)
|
||||
break;
|
||||
if (ELFObj->getELFFile()->getHeader()->e_type == ELF::ET_REL) {
|
||||
RI->getOffset(Offset);
|
||||
Reloc.getOffset(Offset);
|
||||
Offset += StartAddr;
|
||||
} else {
|
||||
RI->getAddress(Offset);
|
||||
Reloc.getAddress(Offset);
|
||||
}
|
||||
} else {
|
||||
RI->getOffset(Offset);
|
||||
Reloc.getOffset(Offset);
|
||||
Offset += StartAddr;
|
||||
}
|
||||
// At a specific address, only keep the first relocation.
|
||||
if (AddrToReloc.find(Offset) == AddrToReloc.end())
|
||||
AddrToReloc[Offset] = *RI;
|
||||
AddrToReloc[Offset] = Reloc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user