Robert Sloan | 8ff0355 | 2017-06-14 12:40:58 -0700 | [diff] [blame] | 1 | .text |
Robert Sloan | 5cbb5c8 | 2018-04-24 11:35:46 -0700 | [diff] [blame^] | 2 | .file 1 "inserted_by_delocate.c" |
| 3 | .loc 1 1 0 |
Robert Sloan | 8ff0355 | 2017-06-14 12:40:58 -0700 | [diff] [blame] | 4 | BORINGSSL_bcm_text_start: |
| 5 | .text |
| 6 | .Lfoo_local_target: |
| 7 | foo: |
| 8 | # leaq of OPENSSL_ia32cap_P is supported. |
| 9 | # WAS leaq OPENSSL_ia32cap_P(%rip), %r11 |
| 10 | leaq -128(%rsp), %rsp |
| 11 | pushfq |
| 12 | leaq OPENSSL_ia32cap_addr_delta(%rip), %r11 |
| 13 | addq (%r11), %r11 |
| 14 | popfq |
| 15 | leaq 128(%rsp), %rsp |
| 16 | |
| 17 | # As is the equivalent GOTPCREL movq. |
| 18 | # WAS movq OPENSSL_ia32cap_P@GOTPCREL(%rip), %r12 |
| 19 | leaq -128(%rsp), %rsp |
| 20 | pushfq |
| 21 | leaq OPENSSL_ia32cap_addr_delta(%rip), %r12 |
| 22 | addq (%r12), %r12 |
| 23 | popfq |
| 24 | leaq 128(%rsp), %rsp |
| 25 | |
| 26 | # Test that GOTPCREL accesses get translated. They are handled |
| 27 | # differently for local and external symbols. |
| 28 | |
| 29 | # WAS pushq stderr@GOTPCREL(%rip) |
| 30 | pushq %rax |
| 31 | leaq -128(%rsp), %rsp |
| 32 | pushf |
| 33 | leaq stderr_GOTPCREL_external(%rip), %rax |
| 34 | addq (%rax), %rax |
| 35 | movq (%rax), %rax |
| 36 | popf |
| 37 | leaq 128(%rsp), %rsp |
| 38 | xchg %rax, (%rsp) |
| 39 | # WAS pushq foo@GOTPCREL(%rip) |
| 40 | pushq %rax |
| 41 | leaq .Lfoo_local_target(%rip), %rax |
| 42 | xchg %rax, (%rsp) |
| 43 | |
| 44 | # WAS movq stderr@GOTPCREL(%rip), %r11 |
| 45 | leaq -128(%rsp), %rsp |
| 46 | pushf |
| 47 | leaq stderr_GOTPCREL_external(%rip), %r11 |
| 48 | addq (%r11), %r11 |
| 49 | movq (%r11), %r11 |
| 50 | popf |
| 51 | leaq 128(%rsp), %rsp |
| 52 | # WAS movq foo@GOTPCREL(%rip), %r11 |
| 53 | leaq .Lfoo_local_target(%rip), %r11 |
| 54 | |
| 55 | # WAS vmovq stderr@GOTPCREL(%rip), %xmm0 |
| 56 | leaq -128(%rsp), %rsp |
| 57 | pushq %rax |
| 58 | pushf |
| 59 | leaq stderr_GOTPCREL_external(%rip), %rax |
| 60 | addq (%rax), %rax |
| 61 | movq (%rax), %rax |
| 62 | popf |
Robert Sloan | 2e9e66a | 2017-09-25 09:08:29 -0700 | [diff] [blame] | 63 | vmovq %rax, %xmm0 |
Robert Sloan | 8ff0355 | 2017-06-14 12:40:58 -0700 | [diff] [blame] | 64 | popq %rax |
| 65 | leaq 128(%rsp), %rsp |
| 66 | # WAS vmovq foo@GOTPCREL(%rip), %xmm0 |
| 67 | leaq -128(%rsp), %rsp |
| 68 | pushq %rax |
| 69 | leaq .Lfoo_local_target(%rip), %rax |
Robert Sloan | 2e9e66a | 2017-09-25 09:08:29 -0700 | [diff] [blame] | 70 | vmovq %rax, %xmm0 |
Robert Sloan | 8ff0355 | 2017-06-14 12:40:58 -0700 | [diff] [blame] | 71 | popq %rax |
| 72 | leaq 128(%rsp), %rsp |
| 73 | |
| 74 | # WAS cmoveq stderr@GOTPCREL(%rip), %r11 |
| 75 | jne 999f |
| 76 | leaq -128(%rsp), %rsp |
| 77 | pushf |
| 78 | leaq stderr_GOTPCREL_external(%rip), %r11 |
| 79 | addq (%r11), %r11 |
| 80 | movq (%r11), %r11 |
| 81 | popf |
| 82 | leaq 128(%rsp), %rsp |
| 83 | 999: |
| 84 | # WAS cmoveq foo@GOTPCREL(%rip), %r11 |
| 85 | jne 999f |
| 86 | leaq .Lfoo_local_target(%rip), %r11 |
| 87 | 999: |
| 88 | # WAS cmovneq stderr@GOTPCREL(%rip), %r11 |
| 89 | je 999f |
| 90 | leaq -128(%rsp), %rsp |
| 91 | pushf |
| 92 | leaq stderr_GOTPCREL_external(%rip), %r11 |
| 93 | addq (%r11), %r11 |
| 94 | movq (%r11), %r11 |
| 95 | popf |
| 96 | leaq 128(%rsp), %rsp |
| 97 | 999: |
| 98 | # WAS cmovneq foo@GOTPCREL(%rip), %r11 |
| 99 | je 999f |
| 100 | leaq .Lfoo_local_target(%rip), %r11 |
| 101 | 999: |
| 102 | |
Robert Sloan | 2e9e66a | 2017-09-25 09:08:29 -0700 | [diff] [blame] | 103 | # WAS movsd foo@GOTPCREL(%rip), %xmm0 |
| 104 | leaq -128(%rsp), %rsp |
| 105 | pushq %rax |
| 106 | leaq .Lfoo_local_target(%rip), %rax |
| 107 | movq %rax, %xmm0 |
| 108 | popq %rax |
| 109 | leaq 128(%rsp), %rsp |
| 110 | # WAS vmovsd foo@GOTPCREL(%rip), %xmm0 |
| 111 | leaq -128(%rsp), %rsp |
| 112 | pushq %rax |
| 113 | leaq .Lfoo_local_target(%rip), %rax |
| 114 | vmovq %rax, %xmm0 |
| 115 | popq %rax |
| 116 | leaq 128(%rsp), %rsp |
| 117 | |
| 118 | # movsd without arguments should be left as-is. |
| 119 | movsd |
| 120 | |
Robert Sloan | 8ff0355 | 2017-06-14 12:40:58 -0700 | [diff] [blame] | 121 | # Synthesized symbols do not use the GOT. |
| 122 | # WAS movq BORINGSSL_bcm_text_start@GOTPCREL(%rip), %r11 |
| 123 | leaq BORINGSSL_bcm_text_start(%rip), %r11 |
| 124 | # WAS movq foobar_bss_get@GOTPCREL(%rip), %r11 |
| 125 | leaq foobar_bss_get(%rip), %r11 |
| 126 | # WAS movq OPENSSL_ia32cap_get@GOTPCREL(%rip), %r11 |
| 127 | leaq OPENSSL_ia32cap_get(%rip), %r11 |
| 128 | |
Robert Sloan | 0da4395 | 2018-01-03 15:13:14 -0800 | [diff] [blame] | 129 | # Transforming moves run the transform in-place after the load. |
| 130 | # WAS vpbroadcastq stderr@GOTPCREL(%rip), %xmm0 |
| 131 | leaq -128(%rsp), %rsp |
| 132 | pushq %rax |
| 133 | pushf |
| 134 | leaq stderr_GOTPCREL_external(%rip), %rax |
| 135 | addq (%rax), %rax |
| 136 | movq (%rax), %rax |
| 137 | popf |
| 138 | vmovq %rax, %xmm0 |
| 139 | popq %rax |
| 140 | leaq 128(%rsp), %rsp |
| 141 | vpbroadcastq %xmm0, %xmm0 |
| 142 | # WAS vpbroadcastq foo@GOTPCREL(%rip), %xmm0 |
| 143 | leaq -128(%rsp), %rsp |
| 144 | pushq %rax |
| 145 | leaq .Lfoo_local_target(%rip), %rax |
| 146 | vmovq %rax, %xmm0 |
| 147 | popq %rax |
| 148 | leaq 128(%rsp), %rsp |
| 149 | vpbroadcastq %xmm0, %xmm0 |
| 150 | |
Robert Sloan | 8ff0355 | 2017-06-14 12:40:58 -0700 | [diff] [blame] | 151 | .comm foobar,64,32 |
| 152 | .text |
Robert Sloan | 5cbb5c8 | 2018-04-24 11:35:46 -0700 | [diff] [blame^] | 153 | .loc 1 2 0 |
Robert Sloan | 8ff0355 | 2017-06-14 12:40:58 -0700 | [diff] [blame] | 154 | BORINGSSL_bcm_text_end: |
| 155 | .type foobar_bss_get, @function |
| 156 | foobar_bss_get: |
| 157 | leaq foobar(%rip), %rax |
| 158 | ret |
| 159 | .type stderr_GOTPCREL_external, @object |
| 160 | .size stderr_GOTPCREL_external, 8 |
| 161 | stderr_GOTPCREL_external: |
| 162 | .long stderr@GOTPCREL |
| 163 | .long 0 |
| 164 | .type OPENSSL_ia32cap_get, @function |
| 165 | OPENSSL_ia32cap_get: |
| 166 | leaq OPENSSL_ia32cap_P(%rip), %rax |
| 167 | ret |
| 168 | .extern OPENSSL_ia32cap_P |
| 169 | .type OPENSSL_ia32cap_addr_delta, @object |
| 170 | .size OPENSSL_ia32cap_addr_delta, 8 |
| 171 | OPENSSL_ia32cap_addr_delta: |
| 172 | .quad OPENSSL_ia32cap_P-OPENSSL_ia32cap_addr_delta |
| 173 | .type BORINGSSL_bcm_text_hash, @object |
| 174 | .size BORINGSSL_bcm_text_hash, 64 |
| 175 | BORINGSSL_bcm_text_hash: |
| 176 | .byte 0xae |
| 177 | .byte 0x2c |
| 178 | .byte 0xea |
| 179 | .byte 0x2a |
| 180 | .byte 0xbd |
| 181 | .byte 0xa6 |
| 182 | .byte 0xf3 |
| 183 | .byte 0xec |
| 184 | .byte 0x97 |
| 185 | .byte 0x7f |
| 186 | .byte 0x9b |
| 187 | .byte 0xf6 |
| 188 | .byte 0x94 |
| 189 | .byte 0x9a |
| 190 | .byte 0xfc |
| 191 | .byte 0x83 |
| 192 | .byte 0x68 |
| 193 | .byte 0x27 |
| 194 | .byte 0xcb |
| 195 | .byte 0xa0 |
| 196 | .byte 0xa0 |
| 197 | .byte 0x9f |
| 198 | .byte 0x6b |
| 199 | .byte 0x6f |
| 200 | .byte 0xde |
| 201 | .byte 0x52 |
| 202 | .byte 0xcd |
| 203 | .byte 0xe2 |
| 204 | .byte 0xcd |
| 205 | .byte 0xff |
| 206 | .byte 0x31 |
| 207 | .byte 0x80 |
| 208 | .byte 0xa2 |
| 209 | .byte 0xd4 |
| 210 | .byte 0xc3 |
| 211 | .byte 0x66 |
| 212 | .byte 0xf |
| 213 | .byte 0xc2 |
| 214 | .byte 0x6a |
| 215 | .byte 0x7b |
| 216 | .byte 0xf4 |
| 217 | .byte 0xbe |
| 218 | .byte 0x39 |
| 219 | .byte 0xa2 |
| 220 | .byte 0xd7 |
| 221 | .byte 0x25 |
| 222 | .byte 0xdb |
| 223 | .byte 0x21 |
| 224 | .byte 0x98 |
| 225 | .byte 0xe9 |
| 226 | .byte 0xd5 |
| 227 | .byte 0x53 |
| 228 | .byte 0xbf |
| 229 | .byte 0x5c |
| 230 | .byte 0x32 |
| 231 | .byte 0x6 |
| 232 | .byte 0x83 |
| 233 | .byte 0x34 |
| 234 | .byte 0xc |
| 235 | .byte 0x65 |
| 236 | .byte 0x89 |
| 237 | .byte 0x52 |
| 238 | .byte 0xbd |
| 239 | .byte 0x1f |