[lld] r270568 - Handle terminator .eh_frame when creating the index.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Tue May 24 08:17:50 PDT 2016
Author: rafael
Date: Tue May 24 10:17:47 2016
New Revision: 270568
URL: http://llvm.org/viewvc/llvm-project?rev=270568&view=rev
Log:
Handle terminator .eh_frame when creating the index.
Modified:
lld/trunk/ELF/OutputSections.cpp
lld/trunk/test/ELF/eh-frame-marker.s
Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=270568&r1=270567&r2=270568&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Tue May 24 10:17:47 2016
@@ -992,6 +992,10 @@ template <class RelTy>
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) {
Modified: lld/trunk/test/ELF/eh-frame-marker.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/eh-frame-marker.s?rev=270568&r1=270567&r2=270568&view=diff
==============================================================================
--- lld/trunk/test/ELF/eh-frame-marker.s (original)
+++ lld/trunk/test/ELF/eh-frame-marker.s Tue May 24 10:17:47 2016
@@ -1,5 +1,5 @@
// RUN: llvm-mc %s -o %t.o -filetype=obj -triple=x86_64-pc-linux
-// RUN: ld.lld %t.o -o %t.so -shared
+// RUN: ld.lld --eh-frame-hdr %t.o -o %t.so -shared
// We used to crash on this.
.section .eh_frame
foo:
More information about the llvm-commits
mailing list