36 lines · plain
1# REQUIRES: x862## Test we resolve symbolic relocations in .debug_* sections to a tombstone3## 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 the5## same range of code, which can confuse consumers.6 7# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o8# RUN: ld.lld --icf=all %t.o -o %t9# RUN: llvm-objdump -s %t | FileCheck %s10 11# CHECK: Contents of section .debug_info:12# CHECK-NEXT: 0000 {{[0-9a-f]+}}000 00000000 00000000 0000000013# CHECK: Contents of section .debug_line:14# CHECK-NEXT: 0000 [[ADDR:[0-9a-f]+]] 0000000015# CHECK-SAME: [[ADDR]] 0000000016 17.globl _start18_start:19 ret20 21## .text.1 will be folded by ICF.22.section .text.1,"ax"23 ret24 25.section .debug_info26 .quad .text+827 .quad .text.1+828 29## .debug_line contributions associated with folded-in functions will describe30## different lines to the canonical function. Leaving a tombstone value would31## prevent users from setting breakpoints on the folded-in functions.32## Instead resolve the relocation to the folded .text.1 to .text33.section .debug_line34 .quad .text35 .quad .text.136