From 3cf6590e9b2b978b44c38897634f84fbf167db4f Mon Sep 17 00:00:00 2001 From: markus <> Date: Tue, 18 Nov 2003 12:39:05 +0000 Subject: 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 support to x86unix.pl tested by: nick (on 30386), henning, djm, tedu, jmc and more; no shlib minor crank necessary, only internal symbols changed. --- src/lib/libcrypto/perlasm/x86unix.pl | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'src/lib/libcrypto/perlasm/x86unix.pl') diff --git a/src/lib/libcrypto/perlasm/x86unix.pl b/src/lib/libcrypto/perlasm/x86unix.pl index 10b669bf04..53ad5f4927 100644 --- a/src/lib/libcrypto/perlasm/x86unix.pl +++ b/src/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 \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"); -- cgit v1.2.3-55-g6feb