summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/ICF.cpp8
-rw-r--r--lld/ELF/InputSection.cpp8
-rw-r--r--lld/ELF/MarkLive.cpp8
-rw-r--r--lld/ELF/OutputSections.cpp4
-rw-r--r--lld/ELF/Relocations.cpp8
5 files changed, 18 insertions, 18 deletions
diff --git a/lld/ELF/ICF.cpp b/lld/ELF/ICF.cpp
index 913902c203b..eff3852d610 100644
--- a/lld/ELF/ICF.cpp
+++ b/lld/ELF/ICF.cpp
@@ -222,10 +222,10 @@ bool ICF<ELFT>::equalsConstant(const InputSection<ELFT> *A,
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;
}
}
@@ -275,10 +275,10 @@ bool ICF<ELFT>::equalsVariable(const InputSection<ELFT> *A,
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;
}
}
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index eb7b1dc82d6..084707b7340 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -426,9 +426,9 @@ void InputSectionBase<ELFT>::relocate(uint8_t *Buf, uint8_t *BufEnd) {
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;
}
@@ -565,9 +565,9 @@ template <class ELFT> void EhInputSection<ELFT>::split() {
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));
diff --git a/lld/ELF/MarkLive.cpp b/lld/ELF/MarkLive.cpp
index dca1be74ad6..7d63bf33820 100644
--- a/lld/ELF/MarkLive.cpp
+++ b/lld/ELF/MarkLive.cpp
@@ -83,10 +83,10 @@ static void forEachSuccessor(InputSection<ELFT> &Sec,
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));
}
}
@@ -155,9 +155,9 @@ scanEhFrameSection(EhInputSection<ELFT> &EH,
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:
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index 501131858d7..44ea63ae7bf 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -1179,9 +1179,9 @@ void EhOutputSection<ELFT>::addSection(InputSectionBase<ELFT> *C) {
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));
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 0b8343baac4..99f7ac1fdfc 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -778,9 +778,9 @@ void scanRelocations(InputSectionBase<ELFT> &S,
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>
@@ -808,9 +808,9 @@ void createThunks(InputSectionBase<ELFT> &S,
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> &,
OpenPOWER on IntegriCloud