1# REQUIRES: x86 2## Test we resolve symbolic relocations in .debug_* sections to a tombstone 3## value if the referenced section symbol is folded into another section by ICF. 4## Otherwise, we would leave entries in multiple CUs claiming ownership of the 5## same range of code, which can confuse consumers. 6 7# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o 8# RUN: ld.lld --icf=all %t.o -o %t 9# RUN: llvm-objdump -s %t | FileCheck %s 10 11# CHECK: Contents of section .debug_info: 12# CHECK-NEXT: 0000 {{[0-9a-f]+}}000 00000000 00000000 00000000 13# CHECK: Contents of section .debug_line: 14# CHECK-NEXT: 0000 [[ADDR:[0-9a-f]+]] 00000000 15# CHECK-SAME: [[ADDR]] 00000000 16 17.globl _start 18_start: 19 ret 20 21## .text.1 will be folded by ICF. 22.section .text.1,"ax" 23 ret 24 25.section .debug_info 26 .quad .text+8 27 .quad .text.1+8 28 29## .debug_line contributions associated with folded-in functions will describe 30## different lines to the canonical function. Leaving a tombstone value would 31## prevent users from setting breakpoints on the folded-in functions. 32## Instead resolve the relocation to the folded .text.1 to .text 33.section .debug_line 34 .quad .text 35 .quad .text.1 36