2 ## Test we resolve symbolic relocations in .debug_* sections to a tombstone
3 ## value if the referenced symbol is discarded (--gc-sections, non-prevailing
4 ## section group, SHF_EXCLUDE, /DISCARD/, etc).
6 # RUN: llvm-mc -filetype=obj -triple=i386 %s -o %t.o
7 # RUN: ld.lld %t.o -o %t
8 # RUN: llvm-objdump -s %t | FileCheck %s
10 # CHECK: Contents of section .debug_loc:
11 # CHECK-NEXT: 0000 01000000
12 # CHECK-NEXT: Contents of section .debug_ranges:
13 # CHECK-NEXT: 0000 01000000
14 # CHECK-NEXT: Contents of section .debug_addr:
15 # CHECK-NEXT: 0000 00000000
16 # CHECK-NEXT: Contents of section .debug_names:
17 # CHECK-NEXT: 0000 ffffffff
19 ## -z dead-reloc-in-nonalloc= can override the tombstone value.
20 # RUN: ld.lld -z dead-reloc-in-nonalloc=.debug_loc=42 -z dead-reloc-in-nonalloc=.debug_addr=0xfffffffffffffffe %t.o -o %t1
21 # RUN: llvm-objdump -s %t1 | FileCheck %s --check-prefix=OVERRIDE
23 # OVERRIDE: Contents of section .debug_loc:
24 # OVERRIDE-NEXT: 0000 2a000000 *...
25 # OVERRIDE-NEXT: Contents of section .debug_ranges:
26 # OVERRIDE-NEXT: 0000 01000000 ....
27 # OVERRIDE-NEXT: Contents of section .debug_addr:
28 # OVERRIDE-NEXT: 0000 feffffff ....
30 .section .text.1,"axe"
33 ## Resolved to UINT32_C(-2), with the addend ignored.
34 ## UINT32_C(-1) is a reserved value (base address selection entry) which can't be used.
37 .section .debug_ranges
40 ## Resolved to UINT32_C(0), with the addend ignored.
44 .section .debug_info,"eG",@progbits,5657452045627120676,comdat
48 ## .debug_names may reference a local type unit defined in a COMDAT .debug_info
49 ## section (-g -gpubnames -fdebug-types-section). If the referenced section is
50 ## non-prevailing, resolve to UINT32_MAX.