1.text
2.file 1 "inserted_by_delocate.c"
3.loc 1 1 0
4BORINGSSL_bcm_text_start:
5	.text
6.Lfoo_local_target:
7foo:
8.Lbar_local_target:
9bar:
10	# leaq of OPENSSL_ia32cap_P is supported.
11# WAS leaq OPENSSL_ia32cap_P(%rip), %r11
12	leaq -128(%rsp), %rsp
13	pushfq
14	leaq	OPENSSL_ia32cap_addr_delta(%rip), %r11
15	addq	(%r11), %r11
16	popfq
17	leaq 128(%rsp), %rsp
18
19	# As is the equivalent GOTPCREL movq.
20# WAS movq OPENSSL_ia32cap_P@GOTPCREL(%rip), %r12
21	leaq -128(%rsp), %rsp
22	pushfq
23	leaq	OPENSSL_ia32cap_addr_delta(%rip), %r12
24	addq	(%r12), %r12
25	popfq
26	leaq 128(%rsp), %rsp
27
28	# And a non-movq instruction via the GOT.
29# WAS orq OPENSSL_ia32cap_P@GOTPCREL(%rip), %r12
30	leaq -128(%rsp), %rsp
31	pushq %rax
32	pushfq
33	leaq	OPENSSL_ia32cap_addr_delta(%rip), %rax
34	addq	(%rax), %rax
35	popfq
36	orq %rax, %r12
37	popq %rax
38	leaq 128(%rsp), %rsp
39
40	# ... which targets the default temp register
41# WAS orq OPENSSL_ia32cap_P@GOTPCREL(%rip), %rax
42	leaq -128(%rsp), %rsp
43	pushq %rbx
44	pushfq
45	leaq	OPENSSL_ia32cap_addr_delta(%rip), %rbx
46	addq	(%rbx), %rbx
47	popfq
48	orq %rbx, %rax
49	popq %rbx
50	leaq 128(%rsp), %rsp
51
52	# Test that GOTPCREL accesses get translated. They are handled
53	# differently for local and external symbols.
54
55# WAS pushq stderr@GOTPCREL(%rip)
56	pushq %rax
57	leaq -128(%rsp), %rsp
58	pushf
59	leaq stderr_GOTPCREL_external(%rip), %rax
60	addq (%rax), %rax
61	movq (%rax), %rax
62	popf
63	leaq	128(%rsp), %rsp
64	xchg %rax, (%rsp)
65# WAS pushq foo@GOTPCREL(%rip)
66	pushq %rax
67	leaq	.Lfoo_local_target(%rip), %rax
68	xchg %rax, (%rsp)
69
70# WAS movq stderr@GOTPCREL(%rip), %r11
71	leaq -128(%rsp), %rsp
72	pushf
73	leaq stderr_GOTPCREL_external(%rip), %r11
74	addq (%r11), %r11
75	movq (%r11), %r11
76	popf
77	leaq	128(%rsp), %rsp
78# WAS movq foo@GOTPCREL(%rip), %r11
79	leaq	.Lfoo_local_target(%rip), %r11
80
81# WAS vmovq stderr@GOTPCREL(%rip), %xmm0
82	leaq -128(%rsp), %rsp
83	pushq %rax
84	pushf
85	leaq stderr_GOTPCREL_external(%rip), %rax
86	addq (%rax), %rax
87	movq (%rax), %rax
88	popf
89	vmovq %rax, %xmm0
90	popq %rax
91	leaq 128(%rsp), %rsp
92# WAS vmovq foo@GOTPCREL(%rip), %xmm0
93	leaq -128(%rsp), %rsp
94	pushq %rax
95	leaq	.Lfoo_local_target(%rip), %rax
96	vmovq %rax, %xmm0
97	popq %rax
98	leaq 128(%rsp), %rsp
99
100# WAS cmoveq stderr@GOTPCREL(%rip), %r11
101	jne 999f
102	leaq -128(%rsp), %rsp
103	pushf
104	leaq stderr_GOTPCREL_external(%rip), %r11
105	addq (%r11), %r11
106	movq (%r11), %r11
107	popf
108	leaq	128(%rsp), %rsp
109999:
110# WAS cmoveq foo@GOTPCREL(%rip), %r11
111	jne 999f
112	leaq	.Lfoo_local_target(%rip), %r11
113999:
114# WAS cmovneq stderr@GOTPCREL(%rip), %r11
115	je 999f
116	leaq -128(%rsp), %rsp
117	pushf
118	leaq stderr_GOTPCREL_external(%rip), %r11
119	addq (%r11), %r11
120	movq (%r11), %r11
121	popf
122	leaq	128(%rsp), %rsp
123999:
124# WAS cmovneq foo@GOTPCREL(%rip), %r11
125	je 999f
126	leaq	.Lfoo_local_target(%rip), %r11
127999:
128
129# WAS movsd foo@GOTPCREL(%rip), %xmm0
130	leaq -128(%rsp), %rsp
131	pushq %rax
132	leaq	.Lfoo_local_target(%rip), %rax
133	movq %rax, %xmm0
134	popq %rax
135	leaq 128(%rsp), %rsp
136# WAS vmovsd foo@GOTPCREL(%rip), %xmm0
137	leaq -128(%rsp), %rsp
138	pushq %rax
139	leaq	.Lfoo_local_target(%rip), %rax
140	vmovq %rax, %xmm0
141	popq %rax
142	leaq 128(%rsp), %rsp
143
144	# movsd without arguments should be left as-is.
145	movsd
146
147	# Synthesized symbols do not use the GOT.
148# WAS movq BORINGSSL_bcm_text_start@GOTPCREL(%rip), %r11
149	leaq	BORINGSSL_bcm_text_start(%rip), %r11
150# WAS movq foobar_bss_get@GOTPCREL(%rip), %r11
151	leaq	foobar_bss_get(%rip), %r11
152# WAS movq OPENSSL_ia32cap_get@GOTPCREL(%rip), %r11
153	leaq	.LOPENSSL_ia32cap_get_local_target(%rip), %r11
154
155	# Transforming moves run the transform in-place after the load.
156# WAS vpbroadcastq stderr@GOTPCREL(%rip), %xmm0
157	leaq -128(%rsp), %rsp
158	pushq %rax
159	pushf
160	leaq stderr_GOTPCREL_external(%rip), %rax
161	addq (%rax), %rax
162	movq (%rax), %rax
163	popf
164	vmovq %rax, %xmm0
165	popq %rax
166	leaq 128(%rsp), %rsp
167	vpbroadcastq %xmm0, %xmm0
168# WAS vpbroadcastq foo@GOTPCREL(%rip), %xmm0
169	leaq -128(%rsp), %rsp
170	pushq %rax
171	leaq	.Lfoo_local_target(%rip), %rax
172	vmovq %rax, %xmm0
173	popq %rax
174	leaq 128(%rsp), %rsp
175	vpbroadcastq %xmm0, %xmm0
176
177	# GCC sometimes loads a pair of pointers into an XMM register and
178	# writes them together.
179# WAS movq gcm_gmult_clmul@GOTPCREL(%rip), %xmm0
180	leaq -128(%rsp), %rsp
181	pushq %rax
182	pushf
183	leaq gcm_gmult_clmul_GOTPCREL_external(%rip), %rax
184	addq (%rax), %rax
185	movq (%rax), %rax
186	popf
187	movq %rax, %xmm0
188	popq %rax
189	leaq 128(%rsp), %rsp
190# WAS movhps gcm_ghash_clmul@GOTPCREL(%rip), %xmm0
191	leaq -128(%rsp), %rsp
192	pushq %rax
193	pushf
194	leaq gcm_ghash_clmul_GOTPCREL_external(%rip), %rax
195	addq (%rax), %rax
196	movq (%rax), %rax
197	popf
198	pushq %rax
199	movhps (%rsp), %xmm0
200	leaq 8(%rsp), %rsp
201	popq %rax
202	leaq 128(%rsp), %rsp
203	movaps %xmm0, (%rsp)
204
205	# We've yet to observe this, but the above could also have been written
206	# with movlps.
207# WAS movhps gcm_ghash_clmul@GOTPCREL(%rip), %xmm0
208	leaq -128(%rsp), %rsp
209	pushq %rax
210	pushf
211	leaq gcm_ghash_clmul_GOTPCREL_external(%rip), %rax
212	addq (%rax), %rax
213	movq (%rax), %rax
214	popf
215	pushq %rax
216	movhps (%rsp), %xmm0
217	leaq 8(%rsp), %rsp
218	popq %rax
219	leaq 128(%rsp), %rsp
220# WAS movlps gcm_gmult_clmul@GOTPCREL(%rip), %xmm0
221	leaq -128(%rsp), %rsp
222	pushq %rax
223	pushf
224	leaq gcm_gmult_clmul_GOTPCREL_external(%rip), %rax
225	addq (%rax), %rax
226	movq (%rax), %rax
227	popf
228	pushq %rax
229	movlps (%rsp), %xmm0
230	leaq 8(%rsp), %rsp
231	popq %rax
232	leaq 128(%rsp), %rsp
233	movaps %xmm0, (%rsp)
234
235	# Same as above, but with a local symbol.
236# WAS movhps foo@GOTPCREL(%rip), %xmm0
237	leaq -128(%rsp), %rsp
238	pushq %rax
239	leaq	.Lfoo_local_target(%rip), %rax
240	pushq %rax
241	movhps (%rsp), %xmm0
242	leaq 8(%rsp), %rsp
243	popq %rax
244	leaq 128(%rsp), %rsp
245# WAS movlps bar@GOTPCREL(%rip), %xmm0
246	leaq -128(%rsp), %rsp
247	pushq %rax
248	leaq	.Lbar_local_target(%rip), %rax
249	pushq %rax
250	movlps (%rsp), %xmm0
251	leaq 8(%rsp), %rsp
252	popq %rax
253	leaq 128(%rsp), %rsp
254	movaps %xmm0, (%rsp)
255
256# WAS cmpq foo@GOTPCREL(%rip), %rax
257	leaq -128(%rsp), %rsp
258	pushq %rbx
259	leaq	.Lfoo_local_target(%rip), %rbx
260	cmpq %rbx, %rax
261	popq %rbx
262	leaq 128(%rsp), %rsp
263# WAS cmpq %rax, foo@GOTPCREL(%rip)
264	leaq -128(%rsp), %rsp
265	pushq %rbx
266	leaq	.Lfoo_local_target(%rip), %rbx
267	cmpq %rax, %rbx
268	popq %rbx
269	leaq 128(%rsp), %rsp
270
271.comm foobar,64,32
272.text
273.loc 1 2 0
274BORINGSSL_bcm_text_end:
275.type foobar_bss_get, @function
276foobar_bss_get:
277	leaq	foobar(%rip), %rax
278	ret
279.type gcm_ghash_clmul_GOTPCREL_external, @object
280.size gcm_ghash_clmul_GOTPCREL_external, 8
281gcm_ghash_clmul_GOTPCREL_external:
282	.long gcm_ghash_clmul@GOTPCREL
283	.long 0
284.type gcm_gmult_clmul_GOTPCREL_external, @object
285.size gcm_gmult_clmul_GOTPCREL_external, 8
286gcm_gmult_clmul_GOTPCREL_external:
287	.long gcm_gmult_clmul@GOTPCREL
288	.long 0
289.type stderr_GOTPCREL_external, @object
290.size stderr_GOTPCREL_external, 8
291stderr_GOTPCREL_external:
292	.long stderr@GOTPCREL
293	.long 0
294.type OPENSSL_ia32cap_get, @function
295.globl OPENSSL_ia32cap_get
296.LOPENSSL_ia32cap_get_local_target:
297OPENSSL_ia32cap_get:
298	leaq OPENSSL_ia32cap_P(%rip), %rax
299	ret
300.extern OPENSSL_ia32cap_P
301.type OPENSSL_ia32cap_addr_delta, @object
302.size OPENSSL_ia32cap_addr_delta, 8
303OPENSSL_ia32cap_addr_delta:
304.quad OPENSSL_ia32cap_P-OPENSSL_ia32cap_addr_delta
305.type BORINGSSL_bcm_text_hash, @object
306.size BORINGSSL_bcm_text_hash, 64
307BORINGSSL_bcm_text_hash:
308.byte 0xae
309.byte 0x2c
310.byte 0xea
311.byte 0x2a
312.byte 0xbd
313.byte 0xa6
314.byte 0xf3
315.byte 0xec
316.byte 0x97
317.byte 0x7f
318.byte 0x9b
319.byte 0xf6
320.byte 0x94
321.byte 0x9a
322.byte 0xfc
323.byte 0x83
324.byte 0x68
325.byte 0x27
326.byte 0xcb
327.byte 0xa0
328.byte 0xa0
329.byte 0x9f
330.byte 0x6b
331.byte 0x6f
332.byte 0xde
333.byte 0x52
334.byte 0xcd
335.byte 0xe2
336.byte 0xcd
337.byte 0xff
338.byte 0x31
339.byte 0x80
340.byte 0xa2
341.byte 0xd4
342.byte 0xc3
343.byte 0x66
344.byte 0xf
345.byte 0xc2
346.byte 0x6a
347.byte 0x7b
348.byte 0xf4
349.byte 0xbe
350.byte 0x39
351.byte 0xa2
352.byte 0xd7
353.byte 0x25
354.byte 0xdb
355.byte 0x21
356.byte 0x98
357.byte 0xe9
358.byte 0xd5
359.byte 0x53
360.byte 0xbf
361.byte 0x5c
362.byte 0x32
363.byte 0x6
364.byte 0x83
365.byte 0x34
366.byte 0xc
367.byte 0x65
368.byte 0x89
369.byte 0x52
370.byte 0xbd
371.byte 0x1f
372