Lines Matching defs:isec
208 // start of isec, return true if the destination of the branch is within the
210 static bool branchDestInFirstRegion(Ctx &ctx, const InputSection *isec,
213 uint64_t sourceAddr = isec->getVA(0) + off;
233 // Return true if a branch can reach a patch section placed after isec.
235 static bool patchInRange(Ctx &ctx, const InputSection *isec, uint64_t off,
239 // after isec. As there can be more than one patch in the patch section we
243 isBcc(instr) ? R_ARM_THM_JUMP19 : R_ARM_THM_JUMP24, isec->getVA(off),
244 isec->getVA() + isec->getSize() + 0x100);
261 static ScanResult scanCortexA8Errata657417(InputSection *isec, uint64_t &off,
263 Ctx &ctx = isec->getCtx();
264 uint64_t isecAddr = isec->getVA(0);
276 const uint8_t *buf = isec->content().begin();
291 auto relIt = llvm::find_if(isec->relocs(), [=](const Relocation &r) {
296 if (relIt != isec->relocs().end())
298 if (branchDestInFirstRegion(ctx, isec, branchOff, instr2, scanRes.rel)) {
299 if (patchInRange(ctx, isec, branchOff, instr2)) {
303 Warn(ctx) << isec->file
305 << isec->name << " is too large to patch";
384 for (const InputSection *isec : isd.sections) {
385 isecLimit = isec->outSecOff + isec->getSize();
419 // isec so the branch we are patching always goes forwards.
420 static void implementPatch(ScanResult sr, InputSection *isec,
422 Ctx &ctx = isec->getCtx();
424 utohexstr(isec->getVA(sr.off)) << " in unpatched output";
455 psec = make<Patch657417Section>(ctx, isec, sr.off, sr.instr, destIsARM);
474 make<Patch657417Section>(ctx, isec, sr.off, sr.instr, isBLX(sr.instr));
482 isec->addReloc(Relocation{R_PC, type, sr.off, -4, psec->patchSym});
494 for (InputSection *isec : isd.sections) {
496 if (isa<SyntheticSection>(isec))
503 std::vector<const Defined *> &mapSyms = sectionMap[isec];
509 uint64_t limit = nonThumbSym == mapSyms.end() ? isec->content().size()
513 ScanResult sr = scanCortexA8Errata657417(isec, off, limit);
515 implementPatch(sr, isec, patches);