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

            Bug ID: 36367
           Summary: LLD crashes with --emit-relocs when trying to proccess
                    .eh_frame
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedb...@nondot.org
          Reporter: gri...@accesssoftek.com
                CC: llvm-bugs@lists.llvm.org

Following testcase crashes because we currently assume that .rel[a] sections
follows their targets in a sections list. That is not true for .eh_frame case,
where we have synthetic IntX::EhFrame that is created together
with another synthetic sections and it collects EhInputSection inside, so
it creates output section later than .rel[a].eh_frame are proccessed.

So 'Out' local variable is null in elf::getOutputSectionName and addInputSec
and
we segfault. Not sure what we would want to do. Looks additional sorting to
place
.rel[a].eh_frame after .eh_frame might help, but it will break current
assumption that we place synthetic sections at the end and make things more
complicated. And it is not clear if we need to support this case actually. Can
we just restrict using of .eh_frame and emit-relocs together may be to fix
crash ?

# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o
# RUN: ld.lld --emit-relocs  %t1.o -o %t

.text
.globl foo
foo:
 .cfi_startproc
 .Lfunc_end0:
 .size foo, .Lfunc_end0-foo
 .cfi_endproc

-- 
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