[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / debug-dead-reloc-relocatable.s
blobe8886f096a8f372dbd98af29004f8a702f334d4e
1 # REQUIRES: x86
2 ## Test we resolve symbolic relocations in .debug_* sections to a tombstone
3 ## value if the referenced symbol is discarded when linking a relocatable object.
5 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t1.o
6 # RUN: ld.lld -r %t1.o %t1.o -o %t2.o
7 # RUN: llvm-readelf -r -x .debug_ranges %t2.o | FileCheck %s
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 + Addend
12 # CHECK-NEXT: 0000000000000000 [[#%x,]] R_X86_64_64 0000000000000000 .text.foo + 0
13 # CHECK-NEXT: 0000000000000008 [[#%x,]] R_X86_64_64 0000000000000000 .text.foo + 1
14 # CHECK-NEXT: 0000000000000020 [[#%x,]] R_X86_64_NONE
15 # CHECK-NEXT: 0000000000000028 [[#%x,]] R_X86_64_NONE
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 00000000
20 # CHECK-NEXT: 0x00000010 00000000 00000000 00000000 00000000
21 # CHECK-NEXT: 0x00000020 01000000 00000000 01000000 00000000
22 # CHECK-NEXT: 0x00000030 00000000 00000000 00000000 00000000
24 .weak foo
26 .section .text.foo,"axG",@progbits,foo,comdat
27 .Lfoo:
28 foo:
29 ret
30 .Lfoo_end:
32 .section .debug_ranges,"",@progbits
33 .quad .Lfoo
34 .quad .Lfoo_end
35 .quad 0
36 .quad 0