blob: 3d421e56684e8b3551c49125f5a53d61a002ca0e [file] [log] [blame]
Robert Sloan8ff03552017-06-14 12:40:58 -07001.text
Robert Sloan5cbb5c82018-04-24 11:35:46 -07002.file 1 "inserted_by_delocate.c"
3.loc 1 1 0
Robert Sloan8ff03552017-06-14 12:40:58 -07004BORINGSSL_bcm_text_start:
5 .text
6.Lfoo_local_target:
7foo:
8 # leaq of OPENSSL_ia32cap_P is supported.
9# WAS leaq OPENSSL_ia32cap_P(%rip), %r11
Adam Vartanianbfcf3a72018-08-10 14:55:24 +010010 leaq -128(%rsp), %rsp
Robert Sloan8ff03552017-06-14 12:40:58 -070011 pushfq
12 leaq OPENSSL_ia32cap_addr_delta(%rip), %r11
13 addq (%r11), %r11
14 popfq
Adam Vartanianbfcf3a72018-08-10 14:55:24 +010015 leaq 128(%rsp), %rsp
Robert Sloan8ff03552017-06-14 12:40:58 -070016
17 # As is the equivalent GOTPCREL movq.
18# WAS movq OPENSSL_ia32cap_P@GOTPCREL(%rip), %r12
Adam Vartanianbfcf3a72018-08-10 14:55:24 +010019 leaq -128(%rsp), %rsp
Robert Sloan8ff03552017-06-14 12:40:58 -070020 pushfq
21 leaq OPENSSL_ia32cap_addr_delta(%rip), %r12
22 addq (%r12), %r12
23 popfq
Adam Vartanianbfcf3a72018-08-10 14:55:24 +010024 leaq 128(%rsp), %rsp
25
26 # And a non-movq instruction via the GOT.
27# WAS orq OPENSSL_ia32cap_P@GOTPCREL(%rip), %r12
28 leaq -128(%rsp), %rsp
29 pushq %rax
30 pushfq
31 leaq OPENSSL_ia32cap_addr_delta(%rip), %rax
32 addq (%rax), %rax
33 popfq
34 orq %rax, %r12
35 popq %rax
36 leaq 128(%rsp), %rsp
37
38 # ... which targets the default temp register
39# WAS orq OPENSSL_ia32cap_P@GOTPCREL(%rip), %rax
40 leaq -128(%rsp), %rsp
41 pushq %rbx
42 pushfq
43 leaq OPENSSL_ia32cap_addr_delta(%rip), %rbx
44 addq (%rbx), %rbx
45 popfq
46 orq %rbx, %rax
47 popq %rbx
48 leaq 128(%rsp), %rsp
Robert Sloan8ff03552017-06-14 12:40:58 -070049
50 # Test that GOTPCREL accesses get translated. They are handled
51 # differently for local and external symbols.
52
53# WAS pushq stderr@GOTPCREL(%rip)
54 pushq %rax
55 leaq -128(%rsp), %rsp
56 pushf
57 leaq stderr_GOTPCREL_external(%rip), %rax
58 addq (%rax), %rax
59 movq (%rax), %rax
60 popf
61 leaq 128(%rsp), %rsp
62 xchg %rax, (%rsp)
63# WAS pushq foo@GOTPCREL(%rip)
64 pushq %rax
65 leaq .Lfoo_local_target(%rip), %rax
66 xchg %rax, (%rsp)
67
68# WAS movq stderr@GOTPCREL(%rip), %r11
69 leaq -128(%rsp), %rsp
70 pushf
71 leaq stderr_GOTPCREL_external(%rip), %r11
72 addq (%r11), %r11
73 movq (%r11), %r11
74 popf
75 leaq 128(%rsp), %rsp
76# WAS movq foo@GOTPCREL(%rip), %r11
77 leaq .Lfoo_local_target(%rip), %r11
78
79# WAS vmovq stderr@GOTPCREL(%rip), %xmm0
80 leaq -128(%rsp), %rsp
81 pushq %rax
82 pushf
83 leaq stderr_GOTPCREL_external(%rip), %rax
84 addq (%rax), %rax
85 movq (%rax), %rax
86 popf
Robert Sloan2e9e66a2017-09-25 09:08:29 -070087 vmovq %rax, %xmm0
Robert Sloan8ff03552017-06-14 12:40:58 -070088 popq %rax
89 leaq 128(%rsp), %rsp
90# WAS vmovq foo@GOTPCREL(%rip), %xmm0
91 leaq -128(%rsp), %rsp
92 pushq %rax
93 leaq .Lfoo_local_target(%rip), %rax
Robert Sloan2e9e66a2017-09-25 09:08:29 -070094 vmovq %rax, %xmm0
Robert Sloan8ff03552017-06-14 12:40:58 -070095 popq %rax
96 leaq 128(%rsp), %rsp
97
98# WAS cmoveq stderr@GOTPCREL(%rip), %r11
99 jne 999f
100 leaq -128(%rsp), %rsp
101 pushf
102 leaq stderr_GOTPCREL_external(%rip), %r11
103 addq (%r11), %r11
104 movq (%r11), %r11
105 popf
106 leaq 128(%rsp), %rsp
107999:
108# WAS cmoveq foo@GOTPCREL(%rip), %r11
109 jne 999f
110 leaq .Lfoo_local_target(%rip), %r11
111999:
112# WAS cmovneq stderr@GOTPCREL(%rip), %r11
113 je 999f
114 leaq -128(%rsp), %rsp
115 pushf
116 leaq stderr_GOTPCREL_external(%rip), %r11
117 addq (%r11), %r11
118 movq (%r11), %r11
119 popf
120 leaq 128(%rsp), %rsp
121999:
122# WAS cmovneq foo@GOTPCREL(%rip), %r11
123 je 999f
124 leaq .Lfoo_local_target(%rip), %r11
125999:
126
Robert Sloan2e9e66a2017-09-25 09:08:29 -0700127# WAS movsd foo@GOTPCREL(%rip), %xmm0
128 leaq -128(%rsp), %rsp
129 pushq %rax
130 leaq .Lfoo_local_target(%rip), %rax
131 movq %rax, %xmm0
132 popq %rax
133 leaq 128(%rsp), %rsp
134# WAS vmovsd foo@GOTPCREL(%rip), %xmm0
135 leaq -128(%rsp), %rsp
136 pushq %rax
137 leaq .Lfoo_local_target(%rip), %rax
138 vmovq %rax, %xmm0
139 popq %rax
140 leaq 128(%rsp), %rsp
141
142 # movsd without arguments should be left as-is.
143 movsd
144
Robert Sloan8ff03552017-06-14 12:40:58 -0700145 # Synthesized symbols do not use the GOT.
146# WAS movq BORINGSSL_bcm_text_start@GOTPCREL(%rip), %r11
147 leaq BORINGSSL_bcm_text_start(%rip), %r11
148# WAS movq foobar_bss_get@GOTPCREL(%rip), %r11
149 leaq foobar_bss_get(%rip), %r11
150# WAS movq OPENSSL_ia32cap_get@GOTPCREL(%rip), %r11
151 leaq OPENSSL_ia32cap_get(%rip), %r11
152
Robert Sloan0da43952018-01-03 15:13:14 -0800153 # Transforming moves run the transform in-place after the load.
154# WAS vpbroadcastq stderr@GOTPCREL(%rip), %xmm0
155 leaq -128(%rsp), %rsp
156 pushq %rax
157 pushf
158 leaq stderr_GOTPCREL_external(%rip), %rax
159 addq (%rax), %rax
160 movq (%rax), %rax
161 popf
162 vmovq %rax, %xmm0
163 popq %rax
164 leaq 128(%rsp), %rsp
165 vpbroadcastq %xmm0, %xmm0
166# WAS vpbroadcastq foo@GOTPCREL(%rip), %xmm0
167 leaq -128(%rsp), %rsp
168 pushq %rax
169 leaq .Lfoo_local_target(%rip), %rax
170 vmovq %rax, %xmm0
171 popq %rax
172 leaq 128(%rsp), %rsp
173 vpbroadcastq %xmm0, %xmm0
174
Robert Sloan8ff03552017-06-14 12:40:58 -0700175.comm foobar,64,32
176.text
Robert Sloan5cbb5c82018-04-24 11:35:46 -0700177.loc 1 2 0
Robert Sloan8ff03552017-06-14 12:40:58 -0700178BORINGSSL_bcm_text_end:
179.type foobar_bss_get, @function
180foobar_bss_get:
181 leaq foobar(%rip), %rax
182 ret
183.type stderr_GOTPCREL_external, @object
184.size stderr_GOTPCREL_external, 8
185stderr_GOTPCREL_external:
186 .long stderr@GOTPCREL
187 .long 0
188.type OPENSSL_ia32cap_get, @function
189OPENSSL_ia32cap_get:
190 leaq OPENSSL_ia32cap_P(%rip), %rax
191 ret
192.extern OPENSSL_ia32cap_P
193.type OPENSSL_ia32cap_addr_delta, @object
194.size OPENSSL_ia32cap_addr_delta, 8
195OPENSSL_ia32cap_addr_delta:
196.quad OPENSSL_ia32cap_P-OPENSSL_ia32cap_addr_delta
197.type BORINGSSL_bcm_text_hash, @object
198.size BORINGSSL_bcm_text_hash, 64
199BORINGSSL_bcm_text_hash:
200.byte 0xae
201.byte 0x2c
202.byte 0xea
203.byte 0x2a
204.byte 0xbd
205.byte 0xa6
206.byte 0xf3
207.byte 0xec
208.byte 0x97
209.byte 0x7f
210.byte 0x9b
211.byte 0xf6
212.byte 0x94
213.byte 0x9a
214.byte 0xfc
215.byte 0x83
216.byte 0x68
217.byte 0x27
218.byte 0xcb
219.byte 0xa0
220.byte 0xa0
221.byte 0x9f
222.byte 0x6b
223.byte 0x6f
224.byte 0xde
225.byte 0x52
226.byte 0xcd
227.byte 0xe2
228.byte 0xcd
229.byte 0xff
230.byte 0x31
231.byte 0x80
232.byte 0xa2
233.byte 0xd4
234.byte 0xc3
235.byte 0x66
236.byte 0xf
237.byte 0xc2
238.byte 0x6a
239.byte 0x7b
240.byte 0xf4
241.byte 0xbe
242.byte 0x39
243.byte 0xa2
244.byte 0xd7
245.byte 0x25
246.byte 0xdb
247.byte 0x21
248.byte 0x98
249.byte 0xe9
250.byte 0xd5
251.byte 0x53
252.byte 0xbf
253.byte 0x5c
254.byte 0x32
255.byte 0x6
256.byte 0x83
257.byte 0x34
258.byte 0xc
259.byte 0x65
260.byte 0x89
261.byte 0x52
262.byte 0xbd
263.byte 0x1f