@@ -181,7 +181,7 @@ void Patch657417Section::writeTo(uint8_t *buf) {
181
181
else
182
182
write32le (buf, 0x9000f000 );
183
183
// If we have a relocation then apply it.
184
- if (!relocations .empty ()) {
184
+ if (!relocs () .empty ()) {
185
185
target->relocateAlloc (*this , buf);
186
186
return ;
187
187
}
@@ -281,12 +281,12 @@ static ScanResult scanCortexA8Errata657417(InputSection *isec, uint64_t &off,
281
281
// Find a relocation for the branch if it exists. This will be used
282
282
// to determine the target.
283
283
uint64_t branchOff = off + 4 ;
284
- auto relIt = llvm::find_if (isec->relocations , [=](const Relocation &r) {
284
+ auto relIt = llvm::find_if (isec->relocs () , [=](const Relocation &r) {
285
285
return r.offset == branchOff &&
286
286
(r.type == R_ARM_THM_JUMP19 || r.type == R_ARM_THM_JUMP24 ||
287
287
r.type == R_ARM_THM_CALL);
288
288
});
289
- if (relIt != isec->relocations .end ())
289
+ if (relIt != isec->relocs () .end ())
290
290
scanRes.rel = &(*relIt);
291
291
if (branchDestInFirstRegion (isec, branchOff, instr2, scanRes.rel )) {
292
292
if (patchInRange (isec, branchOff, instr2)) {
@@ -451,7 +451,7 @@ static void implementPatch(ScanResult sr, InputSection *isec,
451
451
patchRelType = R_ARM_JUMP24;
452
452
patchRelAddend -= 4 ;
453
453
}
454
- psec->relocations . push_back (
454
+ psec->addReloc (
455
455
Relocation{sr.rel ->expr , patchRelType, 0 , patchRelAddend, sr.rel ->sym });
456
456
// Redirect the existing branch relocation to the patch.
457
457
sr.rel ->expr = R_PC;
@@ -470,8 +470,7 @@ static void implementPatch(ScanResult sr, InputSection *isec,
470
470
type = R_ARM_THM_JUMP24;
471
471
else
472
472
type = R_ARM_THM_CALL;
473
- isec->relocations .push_back (
474
- Relocation{R_PC, type, sr.off , -4 , psec->patchSym });
473
+ isec->addReloc (Relocation{R_PC, type, sr.off , -4 , psec->patchSym });
475
474
}
476
475
patches.push_back (psec);
477
476
}
0 commit comments