[ELF] - Remove dead code from EhFrameSection::addCie. NFC.
authorGeorge Rimar <grimar@accesssoftek.com>
Tue, 17 Jul 2018 13:56:23 +0000 (13:56 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Tue, 17 Jul 2018 13:56:23 +0000 (13:56 +0000)
Code was dead because caller of the addCie() already
checks that ID is equal to 0:
https://github.com/llvm-mirror/lld/blob/master/ELF/SyntheticSections.cpp#L431

llvm-svn: 337281

lld/ELF/SyntheticSections.cpp

index 76ed63f..27ba726 100644 (file)
@@ -368,15 +368,11 @@ EhFrameSection::EhFrameSection()
 // and where their relocations point to.
 template <class ELFT, class RelTy>
 CieRecord *EhFrameSection::addCie(EhSectionPiece &Cie, ArrayRef<RelTy> Rels) {
-  auto *Sec = cast<EhInputSection>(Cie.Sec);
-  if (read32(Cie.data().data() + 4) != 0)
-    fatal(toString(Sec) + ": CIE expected at beginning of .eh_frame");
-
   Symbol *Personality = nullptr;
   unsigned FirstRelI = Cie.FirstRelocation;
   if (FirstRelI != (unsigned)-1)
     Personality =
-        &Sec->template getFile<ELFT>()->getRelocTargetSym(Rels[FirstRelI]);
+        &Cie.Sec->template getFile<ELFT>()->getRelocTargetSym(Rels[FirstRelI]);
 
   // Search for an existing CIE by CIE contents/relocation target pair.
   CieRecord *&Rec = CieMap[{Cie.data(), Personality}];