Solaris x86_64 /usr/ccs/bin/as support.
[openssl.git] / crypto / perlasm / x86_64-xlate.pl
index 7487249c7922fef0380d49b17054ab151aca0e07..ef1a4ce6568556c9cc0e3c6caf2d963e121e3776 100755 (executable)
@@ -168,6 +168,10 @@ my $current_function;
            # on pros side, this results in more compact code:-)
            $self->{index} =~ s/^[er](.?[0-9xp])[d]?$/r\1/;
            $self->{base}  =~ s/^[er](.?[0-9xp])[d]?$/r\1/;
+           # Solaris /usr/ccs/bin/as can't handle multiplications
+           # in $self->{label}
+           $self->{label} =~ s/(?<![0-9a-f])(0[x0-9a-f]+)/oct($1)/eg;
+           $self->{label} =~ s/([0-9]+\s*[\*\/\%]\s*[0-9]+)/eval($1)/eg;
 
            if (defined($self->{index})) {
                sprintf "%s(%%%s,%%%s,%d)",
@@ -325,12 +329,12 @@ my $current_function;
            undef $self->{value};
            $line = substr($line,@+[0]); $line =~ s/^\s+//;
            SWITCH: for ($dir) {
-               /\.(text|data)/
+               /\.(text)/
                            && do { my $v=undef;
                                    $v="$current_segment\tENDS\n" if ($current_segment);
-                                   $current_segment = "_$1";
+                                   $current_segment = "_$1\$";
                                    $current_segment =~ tr/[a-z]/[A-Z]/;
-                                   $v.="$current_segment\tSEGMENT PARA";
+                                   $v.="$current_segment\tSEGMENT ALIGN(64) 'CODE'";
                                    $self->{value} = $v;
                                    last;
                                  };