Automatic date update in version.in
[binutils-gdb.git] / ld / testsuite / ld-riscv-elf / tls.s
blob7cbf5ea6c720ffe0f3d89820e650639efb2a2e3d
1 .section .tbss,"awT",@nobits
2 .global sg1
3 sg1:
4 .zero 4
5 sl1:
6 .zero 4
8 .text
9 .globl _start
10 .type _start,@function
11 _start:
12 /* GD, global var */
13 la.tls.gd a0,sg1
14 call __tls_get_addr
16 /* IE, global var */
17 la.tls.ie a0,sg1
18 add a0,a0,tp
20 /* GD (TLSDESC), global var */
21 .desc1:
22 auipc a0, %tlsdesc_hi(sg1)
23 lw t0, %tlsdesc_load_lo(.desc1)(a0)
24 addi a0, a0, %tlsdesc_add_lo(.desc1)
25 jalr t0, t0, %tlsdesc_call(.desc1)
27 /* GD, local var */
28 la.tls.gd a0,sl1
29 call __tls_get_addr
31 /* IE, local var */
32 la.tls.ie a0,sl1
33 add a0,a0,tp
35 /* GD (TLSDESC), local var */
36 .desc2:
37 auipc a0, %tlsdesc_hi(sl1)
38 lw t0, %tlsdesc_load_lo(.desc2)(a0)
39 addi a0, a0, %tlsdesc_add_lo(.desc2)
40 jalr t0, t0, %tlsdesc_call(.desc2)
42 ret