Update for llvm change.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 3 Nov 2016 19:07:44 +0000 (19:07 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 3 Nov 2016 19:07:44 +0000 (19:07 +0000)
llvm-svn: 285956

lld/ELF/ICF.cpp
lld/ELF/InputSection.cpp
lld/ELF/MarkLive.cpp
lld/ELF/OutputSections.cpp
lld/ELF/Relocations.cpp

index 913902c..eff3852 100644 (file)
@@ -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;
     }
   }
index eb7b1dc..084707b 100644 (file)
@@ -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));
index dca1be7..7d63bf3 100644 (file)
@@ -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:
index 5011318..44ea63a 100644 (file)
@@ -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));
index 0b8343b..99f7ac1 100644 (file)
@@ -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> &,