[PATCH] D19656: [ELF] - keep alive all non-text sections referenced by .eh_frame

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 29 08:00:30 PDT 2016


grimar added a comment.

In http://reviews.llvm.org/D19656#415910, @compnerd wrote:

> This introduces a new crash on x86_64.  Ive not had a chance to reduce this to a test case that is easy to work with, but the following seems to demonstrate the issue:
>
>   $ cat /tmp/reduced.cc
>   struct S { static inline long m() { return 0; } };
>   
>   #if defined(TU_A)
>   void f(void) { S::m(); }
>   #elif defined(TU_B)
>   void g(void) { S::m(); }
>   #endif
>   
>   $ clang++ -target x86_64-unknown-linux-gnu -DTU_A -c /tmp/reduced.cc -o /tmp/reduced-0.o
>   $ clang++ -target x86_64-unknown-linux-gnu -DTU_B -c /tmp/reduced.cc -o /tmp/reduced-1.o
>   $ lld -flavor gnu --eh-frame-hdr -m elf_x86_64 -shared -o /tmp/reduced.so --gc-sections /tmp/reduced-0.o /tmp/reduced-1.o


Just in case, this can be reduced to:
reduced-0.s:

  .section .text,"G", at progbits,foo
  .type foo, at function
  foo:

reduced-1.s:

  .section .text,"G", at progbits,foo
  .type foo, at function
  foo:
   .cfi_startproc
   .cfi_endproc



  llvm-mc -filetype=obj -triple=x86_64-pc-linux reduced-0.s -o reduced0.o
  llvm-mc -filetype=obj -triple=x86_64-pc-linux reduced-1.s -o reduced1.o


http://reviews.llvm.org/D19656





More information about the llvm-commits mailing list