ELFFile<ELFT> &FileA = A->File->getObj();
ELFFile<ELFT> &FileB = B->File->getObj();
if (RA->sh_type == SHT_RELA) {
- if (!relocationEq(FileA.relas(RA), FileB.relas(RB)))
+ if (!relocationEq(check(FileA.relas(RA)), check(FileB.relas(RB))))
return false;
} else {
- if (!relocationEq(FileA.rels(RA), FileB.rels(RB)))
+ if (!relocationEq(check(FileA.rels(RA)), check(FileB.rels(RB))))
return false;
}
}
ELFFile<ELFT> &FileA = A->File->getObj();
ELFFile<ELFT> &FileB = B->File->getObj();
if (RA->sh_type == SHT_RELA) {
- if (!variableEq(A, B, FileA.relas(RA), FileB.relas(RB)))
+ if (!variableEq(A, B, check(FileA.relas(RA)), check(FileB.relas(RB))))
return false;
} else {
- if (!variableEq(A, B, FileA.rels(RA), FileB.rels(RB)))
+ if (!variableEq(A, B, check(FileA.rels(RA)), check(FileB.rels(RB))))
return false;
}
}
if (IS && !(IS->Flags & SHF_ALLOC)) {
for (const Elf_Shdr *RelSec : IS->RelocSections) {
if (RelSec->sh_type == SHT_RELA)
- IS->relocateNonAlloc(Buf, IS->File->getObj().relas(RelSec));
+ IS->relocateNonAlloc(Buf, check(IS->File->getObj().relas(RelSec)));
else
- IS->relocateNonAlloc(Buf, IS->File->getObj().rels(RelSec));
+ IS->relocateNonAlloc(Buf, check(IS->File->getObj().rels(RelSec)));
}
return;
}
if (RelocSection) {
ELFFile<ELFT> &Obj = this->File->getObj();
if (RelocSection->sh_type == SHT_RELA)
- split(Obj.relas(RelocSection));
+ split(check(Obj.relas(RelocSection)));
else
- split(Obj.rels(RelocSection));
+ split(check(Obj.rels(RelocSection)));
return;
}
split(makeArrayRef<typename ELFT::Rela>(nullptr, nullptr));
ELFFile<ELFT> &Obj = Sec.getFile()->getObj();
for (const typename ELFT::Shdr *RelSec : Sec.RelocSections) {
if (RelSec->sh_type == SHT_RELA) {
- for (const typename ELFT::Rela &Rel : Obj.relas(RelSec))
+ for (const typename ELFT::Rela &Rel : check(Obj.relas(RelSec)))
Fn(resolveReloc(Sec, Rel));
} else {
- for (const typename ELFT::Rel &Rel : Obj.rels(RelSec))
+ for (const typename ELFT::Rel &Rel : check(Obj.rels(RelSec)))
Fn(resolveReloc(Sec, Rel));
}
}
ELFFile<ELFT> &EObj = EH.getFile()->getObj();
if (EH.RelocSection->sh_type == SHT_RELA)
- scanEhFrameSection(EH, EObj.relas(EH.RelocSection), Enqueue);
+ scanEhFrameSection(EH, check(EObj.relas(EH.RelocSection)), Enqueue);
else
- scanEhFrameSection(EH, EObj.rels(EH.RelocSection), Enqueue);
+ scanEhFrameSection(EH, check(EObj.rels(EH.RelocSection)), Enqueue);
}
// We do not garbage-collect two types of sections:
if (const Elf_Shdr *RelSec = Sec->RelocSection) {
ELFFile<ELFT> &Obj = Sec->getFile()->getObj();
if (RelSec->sh_type == SHT_RELA)
- addSectionAux(Sec, Obj.relas(RelSec));
+ addSectionAux(Sec, check(Obj.relas(RelSec)));
else
- addSectionAux(Sec, Obj.rels(RelSec));
+ addSectionAux(Sec, check(Obj.rels(RelSec)));
return;
}
addSectionAux(Sec, makeArrayRef<Elf_Rela>(nullptr, nullptr));
const typename ELFT::Shdr &RelSec) {
ELFFile<ELFT> &EObj = S.getFile()->getObj();
if (RelSec.sh_type == SHT_RELA)
- scanRelocs(S, EObj.relas(&RelSec));
+ scanRelocs(S, check(EObj.relas(&RelSec)));
else
- scanRelocs(S, EObj.rels(&RelSec));
+ scanRelocs(S, check(EObj.rels(&RelSec)));
}
template <class ELFT, class RelTy>
const typename ELFT::Shdr &RelSec) {
ELFFile<ELFT> &EObj = S.getFile()->getObj();
if (RelSec.sh_type == SHT_RELA)
- createThunks(S, EObj.relas(&RelSec));
+ createThunks(S, check(EObj.relas(&RelSec)));
else
- createThunks(S, EObj.rels(&RelSec));
+ createThunks(S, check(EObj.rels(&RelSec)));
}
template void scanRelocations<ELF32LE>(InputSectionBase<ELF32LE> &,