37 lines · plain
1# REQUIRES: x862## Test we resolve symbolic relocations in .debug_* sections to a tombstone3## value if the referenced symbol is discarded when linking a relocatable object.4 5# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t1.o6# RUN: ld.lld -r %t1.o %t1.o -o %t2.o7# RUN: llvm-readelf -r -x .debug_ranges %t2.o | FileCheck %s8 9## Relocations for a discarded section are changed to R_*_NONE.10# CHECK: Relocation section '.rela.debug_ranges' at offset [[#%#x,]] contains 4 entries:11# CHECK-NEXT: Offset Info Type Symbol's Value Symbol's Name + Addend12# CHECK-NEXT: 0000000000000000 [[#%x,]] R_X86_64_64 0000000000000000 .text.foo + 013# CHECK-NEXT: 0000000000000008 [[#%x,]] R_X86_64_64 0000000000000000 .text.foo + 114# CHECK-NEXT: 0000000000000020 [[#%x,]] R_X86_64_NONE15# CHECK-NEXT: 0000000000000028 [[#%x,]] R_X86_64_NONE16 17## References to a discarded section are changed to tombstone values.18# CHECK: Hex dump of section '.debug_ranges':19# CHECK-NEXT: 0x00000000 00000000 00000000 00000000 0000000020# CHECK-NEXT: 0x00000010 00000000 00000000 00000000 0000000021# CHECK-NEXT: 0x00000020 01000000 00000000 01000000 0000000022# CHECK-NEXT: 0x00000030 00000000 00000000 00000000 0000000023 24.weak foo25 26 .section .text.foo,"axG",@progbits,foo,comdat27.Lfoo:28foo:29 ret30.Lfoo_end:31 32 .section .debug_ranges,"",@progbits33 .quad .Lfoo34 .quad .Lfoo_end35 .quad 036 .quad 037