From: Andy Polyakov Date: Sat, 14 Dec 2002 17:54:30 +0000 (+0000) Subject: DES PIC-ification. Windows companion. X-Git-Tag: OpenSSL_0_9_7-beta6~18^2~1 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=270fa8aedae8595f9c95a03f019b69cffc31baee;p=oweals%2Fopenssl.git DES PIC-ification. Windows companion. --- diff --git a/crypto/perlasm/x86ms.pl b/crypto/perlasm/x86ms.pl index 5229afeb64..abcb7c1303 100644 --- a/crypto/perlasm/x86ms.pl +++ b/crypto/perlasm/x86ms.pl @@ -92,6 +92,8 @@ sub get_mem $addr="_$addr"; } + if ($addr =~ /^.+\-.+$/) { $addr="($addr)"; } + $reg1="$regs{$reg1}" if defined($regs{$reg1}); $reg2="$regs{$reg2}" if defined($regs{$reg2}); if (($addr ne "") && ($addr ne 0)) @@ -111,6 +113,7 @@ sub get_mem { $ret.="[$reg1$post]" } + $ret =~ s/\[\]//; # in case $addr was the only argument return($ret); } @@ -151,7 +154,7 @@ sub main'push { &out1("push",@_); $stack+=4; } sub main'pop { &out1("pop",@_); $stack-=4; } sub main'bswap { &out1("bswap",@_); &using486(); } sub main'not { &out1("not",@_); } -sub main'call { &out1("call",'_'.$_[0]); } +sub main'call { &out1("call",($_[0]=~/^\$L/?'':'_').$_[0]); } sub main'ret { &out0("ret"); } sub main'nop { &out0("nop"); } @@ -338,7 +341,7 @@ sub main'set_label { if (!defined($label{$_[0]})) { - $label{$_[0]}="${label}${_[0]}"; + $label{$_[0]}="\$${label}${_[0]}"; $label++; } if((defined $_[2]) && ($_[2] == 1)) diff --git a/crypto/perlasm/x86nasm.pl b/crypto/perlasm/x86nasm.pl index 819151c6bc..85cb3885ec 100644 --- a/crypto/perlasm/x86nasm.pl +++ b/crypto/perlasm/x86nasm.pl @@ -98,6 +98,8 @@ sub get_mem $addr="_$addr"; } + if ($addr =~ /^.+\-.+$/) { $addr="($addr)"; } + $reg1="$regs{$reg1}" if defined($regs{$reg1}); $reg2="$regs{$reg2}" if defined($regs{$reg2}); if (($addr ne "") && ($addr ne 0)) @@ -117,6 +119,7 @@ sub get_mem { $ret.="$reg1$post]" } + $ret =~ s/\+\]/]/; # in case $addr was the only argument return($ret); } @@ -160,7 +163,7 @@ sub main'push { &out1("push",@_); $stack+=4; } sub main'pop { &out1("pop",@_); $stack-=4; } sub main'bswap { &out1("bswap",@_); &using486(); } sub main'not { &out1("not",@_); } -sub main'call { &out1("call",'_'.$_[0]); } +sub main'call { &out1("call",($_[0]=~/^\.L/?'':'_').$_[0]); } sub main'ret { &out0("ret"); } sub main'nop { &out0("nop"); } @@ -312,7 +315,7 @@ sub main'label { if (!defined($label{$_[0]})) { - $label{$_[0]}="\$${label}${_[0]}"; + $label{$_[0]}=".${label}${_[0]}"; $label++; } return($label{$_[0]}); @@ -322,7 +325,7 @@ sub main'set_label { if (!defined($label{$_[0]})) { - $label{$_[0]}="${label}${_[0]}"; + $label{$_[0]}=".${label}${_[0]}"; $label++; } push(@out,"$label{$_[0]}:\n");