return false;
uint64_t UValue = Value;
// FIXME: map instead of looping each time?
- for (symbol_iterator SI = Obj->symbol_begin(), SE = Obj->symbol_end();
- SI != SE; ++SI) {
- uint64_t SymAddr; SI->getAddress(SymAddr);
- uint64_t SymSize; SI->getSize(SymSize);
- StringRef SymName; SI->getName(SymName);
- SymbolRef::Type SymType; SI->getType(SymType);
- if (SymAddr == UnknownAddressOrSize || SymSize == UnknownAddressOrSize
- || SymName.empty() || SymType != SymbolRef::ST_Function)
+ for (const SymbolRef &Symbol : Obj->symbols()) {
+ uint64_t SymAddr;
+ Symbol.getAddress(SymAddr);
+ uint64_t SymSize;
+ Symbol.getSize(SymSize);
+ StringRef SymName;
+ Symbol.getName(SymName);
+ SymbolRef::Type SymType;
+ Symbol.getType(SymType);
+ if (SymAddr == UnknownAddressOrSize || SymSize == UnknownAddressOrSize ||
+ SymName.empty() || SymType != SymbolRef::ST_Function)
continue;
if ( SymAddr == UValue ||
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
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;
}
}
}