1# REQUIRES: x86
2## Test we resolve relocations referencing TLS symbols in .debug_* sections to
3## a tombstone value if the referenced TLS symbol is discarded.
4
5# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
6# RUN: ld.lld --gc-sections %t.o -o %t
7# RUN: llvm-objdump -s %t | FileCheck %s
8
9# CHECK:      Contents of section .debug_info:
10# CHECK-NEXT:  0000 00000000 00000000 00000000 00000000
11# CHECK-NEXT:  0010 00000000 ffffffff
12
13.globl _start
14_start:
15  ret
16
17.section .tbss,"awT",@nobits
18.globl global
19local:
20global:
21  .quad 0
22
23.section .debug_info
24## On ppc64, .quad local@dtprel+0x8000 (st_value 0 is supposed to point to
25## 0x8000 bytes past the start of ## the dynamic TLS vector. References usually
26## have an addend of 0x8000). MIPS is similar. RISC-V uses 0x800.
27  .quad local@dtpoff+0x8000
28  .quad global@dtpoff+0x8000
29
30## Many other architectures don't use an offset. GCC x86-64 uses a 32-bit value.
31  .long global@dtpoff
32  .long -1
33