Upload Tizen:Base source
[external/binutils.git] / gas / testsuite / gas / sh / tlsd.s
1         .section        .tbss,"awT",@nobits
2         .align 2
3         .global foo, bar
4         .hidden bar
5 foo:    .long   25
6 bar:    .long   27
7 baz:    .long   29
8         .text
9         .align 1
10         .global fn
11         .type   fn, @function
12 fn:
13         mov.l   r12,@-r15
14         mov.l   r14,@-r15
15         sts.l   pr,@-r15
16         mova    .L3,r0
17         mov.l   .L3,r12
18         add     r0,r12
19         mov     r15,r14
20
21         ! Dynamic TLS model, foo not known to be in the current object
22         mov.l   1f,r4
23         mova    2f,r0
24         mov.l   2f,r1
25         add     r0,r1
26         jsr     @r1
27         add     r12,r4
28         bra     3f
29         nop
30         .align  2
31 1:      .long   foo@TLSGD
32 2:      .long   __tls_get_addr@PLT
33 3:
34
35         ! Dynamic TLS model, bar and baz known to be in the current object
36         mov.l   1f,r4
37         mova    2f,r0
38         mov.l   2f,r1
39         add     r0,r1
40         jsr     @r1
41         add     r12,r4
42         bra     3f
43         nop
44         .align  2
45 1:      .long   bar@TLSLDM
46 2:      .long   __tls_get_addr@PLT
47 3:
48         ! Just show that there can be arbitrary instructions here
49         mov     #1,r2
50
51         mov.l   .L4,r1
52         add     r1,r0
53         ! r0 now contains &bar
54
55         ! Again, arbitrary instructions
56         mov.l   r2,@r0
57
58         mov.l   .L5,r1
59         add     r1,r0
60         ! r0 now contains &baz
61
62         mov     r14,r15
63         lds.l   @r15+,pr
64         mov.l   @r15+,r14
65         rts     
66         mov.l   @r15+,r12
67
68         .align  2
69 .L3:    .long   _GLOBAL_OFFSET_TABLE_
70 .L4:    .long   bar@DTPOFF
71 .L5:    .long   baz@DTPOFF