perlasm/x86_64-xlate.pl: fix pair of typo-bugs in the new cfi_directive.
[openssl.git] / crypto / perlasm / arm-xlate.pl
index 22dc7e4ecc3a2b8526a8011d30038fd827ed2d92..ca2f8b990b972ceb434151e8352b9dd0345d6596 100755 (executable)
@@ -1,6 +1,12 @@
-#!/usr/bin/env perl
+#! /usr/bin/env perl
+# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the OpenSSL license (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
 
-# ARM assembler distiller by <appro>.
+use strict;
 
 my $flavour = shift;
 my $output = shift;
@@ -66,6 +72,12 @@ my $extern = sub {
 };
 my $type = sub {
     if ($flavour =~ /linux/)   { ".type\t".join(',',@_); }
+    elsif ($flavour =~ /ios32/)        { if (join(',',@_) =~ /(\w+),%function/) {
+                                       "#ifdef __thumb2__\n".
+                                       ".thumb_func    $1\n".
+                                       "#endif";
+                                 }
+                               }
     else                       { ""; }
 };
 my $size = sub {
@@ -116,7 +128,7 @@ sub expand_line {
     return $line;
 }
 
-while($line=<>) {
+while(my $line=<>) {
 
     if ($line =~ m/^\s*(#|@|\/\/)/)    { print $line; next; }
 
@@ -154,7 +166,7 @@ while($line=<>) {
                $line = &$opcode($arg);
        } elsif ($mnemonic)         {
                $line = $c.$mnemonic;
-               $line.= "\t$arg" if ($arg);
+               $line.= "\t$arg" if ($arg ne "");
        }
     }