modes/asm/*-x86_64.pl: add CFI annotations.
[openssl.git] / crypto / modes / asm / aesni-gcm-x86_64.pl
index 5ad62b39798159b609f3f2b14bfad67236e3622b..5e69cb86fa3d0a98c63e764a8b46f95bfd1fe156 100644 (file)
@@ -424,6 +424,7 @@ $code.=<<___;
 .type  aesni_gcm_decrypt,\@function,6
 .align 32
 aesni_gcm_decrypt:
 .type  aesni_gcm_decrypt,\@function,6
 .align 32
 aesni_gcm_decrypt:
+.cfi_startproc
        xor     $ret,$ret
 
        # We call |_aesni_ctr32_ghash_6x|, which requires at least 96 (0x60)
        xor     $ret,$ret
 
        # We call |_aesni_ctr32_ghash_6x|, which requires at least 96 (0x60)
@@ -432,12 +433,19 @@ aesni_gcm_decrypt:
        jb      .Lgcm_dec_abort
 
        lea     (%rsp),%rax                     # save stack pointer
        jb      .Lgcm_dec_abort
 
        lea     (%rsp),%rax                     # save stack pointer
+.cfi_def_cfa_register  %rax
        push    %rbx
        push    %rbx
+.cfi_push      %rbx
        push    %rbp
        push    %rbp
+.cfi_push      %rbp
        push    %r12
        push    %r12
+.cfi_push      %r12
        push    %r13
        push    %r13
+.cfi_push      %r13
        push    %r14
        push    %r14
+.cfi_push      %r14
        push    %r15
        push    %r15
+.cfi_push      %r15
 ___
 $code.=<<___ if ($win64);
        lea     -0xa8(%rsp),%rsp
 ___
 $code.=<<___ if ($win64);
        lea     -0xa8(%rsp),%rsp
@@ -537,15 +545,23 @@ $code.=<<___ if ($win64);
 ___
 $code.=<<___;
        mov     -48(%rax),%r15
 ___
 $code.=<<___;
        mov     -48(%rax),%r15
+.cfi_restore   %r15
        mov     -40(%rax),%r14
        mov     -40(%rax),%r14
+.cfi_restore   %r14
        mov     -32(%rax),%r13
        mov     -32(%rax),%r13
+.cfi_restore   %r13
        mov     -24(%rax),%r12
        mov     -24(%rax),%r12
+.cfi_restore   %r12
        mov     -16(%rax),%rbp
        mov     -16(%rax),%rbp
+.cfi_restore   %rbp
        mov     -8(%rax),%rbx
        mov     -8(%rax),%rbx
+.cfi_restore   %rbx
        lea     (%rax),%rsp             # restore %rsp
        lea     (%rax),%rsp             # restore %rsp
+.cfi_def_cfa_register  %rsp
 .Lgcm_dec_abort:
        mov     $ret,%rax               # return value
        ret
 .Lgcm_dec_abort:
        mov     $ret,%rax               # return value
        ret
+.cfi_endproc
 .size  aesni_gcm_decrypt,.-aesni_gcm_decrypt
 ___
 
 .size  aesni_gcm_decrypt,.-aesni_gcm_decrypt
 ___
 
@@ -645,6 +661,7 @@ _aesni_ctr32_6x:
 .type  aesni_gcm_encrypt,\@function,6
 .align 32
 aesni_gcm_encrypt:
 .type  aesni_gcm_encrypt,\@function,6
 .align 32
 aesni_gcm_encrypt:
+.cfi_startproc
        xor     $ret,$ret
 
        # We call |_aesni_ctr32_6x| twice, each call consuming 96 bytes of
        xor     $ret,$ret
 
        # We call |_aesni_ctr32_6x| twice, each call consuming 96 bytes of
@@ -654,12 +671,19 @@ aesni_gcm_encrypt:
        jb      .Lgcm_enc_abort
 
        lea     (%rsp),%rax                     # save stack pointer
        jb      .Lgcm_enc_abort
 
        lea     (%rsp),%rax                     # save stack pointer
+.cfi_def_cfa_register  %rax
        push    %rbx
        push    %rbx
+.cfi_push      %rbx
        push    %rbp
        push    %rbp
+.cfi_push      %rbp
        push    %r12
        push    %r12
+.cfi_push      %r12
        push    %r13
        push    %r13
+.cfi_push      %r13
        push    %r14
        push    %r14
+.cfi_push      %r14
        push    %r15
        push    %r15
+.cfi_push      %r15
 ___
 $code.=<<___ if ($win64);
        lea     -0xa8(%rsp),%rsp
 ___
 $code.=<<___ if ($win64);
        lea     -0xa8(%rsp),%rsp
@@ -931,15 +955,23 @@ $code.=<<___ if ($win64);
 ___
 $code.=<<___;
        mov     -48(%rax),%r15
 ___
 $code.=<<___;
        mov     -48(%rax),%r15
+.cfi_restore   %r15
        mov     -40(%rax),%r14
        mov     -40(%rax),%r14
+.cfi_restore   %r14
        mov     -32(%rax),%r13
        mov     -32(%rax),%r13
+.cfi_restore   %r13
        mov     -24(%rax),%r12
        mov     -24(%rax),%r12
+.cfi_restore   %r12
        mov     -16(%rax),%rbp
        mov     -16(%rax),%rbp
+.cfi_restore   %rbp
        mov     -8(%rax),%rbx
        mov     -8(%rax),%rbx
+.cfi_restore   %rbx
        lea     (%rax),%rsp             # restore %rsp
        lea     (%rax),%rsp             # restore %rsp
+.cfi_def_cfa_register  %rsp
 .Lgcm_enc_abort:
        mov     $ret,%rax               # return value
        ret
 .Lgcm_enc_abort:
        mov     $ret,%rax               # return value
        ret
+.cfi_endproc
 .size  aesni_gcm_encrypt,.-aesni_gcm_encrypt
 ___
 
 .size  aesni_gcm_encrypt,.-aesni_gcm_encrypt
 ___