Add some missing cfi frame info in aesni-sha and sha-x86_64.pl
[openssl.git] / crypto / aes / asm / aesni-sha1-x86_64.pl
index b01a4c55c86aed96b54d752e2539b31ab6b5aeb6..d2c0b7271d5fde427a2df71376d7681ecf7f734b 100644 (file)
@@ -1,7 +1,7 @@
 #! /usr/bin/env perl
 # Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.
 #
-# Licensed under the OpenSSL license (the "License").  You may not use
+# Licensed under the Apache License 2.0 (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
 # (**) Execution is fully dominated by integer code sequence and
 #      SIMD still hardly shows [in single-process benchmark;-]
 
-$flavour = shift;
-$output  = shift;
-if ($flavour =~ /\./) { $output = $flavour; undef $flavour; }
+# $output is the last argument if it looks like a file (it has an extension)
+# $flavour is the first argument if it doesn't look like a file
+$output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+$flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
 
 $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/);
 
@@ -114,7 +115,8 @@ $shaext=1;  ### set to zero if compiling for 1.0.1
 
 $stitched_decrypt=0;
 
-open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\"";
+open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
+    or die "can't call $xlate: $!";
 *STDOUT=*OUT;
 
 # void aesni_cbc_sha1_enc(const void *inp,
@@ -133,6 +135,7 @@ $code.=<<___;
 .type  aesni_cbc_sha1_enc,\@abi-omnipotent
 .align 32
 aesni_cbc_sha1_enc:
+.cfi_startproc
        # caller should check for SSSE3 and AES-NI bits
        mov     OPENSSL_ia32cap_P+0(%rip),%r10d
        mov     OPENSSL_ia32cap_P+4(%rip),%r11
@@ -151,6 +154,7 @@ ___
 $code.=<<___;
        jmp     aesni_cbc_sha1_enc_ssse3
        ret
+.cfi_endproc
 .size  aesni_cbc_sha1_enc,.-aesni_cbc_sha1_enc
 ___
 
@@ -840,6 +844,7 @@ $code.=<<___;
 .type  aesni256_cbc_sha1_dec,\@abi-omnipotent
 .align 32
 aesni256_cbc_sha1_dec:
+.cfi_startproc
        # caller should check for SSSE3 and AES-NI bits
        mov     OPENSSL_ia32cap_P+0(%rip),%r10d
        mov     OPENSSL_ia32cap_P+4(%rip),%r11d
@@ -854,6 +859,7 @@ ___
 $code.=<<___;
        jmp     aesni256_cbc_sha1_dec_ssse3
        ret
+.cfi_endproc
 .size  aesni256_cbc_sha1_dec,.-aesni256_cbc_sha1_dec
 
 .type  aesni256_cbc_sha1_dec_ssse3,\@function,6
@@ -1760,6 +1766,7 @@ $code.=<<___;
 .type  aesni_cbc_sha1_enc_shaext,\@function,6
 .align 32
 aesni_cbc_sha1_enc_shaext:
+.cfi_startproc
        mov     `($win64?56:8)`(%rsp),$inp      # load 7th argument
 ___
 $code.=<<___ if ($win64);
@@ -1911,6 +1918,7 @@ $code.=<<___ if ($win64);
 ___
 $code.=<<___;
        ret
+.cfi_endproc
 .size  aesni_cbc_sha1_enc_shaext,.-aesni_cbc_sha1_enc_shaext
 ___
                                                }}}