[llvm-bugs] [Bug 33596] New: lld crashes if we synthesize output sections using BYTE commands with -r

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 26 10:15:19 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=33596

            Bug ID: 33596
           Summary: lld crashes if we synthesize output sections using
                    BYTE commands with -r
           Product: lld
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: ruiu at google.com
                CC: llvm-bugs at lists.llvm.org

lld crashes if the -r option is given and the following linker script is given.

$ llvm-mc -filetype=obj -triple=x86_64-unknown-linux -o x.o < /dev/null
$ echo 'SECTIONS { .foo : { BYTE(0x11) } }' > x.script
$ /ssd/b/bin/ld.lld -o /dev/null -r x.o x.script
#0 0x0000000001f62fd9 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/ssd/llvm-project/llvm/lib/Support/Unix/Signals.inc:398:11
#1 0x0000000001f63189 PrintStackTraceSignalHandler(void*)
/ssd/llvm-project/llvm/lib/Support/Unix/Signals.inc:462:1
#2 0x0000000001f617f3 llvm::sys::RunSignalHandlers()
/ssd/llvm-project/llvm/lib/Support/Signals.cpp:0:5
#3 0x0000000001f634e4 SignalHandler(int)
/ssd/llvm-project/llvm/lib/Support/Unix/Signals.inc:252:1
#4 0x00007f6719a50330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#5 0x00000000022147b1 (anonymous
namespace)::Writer<llvm::object::ELFType<(llvm::support::endianness)1, true>
>::finalizeSections() /ssd/llvm-project/lld/ELF/Writer.cpp:1247:23
#6 0x00000000021f82cf (anonymous
namespace)::Writer<llvm::object::ELFType<(llvm::support::endianness)1, true>
>::run() /ssd/llvm-project/lld/ELF/Writer.cpp:207:3
#7 0x0000000002228ad2 void
lld::elf::writeResult<llvm::object::ELFType<(llvm::support::endianness)1, true>
>() /ssd/llvm-project/lld/ELF/Writer.cpp:126:64
#8 0x000000000203b047 void
lld::elf::LinkerDriver::link<llvm::object::ELFType<(llvm::support::endianness)1,
true> >(llvm::opt::InputArgList&) /ssd/llvm-project/lld/ELF/Driver.cpp:1057:1
#9 0x000000000202a979 lld::elf::LinkerDriver::main(llvm::ArrayRef<char const*>,
bool) /ssd/llvm-project/lld/ELF/Driver.cpp:386:5
#10 0x000000000202a17d lld::elf::link(llvm::ArrayRef<char const*>, bool,
llvm::raw_ostream&) /ssd/llvm-project/lld/ELF/Driver.cpp:86:3
#11 0x0000000001ea327e main /ssd/llvm-project/lld/tools/lld/lld.cpp:104:12
#12 0x00007f671862bf45 __libc_start_main
/build/eglibc-MjiXCM/eglibc-2.19/csu/libc-start.c:321:0
#13 0x0000000001ea3029 _start (/ssd/b/bin/ld.lld+0x1ea3029)
Stack dump:
0.      Program arguments: /ssd/b/bin/ld.lld -o /dev/null -r x.o x.script
/tmp/foo.sh: line 3: 20852 Segmentation fault      (core dumped) ld.lld -o
/dev/null -r x.o x.script

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170626/0ef1c550/attachment.html>


More information about the llvm-bugs mailing list