perlasm/x86_64-xlate.pl: handle binary constants early.
authorAndy Polyakov <appro@openssl.org>
Fri, 4 Mar 2016 10:32:26 +0000 (11:32 +0100)
committerAndy Polyakov <appro@openssl.org>
Mon, 7 Mar 2016 14:03:04 +0000 (15:03 +0100)
Not all assemblers of "gas" flavour handle binary constants, e.g.
seasoned MacOS Xcode doesn't, so give them a hand.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(cherry picked from commit 6e42e3ff9cde43830555549fdafa2a8b37b9485b)

crypto/perlasm/x86_64-xlate.pl

index ee04221c7e1da73f94c0d232168ca75a5499f91e..7a3dd04b0f9d7f1a0a3c649b917391751f908582 100755 (executable)
@@ -195,6 +195,7 @@ my %globals;
     sub out {
        my $self = shift;
 
+       $self->{value} =~ s/\b(0b[0-1]+)/oct($1)/eig;
        if ($gas) {
            # Solaris /usr/ccs/bin/as can't handle multiplications
            # in $self->{value}
@@ -205,7 +206,6 @@ my %globals;
            }
            sprintf "\$%s",$self->{value};
        } else {
-           $self->{value} =~ s/(0b[0-1]+)/oct($1)/eig;
            $self->{value} =~ s/0x([0-9a-f]+)/0$1h/ig if ($masm);
            sprintf "%s",$self->{value};
        }