diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2012-10-31 11:19:36 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2012-10-31 11:19:36 +0000 |
commit | e9123c28fb112aaa647a23970595eea75d28caed (patch) | |
tree | 53b7fe780d6452617762e04837e5262ae2aceb52 /lib | |
parent | d096aaa081201fe91572dfcb077bd4341cc183ae (diff) |
On amd64 OPENSSL_cpuid_setup and OPENSSL_ia32cap_P are now hidden so we don't
have to go through the PLT/GOT to get at them anymore. In fact going through
the GOT now fails since we no longer have a GOT entry for OPENSSL_ia32cap_P.
Fixes the problem spotted by jasper@ and sthen@. Based on a diff from mikeb@
who did most of the actual work of tracking down the issue.
ok millert@, mikeb@
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/libssl/src/crypto/aes/asm/aes-x86_64.pl | 2 | ||||
-rwxr-xr-x | lib/libssl/src/crypto/perlasm/x86_64-xlate.pl | 5 | ||||
-rwxr-xr-x | lib/libssl/src/crypto/rc4/asm/rc4-x86_64.pl | 4 | ||||
-rw-r--r-- | lib/libssl/src/crypto/x86_64cpuid.pl | 3 |
4 files changed, 5 insertions, 9 deletions
diff --git a/lib/libssl/src/crypto/aes/asm/aes-x86_64.pl b/lib/libssl/src/crypto/aes/asm/aes-x86_64.pl index 027b4ae2e5c..48fa857d5b1 100755 --- a/lib/libssl/src/crypto/aes/asm/aes-x86_64.pl +++ b/lib/libssl/src/crypto/aes/asm/aes-x86_64.pl @@ -1678,7 +1678,7 @@ AES_cbc_encrypt: lea .LAES_Td(%rip),$sbox .Lcbc_picked_te: - mov PIC_GOT(OPENSSL_ia32cap_P),%r10d + mov OPENSSL_ia32cap_P(%rip),%r10d cmp \$$speed_limit,%rdx jb .Lcbc_slow_prologue test \$15,%rdx diff --git a/lib/libssl/src/crypto/perlasm/x86_64-xlate.pl b/lib/libssl/src/crypto/perlasm/x86_64-xlate.pl index 50ff91e2f0f..56d9b64b6fb 100755 --- a/lib/libssl/src/crypto/perlasm/x86_64-xlate.pl +++ b/lib/libssl/src/crypto/perlasm/x86_64-xlate.pl @@ -215,8 +215,7 @@ my %globals; undef $ret; # optional * ---vvv--- appears in indirect jmp/call - if ($line =~ /^(\*?)([^\(,]*)\(([%\w,]+)\)/ && - !($line =~ /^PIC_(GOT|PLT)/)) { + if ($line =~ /^(\*?)([^\(,]*)\(([%\w,]+)\)/) { $self->{asterisk} = $1; $self->{label} = $2; ($self->{base},$self->{index},$self->{scale})=split(/,/,$3); @@ -773,8 +772,6 @@ my $rdrand = sub { } }; -print "#include <machine/asm.h>\n"; - if ($nasm) { print <<___; default rel diff --git a/lib/libssl/src/crypto/rc4/asm/rc4-x86_64.pl b/lib/libssl/src/crypto/rc4/asm/rc4-x86_64.pl index ac2c05074e6..d6eac205e98 100755 --- a/lib/libssl/src/crypto/rc4/asm/rc4-x86_64.pl +++ b/lib/libssl/src/crypto/rc4/asm/rc4-x86_64.pl @@ -442,7 +442,7 @@ private_RC4_set_key: xor %r10,%r10 xor %r11,%r11 - mov PIC_GOT(OPENSSL_ia32cap_P),$idx#d + mov OPENSSL_ia32cap_P(%rip),$idx#d bt \$20,$idx#d # RC4_CHAR? jc .Lc1stloop jmp .Lw1stloop @@ -506,7 +506,7 @@ private_RC4_set_key: .align 16 RC4_options: lea .Lopts(%rip),%rax - mov PIC_GOT(OPENSSL_ia32cap_P),%edx + mov OPENSSL_ia32cap_P(%rip),%edx bt \$20,%edx jc .L8xchar bt \$30,%edx diff --git a/lib/libssl/src/crypto/x86_64cpuid.pl b/lib/libssl/src/crypto/x86_64cpuid.pl index 58e9bedcf0c..7b7b93b2232 100644 --- a/lib/libssl/src/crypto/x86_64cpuid.pl +++ b/lib/libssl/src/crypto/x86_64cpuid.pl @@ -17,11 +17,10 @@ open STDOUT,"| $^X $xlate $flavour $output"; ("%rdi","%rsi","%rdx","%rcx"); # Unix order print<<___; -#include <machine/asm.h> .extern OPENSSL_cpuid_setup .hidden OPENSSL_cpuid_setup .section .init - call PIC_PLT(OPENSSL_cpuid_setup) + call OPENSSL_cpuid_setup .hidden OPENSSL_ia32cap_P .comm OPENSSL_ia32cap_P,8,4 |