On Thursday, October 22, 2015, Rui Ueyama via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ruiu<br>
Date: Thu Oct 22 16:42:05 2015<br>
New Revision: 251068<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=251068&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=251068&view=rev</a><br>
Log:<br>
ELF2: Keep .eh_frame even if they are not live.<br>
<br>
.eh_frame sections need to be preserved if they refer to live sections.<br>
So the liveness relation is reverse for eh_frame sections. For now,<br>
we simply preserve all .eh_frame sections. Thanks Rafael for pointing<br>
this out. .jcr are kept for the same reason.<br>
<br>
Modified:<br>
    lld/trunk/ELF/MarkLive.cpp<br>
    lld/trunk/test/elf2/gc-sections.s<br>
<br>
Modified: lld/trunk/ELF/MarkLive.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/MarkLive.cpp?rev=251068&r1=251067&r2=251068&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/MarkLive.cpp?rev=251068&r1=251067&r2=251068&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/MarkLive.cpp (original)<br>
+++ lld/trunk/ELF/MarkLive.cpp Thu Oct 22 16:42:05 2015<br>
@@ -85,7 +85,8 @@ template <class ELFT> static bool isRese<br>
     return true;<br>
   default:<br>
     StringRef S = Sec->getSectionName();<br>
-    return S.startswith(".init") || S.startswith(".fini");<br>
+    return S.startswith(".init") || S.startswith(".fini") ||<br>
+           S.startswith(".jcr") || S == ".eh_frame";<br>
   }<br>
 }<br>
<br></blockquote><div><br></div><div>The same should apply to .ARM.extab and .ARM.exidx for the unwind tables under EHABI for ARM (ELF).<span></span></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Modified: lld/trunk/test/elf2/gc-sections.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/gc-sections.s?rev=251068&r1=251067&r2=251068&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/gc-sections.s?rev=251068&r1=251067&r2=251068&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/test/elf2/gc-sections.s (original)<br>
+++ lld/trunk/test/elf2/gc-sections.s Thu Oct 22 16:42:05 2015<br>
@@ -9,6 +9,7 @@<br>
 # RUN: llvm-readobj -sections -symbols %t2 | FileCheck -check-prefix=GC2 %s<br>
<br>
 # NOGC: Name: .text<br>
+# NOGC: Name: .eh_frame<br>
 # NOGC: Name: .init<br>
 # NOGC: Name: .fini<br>
 # NOGC: Name: a<br>
@@ -21,6 +22,7 @@<br>
 # NOGC: Name: d<br>
<br>
 # GC1:     Name: .text<br>
+# GC1:     Name: .eh_frame<br>
 # GC1:     Name: .init<br>
 # GC1:     Name: .fini<br>
 # GC1:     Name: a<br>
@@ -33,6 +35,7 @@<br>
 # GC1-NOT: Name: d<br>
<br>
 # GC2:     Name: .text<br>
+# GC2:     Name: .eh_frame<br>
 # GC2:     Name: .init<br>
 # GC2:     Name: .fini<br>
 # GC2:     Name: a<br>
@@ -82,3 +85,6 @@ y:<br>
<br>
 .section .preinit_array,"aw",@preinit_array<br>
   .quad 0<br>
+<br>
+.section .eh_frame,"aw",@progbits<br>
+  .quad 0<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'llvm-commits@lists.llvm.org')">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote><br><br>-- <br>Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org<br>