<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 segfaults when using --gc-sections"
href="https://llvm.org/bugs/show_bug.cgi?id=30793">30793</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>lld segfaults when using --gc-sections
</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>Linux
</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>ELF
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>phosek@chromium.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>We have seen segfaults when using lld with --gc-sections, but we haven't yet
managed to come up with a minimal reproducer:
../../buildtools/toolchain/clang+llvm-x86_64-linux/bin/clang++
--sysroot=../sysroot/x86_64-fuchsia --target=x86_64-fuchsia -Wl,--gc-sections
-o "./exe.unstripped/flutter_wtf_unittests" -Wl,--start-group
@"./flutter_wtf_unittests.rsp" -Wl,--end-group -lmxio -lmagenta &&
../../magenta/prebuilt/downloads/x86_64-elf-6.2.0-Linux-x86_64/bin/x86_64-elf-strip
-s -o "./flutter_wtf_unittests" "./exe.unstripped/flutter_wtf_unittests"
#0 0x00000000009ea032 PrintStackTraceSignalHandler(void*)
(/usr/local/google/home/vtl/projects/fuchsia/out/debug-x86-64/../../buildtools/toolchain/clang+llvm-x86_64-linux/bin/lld+0x9ea032)
#1 0x00000000009e7fc6 SignalHandler(int)
(/usr/local/google/home/vtl/projects/fuchsia/out/debug-x86-64/../../buildtools/toolchain/clang+llvm-x86_64-linux/bin/lld+0x9e7fc6)
#2 0x00007f18d2bdc330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#3 0x0000000001a57f1d llvm::object::ELFType<(llvm::support::endianness)1,
true>::uint
lld::elf::SymbolBody::getVA<llvm::object::ELFType<(llvm::support::endianness)1,
true> >(llvm::object::ELFType<(llvm::support::endianness)1, true>::uint) const
(/usr/local/google/home/vtl/projects/fuchsia/out/debug-x86-64/../../buildtools/toolchain/clang+llvm-x86_64-linux/bin/lld+0x1a57f1d)
#4 0x00000000019dfe19
lld::elf::InputSectionBase<llvm::object::ELFType<(llvm::support::endianness)1,
true> >::relocate(unsigned char*, unsigned char*)
(/usr/local/google/home/vtl/projects/fuchsia/out/debug-x86-64/../../buildtools/toolchain/clang+llvm-x86_64-linux/bin/lld+0x19dfe19)
#5 0x00000000019e29b3
lld::elf::InputSection<llvm::object::ELFType<(llvm::support::endianness)1,
true> >::writeTo(unsigned char*)
(/usr/local/google/home/vtl/projects/fuchsia/out/debug-x86-64/../../buildtools/toolchain/clang+llvm-x86_64-linux/bin/lld+0x19e29b3)
#6 0x0000000001a2734b
lld::elf::OutputSection<llvm::object::ELFType<(llvm::support::endianness)1,
true> >::writeTo(unsigned char*)
(/usr/local/google/home/vtl/projects/fuchsia/out/debug-x86-64/../../buildtools/toolchain/clang+llvm-x86_64-linux/bin/lld+0x1a2734b)
#7 0x00000000009a5fd3 (anonymous
namespace)::Writer<llvm::object::ELFType<(llvm::support::endianness)1, true>
<span class="quote">>::run()</span >
(/usr/local/google/home/vtl/projects/fuchsia/out/debug-x86-64/../../buildtools/toolchain/clang+llvm-x86_64-linux/bin/lld+0x9a5fd3)
#8 0x00000000019bacb9 void
lld::elf::LinkerDriver::link<llvm::object::ELFType<(llvm::support::endianness)1,
true> >(llvm::opt::InputArgList&)
(/usr/local/google/home/vtl/projects/fuchsia/out/debug-x86-64/../../buildtools/toolchain/clang+llvm-x86_64-linux/bin/lld+0x19bacb9)
#9 0x00000000009615e5 lld::elf::LinkerDriver::main(llvm::ArrayRef<char const*>)
(/usr/local/google/home/vtl/projects/fuchsia/out/debug-x86-64/../../buildtools/toolchain/clang+llvm-x86_64-linux/bin/lld+0x9615e5)
#10 0x000000000091d855 main
(/usr/local/google/home/vtl/projects/fuchsia/out/debug-x86-64/../../buildtools/toolchain/clang+llvm-x86_64-linux/bin/lld+0x91d855)
#11 0x00007f18d1abef45 __libc_start_main
/build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#12 0x000000000091d029 _start
(/usr/local/google/home/vtl/projects/fuchsia/out/debug-x86-64/../../buildtools/toolchain/clang+llvm-x86_64-linux/bin/lld+0x91d029)</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>