another fix for the debug print
[openssl.git] / crypto / perlasm / x86unix.pl
index bb9c6925d8d8ec62d01e1ce58452f3412303817a..573d4f1126e95cb939832a9f2da0eb1f2b9499ec 100644 (file)
@@ -164,6 +164,8 @@ sub main'dec        { &out1("decl",@_); }
 sub main'inc   { &out1("incl",@_); }
 sub main'push  { &out1("pushl",@_); $stack+=4; }
 sub main'pop   { &out1("popl",@_); $stack-=4; }
+sub main'pushf { &out0("pushf"); $stack+=4; }
+sub main'popf  { &out0("popf"); $stack-=4; }
 sub main'not   { &out1("notl",@_); }
 sub main'call  { &out1("call",$under.$_[0]); }
 sub main'ret   { &out0("ret"); }
@@ -343,11 +345,9 @@ sub main'function_end
        popl    %ebx
        popl    %ebp
        ret
-$const
 .${func}_end:
 EOF
        push(@out,$tmp);
-       $const="";
 
        if ($main'cpp)
                { push(@out,"\tSIZE($func,.${func}_end-$func)\n"); }
@@ -458,6 +458,12 @@ sub main'set_label
 
 sub main'file_end
        {
+       if ($const ne "")
+               {
+               push(@out,".section .rodata\n");
+               push(@out,$const);
+               $const="";
+               }
        }
 
 sub main'data_word
@@ -523,6 +529,7 @@ sub main'printf
 
 sub pushvars
        {
+       &main'pushf();
        &main'push("edx");
        &main'push("ecx");
        &main'push("eax");
@@ -533,4 +540,5 @@ sub popvars
        &main'pop("eax");
        &main'pop("ecx");
        &main'pop("edx");
+       &main'popf();
        }