perlasm update: implement dataseg directive.
authorAndy Polyakov <appro@openssl.org>
Tue, 22 Jul 2008 08:44:31 +0000 (08:44 +0000)
committerAndy Polyakov <appro@openssl.org>
Tue, 22 Jul 2008 08:44:31 +0000 (08:44 +0000)
crypto/perlasm/x86gas.pl
crypto/perlasm/x86masm.pl
crypto/perlasm/x86nasm.pl

index 5347bf80a03c5501a781684c7645c39a2c5fbe6c..9969d382cf51982835c7c49673f7cef448ebbe6b 100644 (file)
@@ -124,7 +124,7 @@ sub ::function_begin_B
 
     push(@out,".globl\t$func\n")       if ($global);
     if ($::coff)
-    {  push(@out,".def\t$func;\t.scl\t2;\t.type\t32;\t.endef\n"); }
+    {  push(@out,".def\t$func;\t.scl\t".(3-$global).";\t.type\t32;\t.endef\n"); }
     elsif (($::aout and !$::pic) or $::macosx)
     { }
     else
@@ -258,4 +258,7 @@ ___
     }
 }
 
+sub ::dataseg
+{   push(@out,".data\n");   }
+
 1;
index 98845fab6583a7dac06a550fc12a70051b1a6ab5..cde38a11a40063303d2bec8761cb6044d5f0af09 100644 (file)
@@ -8,6 +8,7 @@ $::lbdecor="\$L";       # local label decoration
 $nmdecor="_";          # external name decoration
 
 $initseg="";
+$segment="";
 
 sub ::generic
 { my ($opcode,@arg)=@_;
@@ -84,6 +85,7 @@ ELSE
 ENDIF
 ___
     push(@out,$tmp);
+    $segment = ".text\$";
 }
 
 sub ::function_begin_B
@@ -121,7 +123,7 @@ ___
        grep {s/\.[3-7]86/$xmmheader/} @out;
     }
 
-    push(@out,".text\$ ENDS\n");
+    push(@out,"$segment        ENDS\n");
 
     if (grep {/\b${nmdecor}OPENSSL_ia32cap_P\b/i} @out)
     {  my $comm=<<___;
@@ -175,4 +177,7 @@ DD  $f
 ___
 }
 
+sub ::dataseg
+{   push(@out,"$segment\tENDS\n_DATA\tSEGMENT\n"); $segment="_DATA";   }
+
 1;
index dadbfe0c2cce16e25be3714e6355682e51b91979..ce2bed9bb290dc4393dfa0b8724acfc58eba98b7 100644 (file)
@@ -158,4 +158,9 @@ ___
     }
 }
 
+sub ::dataseg
+{   if ($mwerks)       { push(@out,".section\t.data,4\n");   }
+    else               { push(@out,"section\t.data align=4\n"); }
+}
+
 1;