summaryrefslogtreecommitdiffstats
path: root/lld/test/elf/Inputs/tls.S
blob: 7d9eab647b533d98c1721d2076fb1344e0f61f24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
        .text
        .globl  main
        .align  16, 0x90
        .type   main,@function
main:                                   # @main
        callq   GOTTPOFF
        addl    %fs:tls1@TPOFF, %eax
        addl    %fs:tls0@TPOFF, %eax
        addl    %fs:tls2@TPOFF, %eax
        ret

        .text
        .globl GOTTPOFF
        .type  GOTTPOFF,@function
GOTTPOFF:
        movq tls2@GOTTPOFF(%rip), %rax
        movl %fs:0(%rax), %eax
        ret

        .text
        .globl TLSLD
        .type  TLSLD,@function
TLSLD:
        leaq tls0@tlsld(%rip), %rdi
        call __tls_get_addr@plt
        leaq tls0@dtpoff(%rax), %rax
        ret

        .type   tls0,@object            # @tls0
        .section        .tbss,"awT",@nobits
        .globl  tls0
        .align  4
tls0:
        .long   0                       # 0x0
        .size   tls0, 4

        .type   tls1,@object            # @tls1
        .globl  tls1
        .align  4
tls1:
        .long   0                       # 0x0
        .size   tls1, 4

        .type   tls2,@object            # @tls2
        .section        .tdata,"awT",@progbits
        .globl  tls2
        .align  4
tls2:
        .long   1                       # 0x1
        .size   tls2, 4
OpenPOWER on IntegriCloud