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

            Bug ID: 27529
           Summary: LLD/ELF --gc-sections may be overly aggressive
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedb...@nondot.org
          Reporter: compn...@compnerd.org
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to