diff options
author | 2003-11-18 12:39:05 +0000 | |
---|---|---|
committer | 2003-11-18 12:39:05 +0000 | |
commit | e280eb565d60f596dcccee6bf150f7eca4c0b64e (patch) | |
tree | 1ba38db9b7f1efe80d64024f3975753b4d2fc419 /lib/libcrypto/perlasm/x86unix.pl | |
parent | unbreak fake authloop for non-existent users (my screwup). Spotted and (diff) | |
download | wireguard-openbsd-e280eb565d60f596dcccee6bf150f7eca4c0b64e.tar.xz wireguard-openbsd-e280eb565d60f596dcccee6bf150f7eca4c0b64e.zip |
use bn_asm_vax.S (from netbsd); test + ok by miod
use asm code for i386, except for the CBC code, because
it is not clean PIC code.
add <machime/asm.h> support to x86unix.pl
tested by: nick (on 30386), henning, djm, tedu, jmc and more;
no shlib minor crank necessary, only internal symbols changed.
Diffstat (limited to 'lib/libcrypto/perlasm/x86unix.pl')
-rw-r--r-- | lib/libcrypto/perlasm/x86unix.pl | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/lib/libcrypto/perlasm/x86unix.pl b/lib/libcrypto/perlasm/x86unix.pl index 10b669bf049..53ad5f49279 100644 --- a/lib/libcrypto/perlasm/x86unix.pl +++ b/lib/libcrypto/perlasm/x86unix.pl @@ -15,6 +15,12 @@ sub main'asm_get_output { return(@out); } sub main'get_labels { return(@labels); } sub main'external_label { push(@labels,@_); } +if ($main'openbsd) + { + $com_start='/*'; + $com_end='*/'; + } + if ($main'cpp) { $align="ALIGN"; @@ -276,6 +282,9 @@ sub main'file { local($file)=@_; + if ($main'openbsd) + { push(@out,"#include <machine/asm.h>\n"); return; } + local($tmp)=<<"EOF"; .file "$file.s" .version "01.01" @@ -291,6 +300,9 @@ sub main'function_begin &main'external_label($func); $func=$under.$func; + if ($main'openbsd) + { push (@out, "\nENTRY($func)\n"); goto skip; } + local($tmp)=<<"EOF"; .text .align $align @@ -303,6 +315,7 @@ EOF { $tmp=push(@out,"\t.def\t$func;\t.scl\t2;\t.type\t32;\t.endef\n"); } else { $tmp=push(@out,"\t.type\t$func,\@function\n"); } push(@out,"$func:\n"); +skip: $tmp=<<"EOF"; pushl %ebp pushl %ebx @@ -321,6 +334,9 @@ sub main'function_begin_B &main'external_label($func); $func=$under.$func; + if ($main'openbsd) + { push(@out, "\nENTRY($func)\n"); goto skip; } + local($tmp)=<<"EOF"; .text .align $align @@ -333,6 +349,7 @@ EOF { $tmp=push(@out,"\t.def\t$func;\t.scl\t2;\t.type\t32;\t.endef\n"); } else { push(@out,"\t.type $func,\@function\n"); } push(@out,"$func:\n"); +skip: $stack=4; } @@ -429,7 +446,8 @@ sub main'swtmp sub main'comment { - if ($main'elf) # GNU and SVR4 as'es use different comment delimiters, + if (!$main'openbsd && $main'elf) + # GNU and SVR4 as'es use different comment delimiters, { # so we just skip comments... push(@out,"\n"); return; @@ -460,7 +478,10 @@ sub main'set_label $label{$_[0]}=".${label}${_[0]}"; $label++; } - push(@out,".align $align\n") if ($_[1] != 0); + if ($main'openbsd) + { push(@out,"_ALIGN_TEXT\n") if ($_[1] != 0); } + else + { push(@out,".align $align\n") if ($_[1] != 0); } push(@out,"$label{$_[0]}:\n"); } @@ -569,6 +590,16 @@ sub main'picmeup ___ push(@out,$tmp); } + elsif ($main'openbsd) + { + push(@out, "#ifdef PIC\n"); + push(@out, "\tPIC_PROLOGUE\n"); + &main'mov($dst,"PIC_GOT($sym)"); + push(@out, "\tPIC_EPILOGUE\n"); + push(@out, "#else\n"); + &main'lea($dst,&main'DWP($sym)); + push(@out, "#endif\n"); + } elsif ($main'pic && ($main'elf || $main'aout)) { push(@out,"\t.align\t8\n"); |