Home | History | Annotate | Download | only in x86_64-GOTRewrite
      1 .text
      2 BORINGSSL_bcm_text_start:
      3 	.text
      4 .Lfoo_local_target:
      5 foo:
      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 	vmovq %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 	vmovq %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
     81 999:
     82 # WAS cmoveq foo@GOTPCREL(%rip), %r11
     83 	jne 999f
     84 	leaq	.Lfoo_local_target(%rip), %r11
     85 999:
     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
     95 999:
     96 # WAS cmovneq foo@GOTPCREL(%rip), %r11
     97 	je 999f
     98 	leaq	.Lfoo_local_target(%rip), %r11
     99 999:
    100 
    101 # WAS movsd foo@GOTPCREL(%rip), %xmm0
    102 	leaq -128(%rsp), %rsp
    103 	pushq %rax
    104 	leaq	.Lfoo_local_target(%rip), %rax
    105 	movq %rax, %xmm0
    106 	popq %rax
    107 	leaq 128(%rsp), %rsp
    108 # WAS vmovsd foo@GOTPCREL(%rip), %xmm0
    109 	leaq -128(%rsp), %rsp
    110 	pushq %rax
    111 	leaq	.Lfoo_local_target(%rip), %rax
    112 	vmovq %rax, %xmm0
    113 	popq %rax
    114 	leaq 128(%rsp), %rsp
    115 
    116 	# movsd without arguments should be left as-is.
    117 	movsd
    118 
    119 	# Synthesized symbols do not use the GOT.
    120 # WAS movq BORINGSSL_bcm_text_start@GOTPCREL(%rip), %r11
    121 	leaq	BORINGSSL_bcm_text_start(%rip), %r11
    122 # WAS movq foobar_bss_get@GOTPCREL(%rip), %r11
    123 	leaq	foobar_bss_get(%rip), %r11
    124 # WAS movq OPENSSL_ia32cap_get@GOTPCREL(%rip), %r11
    125 	leaq	OPENSSL_ia32cap_get(%rip), %r11
    126 
    127 	# Transforming moves run the transform in-place after the load.
    128 # WAS vpbroadcastq stderr@GOTPCREL(%rip), %xmm0
    129 	leaq -128(%rsp), %rsp
    130 	pushq %rax
    131 	pushf
    132 	leaq stderr_GOTPCREL_external(%rip), %rax
    133 	addq (%rax), %rax
    134 	movq (%rax), %rax
    135 	popf
    136 	vmovq %rax, %xmm0
    137 	popq %rax
    138 	leaq 128(%rsp), %rsp
    139 	vpbroadcastq %xmm0, %xmm0
    140 # WAS vpbroadcastq foo@GOTPCREL(%rip), %xmm0
    141 	leaq -128(%rsp), %rsp
    142 	pushq %rax
    143 	leaq	.Lfoo_local_target(%rip), %rax
    144 	vmovq %rax, %xmm0
    145 	popq %rax
    146 	leaq 128(%rsp), %rsp
    147 	vpbroadcastq %xmm0, %xmm0
    148 
    149 .comm foobar,64,32
    150 .text
    151 BORINGSSL_bcm_text_end:
    152 .type foobar_bss_get, @function
    153 foobar_bss_get:
    154 	leaq	foobar(%rip), %rax
    155 	ret
    156 .type stderr_GOTPCREL_external, @object
    157 .size stderr_GOTPCREL_external, 8
    158 stderr_GOTPCREL_external:
    159 	.long stderr@GOTPCREL
    160 	.long 0
    161 .type OPENSSL_ia32cap_get, @function
    162 OPENSSL_ia32cap_get:
    163 	leaq OPENSSL_ia32cap_P(%rip), %rax
    164 	ret
    165 .extern OPENSSL_ia32cap_P
    166 .type OPENSSL_ia32cap_addr_delta, @object
    167 .size OPENSSL_ia32cap_addr_delta, 8
    168 OPENSSL_ia32cap_addr_delta:
    169 .quad OPENSSL_ia32cap_P-OPENSSL_ia32cap_addr_delta
    170 .type BORINGSSL_bcm_text_hash, @object
    171 .size BORINGSSL_bcm_text_hash, 64
    172 BORINGSSL_bcm_text_hash:
    173 .byte 0xae
    174 .byte 0x2c
    175 .byte 0xea
    176 .byte 0x2a
    177 .byte 0xbd
    178 .byte 0xa6
    179 .byte 0xf3
    180 .byte 0xec
    181 .byte 0x97
    182 .byte 0x7f
    183 .byte 0x9b
    184 .byte 0xf6
    185 .byte 0x94
    186 .byte 0x9a
    187 .byte 0xfc
    188 .byte 0x83
    189 .byte 0x68
    190 .byte 0x27
    191 .byte 0xcb
    192 .byte 0xa0
    193 .byte 0xa0
    194 .byte 0x9f
    195 .byte 0x6b
    196 .byte 0x6f
    197 .byte 0xde
    198 .byte 0x52
    199 .byte 0xcd
    200 .byte 0xe2
    201 .byte 0xcd
    202 .byte 0xff
    203 .byte 0x31
    204 .byte 0x80
    205 .byte 0xa2
    206 .byte 0xd4
    207 .byte 0xc3
    208 .byte 0x66
    209 .byte 0xf
    210 .byte 0xc2
    211 .byte 0x6a
    212 .byte 0x7b
    213 .byte 0xf4
    214 .byte 0xbe
    215 .byte 0x39
    216 .byte 0xa2
    217 .byte 0xd7
    218 .byte 0x25
    219 .byte 0xdb
    220 .byte 0x21
    221 .byte 0x98
    222 .byte 0xe9
    223 .byte 0xd5
    224 .byte 0x53
    225 .byte 0xbf
    226 .byte 0x5c
    227 .byte 0x32
    228 .byte 0x6
    229 .byte 0x83
    230 .byte 0x34
    231 .byte 0xc
    232 .byte 0x65
    233 .byte 0x89
    234 .byte 0x52
    235 .byte 0xbd
    236 .byte 0x1f
    237