[lld] r294816 - Create only one section symbol per section.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 14:33:11 PST 2017


>> It looks like the problem is that we segfault when looking up the output
>> section if the .eh_frame section contains a relocation to a discarded
>> section symbol in an FDE. I haven't really thought about how we need to
>> handle FDEs referring to discarded sections in -r mode.

This is a really horrible case. It reduces to just

---------------------------------------------------
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
# RUN: ld.lld -r %t.o %t.o -o %t

.section .foo,"aG", at progbits,bar,comdat
.cfi_startproc
.cfi_endproc
---------------------------------------------------


The question is what can we possibly do about it.

It looks like ld.bfd discards the entire .eh_frame content and gold
discards the second relocation, leaving one frame with an fde that
refers to a bogus location. I am tempted to do what gold does.


Cheers,
Rafael


More information about the llvm-commits mailing list