X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fperlasm%2Fppc-xlate.pl;h=fed56e3772a3fa0a0a2c5b62e6ef57a2ba1c0006;hp=a3b5b0e37bcc9c9fdf43e92e4cf84aa8824f488a;hb=287a9ee76e9c4ba871d734eec054a9d7697544a1;hpb=67d990904ea0ddc54ac5794f658effd98e8f0b15 diff --git a/crypto/perlasm/ppc-xlate.pl b/crypto/perlasm/ppc-xlate.pl index a3b5b0e37b..fed56e3772 100755 --- a/crypto/perlasm/ppc-xlate.pl +++ b/crypto/perlasm/ppc-xlate.pl @@ -7,7 +7,7 @@ open STDOUT,">$output" || die "can't open $output: $!"; my $flavour = $output; my %GLOBALS; -my $dotinlocallabels=0; +my $dotinlocallabels=($flavour=~/linux/)?1:0; ################################################################ # directives which need special treatment on different platforms @@ -29,7 +29,6 @@ my $globl = sub { }; /linux.*32/ && do { $ret .= ".globl $name\n"; $ret .= ".type $name,\@function"; - $dotinlocallabels = 1; last; }; /linux.*64/ && do { $ret .= ".globl .$name\n"; @@ -43,7 +42,6 @@ my $globl = sub { $ret .= ".previous\n"; $name = ".$name"; - $dotinlocallabels = 1; last; }; } @@ -64,6 +62,14 @@ my $machine = sub { } ".machine $arch"; }; +my $asciz = sub { + shift; + my $line = join(",",@_); + if ($line =~ /^"(.*)"$/) + { ".byte " . join(",",unpack("C*",$1),0) . "\n.align 2"; } + else + { ""; } +}; ################################################################ # simplified mnemonics not handled by at least one assembler @@ -106,7 +112,7 @@ while($line=<>) { my $mnemonic = $2; my $f = $3; my $opcode = eval("\$$mnemonic"); - $line =~ s|\br([0-9]+)\b|$1|g if ($c ne "." and $flavour !~ /osx/); + $line =~ s|\bc?r([0-9]+)\b|$1|g if ($c ne "." and $flavour !~ /osx/); if (ref($opcode) eq 'CODE') { $line = &$opcode($f,split(',',$line)); } elsif ($mnemonic) { $line = $c.$mnemonic.$f."\t".$line; } }