1.text
2BORINGSSL_bcm_text_start:
3	.text
4.Lfoo_local_target:
5foo:
6	# leaq of OPENSSL_ia32cap_P is supported.
7# WAS leaq OPENSSL_ia32cap_P(%rip), %r11
8	leaq	-128(%rsp), %rsp
9	pushfq
10	leaq	OPENSSL_ia32cap_addr_delta(%rip), %r11
11	addq	(%r11), %r11
12	popfq
13	leaq	128(%rsp), %rsp
14
15	# As is the equivalent GOTPCREL movq.
16# WAS movq OPENSSL_ia32cap_P@GOTPCREL(%rip), %r12
17	leaq	-128(%rsp), %rsp
18	pushfq
19	leaq	OPENSSL_ia32cap_addr_delta(%rip), %r12
20	addq	(%r12), %r12
21	popfq
22	leaq	128(%rsp), %rsp
23
24	# Test that GOTPCREL accesses get translated. They are handled
25	# differently for local and external symbols.
26
27# WAS pushq stderr@GOTPCREL(%rip)
28	pushq %rax
29	leaq -128(%rsp), %rsp
30	pushf
31	leaq stderr_GOTPCREL_external(%rip), %rax
32	addq (%rax), %rax
33	movq (%rax), %rax
34	popf
35	leaq	128(%rsp), %rsp
36	xchg %rax, (%rsp)
37# WAS pushq foo@GOTPCREL(%rip)
38	pushq %rax
39	leaq	.Lfoo_local_target(%rip), %rax
40	xchg %rax, (%rsp)
41
42# WAS movq stderr@GOTPCREL(%rip), %r11
43	leaq -128(%rsp), %rsp
44	pushf
45	leaq stderr_GOTPCREL_external(%rip), %r11
46	addq (%r11), %r11
47	movq (%r11), %r11
48	popf
49	leaq	128(%rsp), %rsp
50# WAS movq foo@GOTPCREL(%rip), %r11
51	leaq	.Lfoo_local_target(%rip), %r11
52
53# WAS vmovq stderr@GOTPCREL(%rip), %xmm0
54	leaq -128(%rsp), %rsp
55	pushq %rax
56	pushf
57	leaq stderr_GOTPCREL_external(%rip), %rax
58	addq (%rax), %rax
59	movq (%rax), %rax
60	popf
61	movq %rax, %xmm0
62	popq %rax
63	leaq 128(%rsp), %rsp
64# WAS vmovq foo@GOTPCREL(%rip), %xmm0
65	leaq -128(%rsp), %rsp
66	pushq %rax
67	leaq	.Lfoo_local_target(%rip), %rax
68	movq %rax, %xmm0
69	popq %rax
70	leaq 128(%rsp), %rsp
71
72# WAS cmoveq stderr@GOTPCREL(%rip), %r11
73	jne 999f
74	leaq -128(%rsp), %rsp
75	pushf
76	leaq stderr_GOTPCREL_external(%rip), %r11
77	addq (%r11), %r11
78	movq (%r11), %r11
79	popf
80	leaq	128(%rsp), %rsp
81999:
82# WAS cmoveq foo@GOTPCREL(%rip), %r11
83	jne 999f
84	leaq	.Lfoo_local_target(%rip), %r11
85999:
86# WAS cmovneq stderr@GOTPCREL(%rip), %r11
87	je 999f
88	leaq -128(%rsp), %rsp
89	pushf
90	leaq stderr_GOTPCREL_external(%rip), %r11
91	addq (%r11), %r11
92	movq (%r11), %r11
93	popf
94	leaq	128(%rsp), %rsp
95999:
96# WAS cmovneq foo@GOTPCREL(%rip), %r11
97	je 999f
98	leaq	.Lfoo_local_target(%rip), %r11
99999:
100
101	# Synthesized symbols do not use the GOT.
102# WAS movq BORINGSSL_bcm_text_start@GOTPCREL(%rip), %r11
103	leaq	BORINGSSL_bcm_text_start(%rip), %r11
104# WAS movq foobar_bss_get@GOTPCREL(%rip), %r11
105	leaq	foobar_bss_get(%rip), %r11
106# WAS movq OPENSSL_ia32cap_get@GOTPCREL(%rip), %r11
107	leaq	OPENSSL_ia32cap_get(%rip), %r11
108
109.comm foobar,64,32
110.text
111BORINGSSL_bcm_text_end:
112.type foobar_bss_get, @function
113foobar_bss_get:
114	leaq	foobar(%rip), %rax
115	ret
116.type stderr_GOTPCREL_external, @object
117.size stderr_GOTPCREL_external, 8
118stderr_GOTPCREL_external:
119	.long stderr@GOTPCREL
120	.long 0
121.type OPENSSL_ia32cap_get, @function
122OPENSSL_ia32cap_get:
123	leaq OPENSSL_ia32cap_P(%rip), %rax
124	ret
125.extern OPENSSL_ia32cap_P
126.type OPENSSL_ia32cap_addr_delta, @object
127.size OPENSSL_ia32cap_addr_delta, 8
128OPENSSL_ia32cap_addr_delta:
129.quad OPENSSL_ia32cap_P-OPENSSL_ia32cap_addr_delta
130.type BORINGSSL_bcm_text_hash, @object
131.size BORINGSSL_bcm_text_hash, 64
132BORINGSSL_bcm_text_hash:
133.byte 0xae
134.byte 0x2c
135.byte 0xea
136.byte 0x2a
137.byte 0xbd
138.byte 0xa6
139.byte 0xf3
140.byte 0xec
141.byte 0x97
142.byte 0x7f
143.byte 0x9b
144.byte 0xf6
145.byte 0x94
146.byte 0x9a
147.byte 0xfc
148.byte 0x83
149.byte 0x68
150.byte 0x27
151.byte 0xcb
152.byte 0xa0
153.byte 0xa0
154.byte 0x9f
155.byte 0x6b
156.byte 0x6f
157.byte 0xde
158.byte 0x52
159.byte 0xcd
160.byte 0xe2
161.byte 0xcd
162.byte 0xff
163.byte 0x31
164.byte 0x80
165.byte 0xa2
166.byte 0xd4
167.byte 0xc3
168.byte 0x66
169.byte 0xf
170.byte 0xc2
171.byte 0x6a
172.byte 0x7b
173.byte 0xf4
174.byte 0xbe
175.byte 0x39
176.byte 0xa2
177.byte 0xd7
178.byte 0x25
179.byte 0xdb
180.byte 0x21
181.byte 0x98
182.byte 0xe9
183.byte 0xd5
184.byte 0x53
185.byte 0xbf
186.byte 0x5c
187.byte 0x32
188.byte 0x6
189.byte 0x83
190.byte 0x34
191.byte 0xc
192.byte 0x65
193.byte 0x89
194.byte 0x52
195.byte 0xbd
196.byte 0x1f
197