[llvm-bugs] [Bug 32614] New: ICF causes section ordering to segfault on ARM

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Apr 10 19:49:22 PDT 2017


            Bug ID: 32614
           Summary: ICF causes section ordering to segfault on ARM
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: smeenai at fb.com
                CC: llvm-bugs at lists.llvm.org

% cat reduced.s
        .section        .text.f,"axG",%progbits,f,comdat
        .code   32
        bx      lr

        .section        .text.g,"axG",%progbits,g,comdat
        .code   32
        bx      lr

% clang -target armv7-linux-gnueabi -shared -nostdlib -fuse-ld=lld -Xlinker
--icf=all -o /dev/null reduced.s
(lld crashes during the link)

The assembly is reduced from a C++ source file, so it may not be 100% sensible
(I got rid of a bunch of directives), but it reproduces the segfault. It occurs
in compareByFilePosition [1] because of AOut being null.

My understanding is that, because of ICF, only one of f and g will actually be
output, hence the OutSec for the other will be null. Adding null checks before
the SectionIndex comparison should get rid of the segfault, but I'm not sure if
there's a better solution.


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/20170411/0815617d/attachment.html>

More information about the llvm-bugs mailing list