summaryrefslogtreecommitdiffstats
path: root/crypto/perlasm/x86_64-xlate.pl
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2009-11-15 17:11:38 +0000
committerAndy Polyakov <appro@openssl.org>2009-11-15 17:11:38 +0000
commit10232bdc0e28b5417051942fe57fa14d17e104a6 (patch)
tree2dc90cca0db930678fd5a3cf917d376fa147ae18 /crypto/perlasm/x86_64-xlate.pl
parent55ff3aff8c3b5474bdd4484b75a181ba07556cb1 (diff)
x86_64-xlate.pl: new gas requires sign extention in lea instruction.
This resolves md5-x86_64.pl and sha1-x86_64.pl bugs, but without modifying the code. PR: 2094,2095
Diffstat (limited to 'crypto/perlasm/x86_64-xlate.pl')
-rwxr-xr-xcrypto/perlasm/x86_64-xlate.pl5
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl
index c09c3216ad..25f8c4e83f 100755
--- a/crypto/perlasm/x86_64-xlate.pl
+++ b/crypto/perlasm/x86_64-xlate.pl
@@ -241,8 +241,9 @@ my %globals;
if ($gas) {
# Solaris /usr/ccs/bin/as can't handle multiplications
- # in $self->{label}
- $self->{label} =~ s/(?<![0-9a-f])(0[x0-9a-f]+)/oct($1)/egi;
+ # in $self->{label}, new gas requires sign extension...
+ use integer;
+ $self->{label} =~ s/(?<![0-9a-f])(0[x0-9a-f]+)/oct($1)<<32>>32/egi;
$self->{label} =~ s/([0-9]+\s*[\*\/\%]\s*[0-9]+)/eval($1)/eg;
$self->{label} =~ s/^___imp_/__imp__/ if ($flavour eq "mingw64");