<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - LLD/ELF --gc-sections may be overly aggressive"
href="https://llvm.org/bugs/show_bug.cgi?id=27529">27529</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>LLD/ELF --gc-sections may be overly aggressive
</td>
</tr>
<tr>
<th>Product</th>
<td>lld
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>compnerd@compnerd.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>When building for elf_i386, --gc-sections can cause lld to segfault. The
following test case seems to reproduce the issue.
# cat /tmp/algorithm.s
.text
.section .text._ZNSt3__112__rs_defaultclEv,"ax",@progbits
.globl _ZNSt3__112__rs_defaultclEv
.p2align 4, 0x90
.type _ZNSt3__112__rs_defaultclEv,@function
_ZNSt3__112__rs_defaultclEv:
.cfi_startproc
.cfi_personality 155, DW.ref.__gxx_personality_v0
.cfi_endproc
.hidden DW.ref.__gxx_personality_v0
.weak DW.ref.__gxx_personality_v0
.section
.data.DW.ref.__gxx_personality_v0,"aGw",@progbits,DW.ref.__gxx_personality_v0,comdat
.p2align 2
.type DW.ref.__gxx_personality_v0,@object
.size DW.ref.__gxx_personality_v0, 4
DW.ref.__gxx_personality_v0:
.long __gxx_personality_v0
# cat /tmp/cxa_personality.s
.text
.section .text.__gxx_personality_v0,"ax",@progbits
.globl __gxx_personality_v0
.type __gxx_personality_v0,@function
__gxx_personality_v0:
# clang -target i686-unknown-linux-gnu -c /tmp/algorithm.s -o /tmp/algorithm.o
# clang -target i686-unknown-linux-gnu -c /tmp/cxa_personality.s -o
/tmp/cxa_personality.o
# lld -flavor gnu -m elf_i386 -o /tmp/reduced.so --gc-sections /tmp/algorithm.o
/tmp/cxa_personality.o</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>