summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src/crypto/perlasm/x86unix.pl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libssl/src/crypto/perlasm/x86unix.pl')
-rw-r--r--lib/libssl/src/crypto/perlasm/x86unix.pl35
1 files changed, 33 insertions, 2 deletions
diff --git a/lib/libssl/src/crypto/perlasm/x86unix.pl b/lib/libssl/src/crypto/perlasm/x86unix.pl
index 10b669bf049..53ad5f49279 100644
--- a/lib/libssl/src/crypto/perlasm/x86unix.pl
+++ b/lib/libssl/src/crypto/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");