// Apply relocations.
size_t inputSize = getSize();
- for (size_t i = 0, e = relocsSize; i < e; i++) {
- const coff_relocation &rel = relocsData[i];
-
+ for (const coff_relocation &rel : getRelocs()) {
// Check for an invalid relocation offset. This check isn't perfect, because
// we don't have the relocation size, which is only known after checking the
// machine and relocation type. As a result, a relocation may overwrite the
// fixed by the loader if load-time relocation is needed.
// Only called when base relocation is enabled.
void SectionChunk::getBaserels(std::vector<Baserel> *res) {
- for (size_t i = 0, e = relocsSize; i < e; i++) {
- const coff_relocation &rel = relocsData[i];
+ for (const coff_relocation &rel : getRelocs()) {
uint8_t ty = getBaserelType(rel);
if (ty == IMAGE_REL_BASED_ABSOLUTE)
continue;