350b51d56a157930ea12040c6c0678b2a890927d
[external/binutils.git] / ld / testsuite / ld-s390 / tlspic1_64.s
1         .section ".tdata", "awT", @progbits
2         .globl sg1, sg2, sg3, sg4, sg5, sg6, sg7, sg8
3         .globl sh1, sh2, sh3, sh4, sh5, sh6, sh7, sh8
4         .hidden sh1, sh2, sh3, sh4, sh5, sh6, sh7, sh8
5 sg1:    .long 17
6 sg2:    .long 18
7 sg3:    .long 19
8 sg4:    .long 20
9 sg5:    .long 21
10 sg6:    .long 22
11 sg7:    .long 23
12 sg8:    .long 24
13 sl1:    .long 65
14 sl2:    .long 66
15 sl3:    .long 67
16 sl4:    .long 68
17 sl5:    .long 69
18 sl6:    .long 70
19 sl7:    .long 71
20 sl8:    .long 72
21 sh1:    .long 257
22 sh2:    .long 258
23 sh3:    .long 259
24 sh4:    .long 260
25 sh5:    .long 261
26 sh6:    .long 262
27 sh7:    .long 263
28 sh8:    .long 264
29         .text
30         .globl  fn1
31         .type   fn1,@function
32 fn1:
33         /* Funtion prolog */
34         stmg    %r6,%r14,48(%r15)
35         bras    %r13,.LTN1
36         /* Literal pool */
37 .LT1:
38 .LC2:
39         .quad   sg1@tlsgd
40 .LC3:
41         .quad   sg2@tlsgd
42 .LC4:
43         .quad   sl1@tlsgd
44 .LC5:
45         .quad   sl2@tlsgd
46 .LC6:
47         .quad   sh1@tlsgd
48 .LC7:
49         .quad   sh2@tlsgd
50 .LC8:
51         .quad   sH1@tlsgd
52 .LC9:
53         .quad   sH2@tlsgd
54 .LC10:
55         .quad   sl1@tlsldm
56 .LC11:
57         .quad   sl1@dtpoff
58 .LC12:
59         .quad   sl2@dtpoff
60 .LC13:
61         .quad   sh1@tlsldm
62 .LC14:
63         .quad   sh1@dtpoff
64 .LC15:
65         .quad   sh2@dtpoff
66 .LC16:
67         .quad   sH1@tlsldm
68 .LC17:
69         .quad   sH1@dtpoff
70 .LC18:
71         .quad   sH2@dtpoff
72 .LC19:
73         .quad   sg2@gotntpoff
74 .LC20:
75         .quad   sl2@gotntpoff
76 .LC21:
77         .quad   sh2@gotntpoff
78 .LC22:
79         .quad   sH2@gotntpoff
80 .LTN1:  
81         /* Funtion prolog */
82         lgr     %r14,%r15
83         larl    %r12,_GLOBAL_OFFSET_TABLE_
84         aghi    %r15,-160
85         stg     %r14,0(%r14)
86
87         /* Extract TCB */
88         ear     %r9,%a0
89         sllg    %r9,%r4,32
90         ear     %r9,%a1
91
92         /* GD */
93         lg      %r2,.LC2-.LT1(%r13)
94         brasl   %r14,__tls_get_offset@plt:tls_gdcall:sg1
95         la      %r2,0(%r2,%r9)
96
97         /* GD -> IE because variable is referenced through IE too */
98         lg      %r2,.LC3-.LT1(%r13)
99         brasl   %r14,__tls_get_offset@plt:tls_gdcall:sg2
100         la      %r2,0(%r2,%r9)
101
102         /* GD against local variable */
103         lg      %r2,.LC4-.LT1(%r13)
104         brasl   %r14,__tls_get_offset@plt:tls_gdcall:sl1
105         la      %r2,0(%r2,%r9)
106
107         /* GD -> IE against local variable referenced through IE too */
108         lg      %r2,.LC5-.LT1(%r13)
109         brasl   %r14,__tls_get_offset@plt:tls_gdcall:sl2
110         la      %r2,0(%r2,%r9)
111
112         /* GD against hidden and local variable */
113         lg      %r2,.LC6-.LT1(%r13)
114         brasl   %r14,__tls_get_offset@plt:tls_gdcall:sh1
115         la      %r2,0(%r2,%r9)
116         
117         /* GD -> IE against hidden and local variable referenced through
118            IE too */
119         lg      %r2,.LC7-.LT1(%r13)
120         brasl   %r14,__tls_get_offset@plt:tls_gdcall:sh2
121         la      %r2,0(%r2,%r9)
122
123         /* GD against hidden but not local variable */
124         lg      %r2,.LC8-.LT1(%r13)
125         brasl   %r14,__tls_get_offset@plt:tls_gdcall:sH1
126         la      %r2,0(%r2,%r9)
127
128         /* GD -> IE against hidden but not local variable referenced through
129            IE too */
130         lg      %r2,.LC9-.LT1(%r13)
131         brasl   %r14,__tls_get_offset@plt:tls_gdcall:sH2
132         la      %r2,0(%r2,%r9)
133
134         /* LD */
135         lg      %r2,.LC10-.LT1(%r13)
136         brasl   %r14,__tls_get_offset@plt:tls_ldcall:sl1
137         la      %r3,0(%r2,%r9)
138         lg      %r4,.LC11-.LT1(%r13)
139         la      %r5,0(%r4,%r3)
140         lg      %r4,.LC12-.LT1(%r13)
141         la      %r5,0(%r4,%r3)
142
143         /* LD against hidden and local variables */
144         lg      %r2,.LC13-.LT1(%r13)
145         brasl   %r14,__tls_get_offset@plt:tls_ldcall:sh1
146         la      %r3,0(%r2,%r9)
147         lg      %r4,.LC14-.LT1(%r13)
148         la      %r5,0(%r4,%r3)
149         lg      %r4,.LC15-.LT1(%r13)
150         la      %r5,0(%r4,%r3)
151         
152         /* LD against hidden but not local variables */
153         lg      %r2,.LC16-.LT1(%r13)
154         brasl   %r14,__tls_get_offset@plt:tls_ldcall:sH1
155         la      %r3,0(%r2,%r9)
156         lg      %r4,.LC17-.LT1(%r13)
157         la      %r5,0(%r4,%r3)
158         lg      %r4,.LC18-.LT1(%r13)
159         la      %r5,0(%r4,%r3)
160
161         /* IE against global var  */
162         lg      %r3,.LC19-.LT1(%r13)
163         lg      %r3,0(%r3,%r12):tls_load:sg2
164         la      %r3,0(%r3,%r9)
165
166         /* IE against local var  */
167         lg      %r3,.LC20-.LT1(%r13)
168         lg      %r4,0(%r3,%r12):tls_load:sl2
169         la      %r5,0(%r4,%r9)
170
171         /* IE against hidden and local var  */
172         lg      %r3,.LC21-.LT1(%r13)
173         lg      %r4,0(%r3,%r12):tls_load:sh2
174         la      %r5,0(%r4,%r9)
175         
176         /* IE against hidden but not local var  */
177         lg      %r3,.LC22-.LT1(%r13)
178         lg      %r4,0(%r3,%r12):tls_load:sH2
179         la      %r5,0(%r4,%r9)
180
181         /* IE against global var with larl got access */
182         larl    %r3,sg5@indntpoff
183         lg      %r3,0(%r3,%r12):tls_load:sg2
184         la      %r3,0(%r3,%r9)
185
186         /* IE against local var with larl got access */
187         larl    %r3,sl5@indntpoff
188         lg      %r4,0(%r3,%r12):tls_load:sl2
189         la      %r5,0(%r4,%r9)
190
191         /* IE against hidden and local var with larl got access */
192         larl    %r3,sh5@indntpoff
193         lg      %r4,0(%r3,%r12):tls_load:sh2
194         la      %r5,0(%r4,%r9)
195         
196         /* IE against hidden but not local var with larl got access */
197         larl    %r3,sH5@indntpoff
198         lg      %r4,0(%r3,%r12):tls_load:sH2
199         la      %r5,0(%r4,%r9)
200
201         /* IE against global var with small got access (no optimization) */
202         lg      %r3,sg5@gotntpoff(%r12)
203         la      %r3,0(%r3,%r9)
204
205         /* IE against local var with small got access (no optimization) */
206         lg      %r3,sl5@gotntpoff(%r12)
207         la      %r3,0(%r3,%r9)
208
209         /* IE against hidden and local var with small got access
210            (no optimization) */
211         lg      %r3,sh5@gotntpoff(%r12)
212         la      %r3,0(%r3,%r9)
213
214         /* IE against hidden but not local var with small got access
215            (no optimization) */
216         lg      %r3,sH5@gotntpoff(%r12)
217         la      %r3,0(%r3,%r9)
218
219         /* Function epilog */
220         lmg     %r6,%r14,208(%r15)
221         br      %r14
222