diff options
author | 2012-10-13 21:23:32 +0000 | |
---|---|---|
committer | 2012-10-13 21:23:32 +0000 | |
commit | ec07fdf13572372e9cd617b18f2e2790e6616c8c (patch) | |
tree | bc2aaa935cf216bb82963cd07e6b9f736c4cb1e7 /lib/libssl/src/crypto/perlasm | |
parent | sync (diff) | |
download | wireguard-openbsd-ec07fdf13572372e9cd617b18f2e2790e6616c8c.tar.xz wireguard-openbsd-ec07fdf13572372e9cd617b18f2e2790e6616c8c.zip |
import OpenSSL-1.0.1c
Diffstat (limited to 'lib/libssl/src/crypto/perlasm')
-rwxr-xr-x | lib/libssl/src/crypto/perlasm/ppc-xlate.pl | 13 | ||||
-rw-r--r-- | lib/libssl/src/crypto/perlasm/x86masm.pl | 19 |
2 files changed, 26 insertions, 6 deletions
diff --git a/lib/libssl/src/crypto/perlasm/ppc-xlate.pl b/lib/libssl/src/crypto/perlasm/ppc-xlate.pl index 4579671c970..a3edd982b66 100755 --- a/lib/libssl/src/crypto/perlasm/ppc-xlate.pl +++ b/lib/libssl/src/crypto/perlasm/ppc-xlate.pl @@ -31,10 +31,9 @@ my $globl = sub { $ret .= ".type $name,\@function"; last; }; - /linux.*64/ && do { $ret .= ".globl .$name\n"; - $ret .= ".type .$name,\@function\n"; + /linux.*64/ && do { $ret .= ".globl $name\n"; + $ret .= ".type $name,\@function\n"; $ret .= ".section \".opd\",\"aw\"\n"; - $ret .= ".globl $name\n"; $ret .= ".align 3\n"; $ret .= "$name:\n"; $ret .= ".quad .$name,.TOC.\@tocbase,0\n"; @@ -62,6 +61,14 @@ my $machine = sub { } ".machine $arch"; }; +my $size = sub { + if ($flavour =~ /linux.*32/) + { shift; + ".size " . join(",",@_); + } + else + { ""; } +}; my $asciz = sub { shift; my $line = join(",",@_); diff --git a/lib/libssl/src/crypto/perlasm/x86masm.pl b/lib/libssl/src/crypto/perlasm/x86masm.pl index 3d50e4a7865..96b1b73e1a3 100644 --- a/lib/libssl/src/crypto/perlasm/x86masm.pl +++ b/lib/libssl/src/crypto/perlasm/x86masm.pl @@ -14,9 +14,11 @@ sub ::generic { my ($opcode,@arg)=@_; # fix hexadecimal constants - for (@arg) { s/0x([0-9a-f]+)/0$1h/oi; } + for (@arg) { s/(?<![\w\$\.])0x([0-9a-f]+)/0$1h/oi; } - if ($opcode !~ /movq/) + if ($opcode =~ /lea/ && @arg[1] =~ s/.*PTR\s+(\(.*\))$/OFFSET $1/) # no [] + { $opcode="mov"; } + elsif ($opcode !~ /movq/) { # fix xmm references $arg[0] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[1]=~/\bxmm[0-7]\b/i); $arg[1] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[0]=~/\bxmm[0-7]\b/i); @@ -65,6 +67,7 @@ sub get_mem $ret; } sub ::BP { &get_mem("BYTE",@_); } +sub ::WP { &get_mem("WORD",@_); } sub ::DWP { &get_mem("DWORD",@_); } sub ::QWP { &get_mem("QWORD",@_); } sub ::BC { "@_"; } @@ -129,7 +132,7 @@ ___ if (grep {/\b${nmdecor}OPENSSL_ia32cap_P\b/i} @out) { my $comm=<<___; .bss SEGMENT 'BSS' -COMM ${nmdecor}OPENSSL_ia32cap_P:DWORD +COMM ${nmdecor}OPENSSL_ia32cap_P:QWORD .bss ENDS ___ # comment out OPENSSL_ia32cap_P declarations @@ -156,6 +159,9 @@ sub ::public_label sub ::data_byte { push(@out,("DB\t").join(',',@_)."\n"); } +sub ::data_short +{ push(@out,("DW\t").join(',',@_)."\n"); } + sub ::data_word { push(@out,("DD\t").join(',',@_)."\n"); } @@ -181,4 +187,11 @@ ___ sub ::dataseg { push(@out,"$segment\tENDS\n_DATA\tSEGMENT\n"); $segment="_DATA"; } +sub ::safeseh +{ my $nm=shift; + push(@out,"IF \@Version GE 710\n"); + push(@out,".SAFESEH ".&::LABEL($nm,$nmdecor.$nm)."\n"); + push(@out,"ENDIF\n"); +} + 1; |