Handle terminator .eh_frame when creating the index.

llvm-svn: 270568
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index 35b1111..743ca0d 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -992,6 +992,10 @@
 void EhOutputSection<ELFT>::addSectionAux(EhInputSection<ELFT> *Sec,
                                           ArrayRef<RelTy> Rels) {
   SectionPiece &CiePiece = Sec->Pieces[0];
+  // The empty record is the end marker.
+  if (CiePiece.Data.size() == 4)
+    return;
+
   CieRecord *Cie = addCie(CiePiece, Sec, Rels);
 
   for (size_t I = 1, End = Sec->Pieces.size(); I != End; ++I) {