Set OSABI field back to 0 (SysV), to avoid interoperability problems
[nacl-binutils.git] / ld / testsuite / ld-i386 / tlspic1.s
blob9dcb3b73722c4240c42f5ffba47b264beada8f49
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 pushl %ebp
34 movl %esp, %ebp
35 pushl %ebx
36 pushl %eax
37 call 1f
38 1: popl %ebx
39 addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
40 nop;nop;nop;nop
42 /* GD */
43 leal sg1@tlsgd(,%ebx,1), %eax
44 call ___tls_get_addr@plt
45 nop;nop;nop;nop
47 /* GD -> IE because variable is referenced through @gottpoff too */
48 leal sg2@tlsgd(,%ebx,1), %eax
49 call ___tls_get_addr@plt
50 nop;nop;nop;nop
52 /* GD -> IE because variable is referenced through @gotntpoff too */
53 leal sg3@tlsgd(,%ebx,1), %eax
54 call ___tls_get_addr@plt
55 nop;nop;nop;nop
57 /* GD -> IE because variable is referenced through @gottpoff and
58 @gotntpoff too */
59 leal sg4@tlsgd(,%ebx,1), %eax
60 call ___tls_get_addr@plt
61 nop;nop;nop;nop
63 /* GD against local variable */
64 leal sl1@tlsgd(,%ebx,1), %eax
65 call ___tls_get_addr@plt
66 nop;nop;nop;nop
68 /* GD -> IE against local variable referenced through @gottpoff too */
69 leal sl2@tlsgd(,%ebx,1), %eax
70 call ___tls_get_addr@plt
71 nop;nop;nop;nop
73 /* GD -> IE against local variable referenced through @gotntpoff
74 too */
75 leal sl3@tlsgd(,%ebx,1), %eax
76 call ___tls_get_addr@plt
77 nop;nop;nop;nop
79 /* GD -> IE against local variable referenced through @gottpoff and
80 @gotntpoff too */
81 leal sl4@tlsgd(,%ebx,1), %eax
82 call ___tls_get_addr@plt
83 nop;nop;nop;nop
85 /* GD against hidden and local variable */
86 leal sh1@tlsgd(,%ebx,1), %eax
87 call ___tls_get_addr@plt
88 nop;nop;nop;nop
90 /* GD -> IE against hidden and local variable referenced through
91 @gottpoff too */
92 leal sh2@tlsgd(,%ebx,1), %eax
93 call ___tls_get_addr@plt
94 nop;nop;nop;nop
96 /* GD -> IE against hidden and local variable referenced through
97 @gotntpoff too */
98 leal sh3@tlsgd(,%ebx,1), %eax
99 call ___tls_get_addr@plt
100 nop;nop;nop;nop
102 /* GD -> IE against hidden and local variable referenced through
103 @gottpoff and @gotntpoff too */
104 leal sh4@tlsgd(,%ebx,1), %eax
105 call ___tls_get_addr@plt
106 nop;nop;nop;nop
108 /* GD against hidden but not local variable */
109 leal sH1@tlsgd(,%ebx,1), %eax
110 call ___tls_get_addr@plt
111 nop;nop;nop;nop
113 /* GD -> IE against hidden but not local variable referenced through
114 @gottpoff too */
115 leal sH2@tlsgd(,%ebx,1), %eax
116 call ___tls_get_addr@plt
117 nop;nop;nop;nop
119 /* GD -> IE against hidden but not local variable referenced through
120 @gotntpoff too */
121 leal sH3@tlsgd(,%ebx,1), %eax
122 call ___tls_get_addr@plt
123 nop;nop;nop;nop
125 /* GD -> IE against hidden but not local variable referenced through
126 @gottpoff and @gotntpoff too */
127 leal sH4@tlsgd(,%ebx,1), %eax
128 call ___tls_get_addr@plt
129 nop;nop;nop;nop
131 /* LD */
132 leal sl1@tlsldm(%ebx), %eax
133 call ___tls_get_addr@PLT
134 nop;nop
135 leal sl1@dtpoff(%eax), %edx
136 nop;nop
137 leal 2+sl2@dtpoff(%eax), %ecx
138 nop;nop;nop;nop
140 /* LD against hidden and local variables */
141 leal sh1@tlsldm(%ebx), %eax
142 call ___tls_get_addr@PLT
143 nop;nop
144 leal sh1@dtpoff(%eax), %edx
145 nop;nop
146 leal sh2@dtpoff+3(%eax), %ecx
147 nop;nop;nop;nop
149 /* LD against hidden but not local variables */
150 leal sH1@tlsldm(%ebx), %eax
151 call ___tls_get_addr@PLT
152 nop;nop
153 leal sH1@dtpoff(%eax), %edx
154 nop;nop
155 leal sH2@dtpoff+1(%eax), %ecx
156 nop;nop
158 /* @gottpoff IE against global var */
159 movl %gs:0, %ecx
160 nop;nop
161 subl sg2@gottpoff(%ebx), %ecx
162 nop;nop;nop;nop
164 /* @gottpoff IE against global var */
165 movl %gs:0, %eax
166 nop;nop
167 subl sg4@gottpoff(%ebx), %eax
168 nop;nop;nop;nop
170 /* @gotntpoff IE against global var */
171 movl %gs:0, %ecx
172 nop;nop
173 addl sg3@gotntpoff(%ebx), %ecx
174 nop;nop;nop;nop
176 /* @gotntpoff IE against global var */
177 movl %gs:0, %eax
178 nop;nop
179 addl sg4@gotntpoff(%ebx), %eax
180 nop;nop;nop;nop
182 /* @gottpoff IE against local var */
183 movl %gs:0, %ecx
184 nop;nop
185 subl sl2@gottpoff(%ebx), %ecx
186 nop;nop;nop;nop
188 /* @gottpoff IE against local var */
189 movl %gs:0, %eax
190 nop;nop
191 subl sl4@gottpoff(%ebx), %eax
192 nop;nop;nop;nop
194 /* @gotntpoff IE against local var */
195 movl %gs:0, %ecx
196 nop;nop
197 addl sl3@gotntpoff(%ebx), %ecx
198 nop;nop;nop;nop
200 /* @gotntpoff IE against local var */
201 movl %gs:0, %eax
202 nop;nop
203 addl sl4@gotntpoff(%ebx), %eax
204 nop;nop;nop;nop
206 /* @gottpoff IE against hidden and local var */
207 movl %gs:0, %ecx
208 nop;nop
209 subl sh2@gottpoff(%ebx), %ecx
210 nop;nop;nop;nop
212 /* @gottpoff IE against hidden and local var */
213 movl %gs:0, %eax
214 nop;nop
215 subl sh4@gottpoff(%ebx), %eax
216 nop;nop;nop;nop
218 /* @gotntpoff IE against hidden and local var */
219 movl %gs:0, %ecx
220 nop;nop
221 addl sh3@gotntpoff(%ebx), %ecx
222 nop;nop;nop;nop
224 /* @gotntpoff IE against hidden and local var */
225 movl %gs:0, %eax
226 nop;nop
227 addl sh4@gotntpoff(%ebx), %eax
228 nop;nop;nop;nop
230 /* @gottpoff IE against hidden but not local var */
231 movl %gs:0, %ecx
232 nop;nop
233 subl sH2@gottpoff(%ebx), %ecx
234 nop;nop;nop;nop
236 /* @gottpoff IE against hidden but not local var */
237 movl %gs:0, %eax
238 nop;nop
239 subl sH4@gottpoff(%ebx), %eax
240 nop;nop;nop;nop
242 /* @gotntpoff IE against hidden but not local var */
243 movl %gs:0, %ecx
244 nop;nop
245 addl sH3@gotntpoff(%ebx), %ecx
246 nop;nop;nop;nop
248 /* @gotntpoff IE against hidden but not local var */
249 movl %gs:0, %eax
250 nop;nop
251 addl sH4@gotntpoff(%ebx), %eax
252 nop;nop;nop;nop
254 /* Direct access through %gs */
256 /* @gotntpoff IE against global var */
257 movl sg5@gotntpoff(%ebx), %ecx
258 nop;nop
259 movl %gs:(%ecx), %edx
260 nop;nop;nop;nop
262 /* @gotntpoff IE against local var */
263 movl sl5@gotntpoff(%ebx), %eax
264 nop;nop
265 movl %gs:(%eax), %edx
266 nop;nop;nop;nop
268 /* @gotntpoff IE against hidden and local var */
269 movl sh5@gotntpoff(%ebx), %edx
270 nop;nop
271 movl %gs:(%edx), %edx
272 nop;nop;nop;nop
274 /* @gotntpoff IE against hidden but not local var */
275 movl sH5@gotntpoff(%ebx), %ecx
276 nop;nop
277 movl %gs:(%ecx), %edx
278 nop;nop;nop;nop
280 movl -4(%ebp), %ebx
281 leave