xref: /llvm-project/lld/test/ELF/x86-64-static-tls-model.s (revision 6ca8fde226e907db13bc538e721af8724f0e92d0)
1# REQUIRES: x86
2
3## In this test R_X86_64_GOTTPOFF is a IE relocation (static TLS model),
4## test check we add STATIC_TLS flag for -shared.
5
6# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
7# RUN: ld.lld %t.o -o %t.so -shared
8# RUN: llvm-readobj --dynamic-table %t.so | FileCheck %s
9# RUN: ld.lld %t.o -o %t -pie
10# RUN: llvm-readobj --dynamic-table %t | FileCheck %s --check-prefix=EXE
11
12# CHECK: DynamicSection [
13# CHECK: FLAGS STATIC_TLS
14
15# EXE-NOT: FLAGS STATIC_TLS
16
17.section ".tdata", "awT", @progbits
18.globl var
19var:
20
21movq var@GOTTPOFF(%rip), %rax # R_X86_64_GOTTPOFF
22movl %fs:0(%rax), %eax
23