Skip to content

Commit e018f55

Browse files
committed
[ELF] Pass Ctx &
1 parent c22588c commit e018f55

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

lld/ELF/ARMErrataFix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ void ARMErr657417Patcher::insertPatches(
417417
// isec so the branch we are patching always goes forwards.
418418
static void implementPatch(ScanResult sr, InputSection *isec,
419419
std::vector<Patch657417Section *> &patches) {
420-
420+
Ctx &ctx = isec->getCtx();
421421
log("detected cortex-a8-657419 erratum sequence starting at " +
422422
utohexstr(isec->getVA(sr.off)) + " in unpatched output.");
423423
Patch657417Section *psec;

lld/ELF/Arch/Mips.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ int64_t MIPS<ELFT>::getImplicitAddend(const uint8_t *buf, RelType type) const {
480480
}
481481

482482
static std::pair<uint32_t, uint64_t>
483-
calculateMipsRelChain(uint8_t *loc, RelType type, uint64_t val) {
483+
calculateMipsRelChain(Ctx &ctx, uint8_t *loc, RelType type, uint64_t val) {
484484
// MIPS N64 ABI packs multiple relocations into the single relocation
485485
// record. In general, all up to three relocations can have arbitrary
486486
// types. In fact, Clang and GCC uses only a few combinations. For now,
@@ -572,7 +572,7 @@ void MIPS<ELFT>::relocate(uint8_t *loc, const Relocation &rel,
572572
RelType type = rel.type;
573573

574574
if (ELFT::Is64Bits || ctx.arg.mipsN32Abi)
575-
std::tie(type, val) = calculateMipsRelChain(loc, type, val);
575+
std::tie(type, val) = calculateMipsRelChain(ctx, loc, type, val);
576576

577577
// Detect cross-mode jump/branch and fix instruction.
578578
val = fixupCrossModeJump<ELFT>(loc, type, val);

lld/ELF/DWARF.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ LLDDwarfObj<ELFT>::findAux(const InputSectionBase &sec, uint64_t pos,
112112
const RelTy &rel = *it;
113113

114114
const ObjFile<ELFT> *file = sec.getFile<ELFT>();
115+
Ctx &ctx = sec.getCtx();
115116
uint32_t symIndex = rel.getSymbol(ctx.arg.isMips64EL);
116117
const typename ELFT::Sym &sym = file->template getELFSyms<ELFT>()[symIndex];
117118
uint32_t secIndex = file->getSectionIndex(sym);

0 commit comments

Comments
 (0)