summaryrefslogtreecommitdiff
path: root/mpi
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@iki.fi>2019-04-26 19:29:08 +0300
committerJussi Kivilinna <jussi.kivilinna@iki.fi>2019-04-26 19:29:08 +0300
commit5a2a96a63517838e04f9fc0fb2d932fac5124b8a (patch)
treeac8391f55759d1995088eab36aecc8c5d816cd28 /mpi
parent14c8a593ede42f51f567ed7ba77b53124151aa38 (diff)
downloadlibgcrypt-5a2a96a63517838e04f9fc0fb2d932fac5124b8a.tar.gz
Add CFI unwind assembly directives for 64-bit ARM assembly
* cipher/asm-common-aarch64.h (CFI_STARTPROC, CFI_ENDPROC) (CFI_REMEMBER_STATE, CFI_RESTORE_STATE, CFI_ADJUST_CFA_OFFSET) (CFI_REL_OFFSET, CFI_DEF_CFA_REGISTER, CFI_REGISTER, CFI_RESTORE) (DW_REGNO_SP, DW_SLEB128_7BIT, DW_SLEB128_28BIT, CFI_CFA_ON_STACK) (CFI_REG_ON_STACK): New. * cipher/camellia-aarch64.S: Add CFI directives. * cipher/chacha20-aarch64.S: Add CFI directives. * cipher/cipher-gcm-armv8-aarch64-ce.S: Add CFI directives. * cipher/crc-armv8-aarch64-ce.S: Add CFI directives. * cipher/rijndael-aarch64.S: Add CFI directives. * cipher/rijndael-armv8-aarch64-ce.S: Add CFI directives. * cipher/sha1-armv8-aarch64-ce.S: Add CFI directives. * cipher/sha256-armv8-aarch64-ce.S: Add CFI directives. * cipher/twofish-aarch64.S: Add CFI directives. * mpi/aarch64/mpih-add1.S: Add CFI directives. * mpi/aarch64/mpih-mul1.S: Add CFI directives. * mpi/aarch64/mpih-mul2.S: Add CFI directives. * mpi/aarch64/mpih-mul3.S: Add CFI directives. * mpi/aarch64/mpih-sub1.S: Add CFI directives. * mpi/asm-common-aarch64.h: Include "../cipher/asm-common-aarch64.h". (ELF): Remove. -- This commit adds CFI directives that add DWARF unwinding information for debugger to backtrace when executing code from 64-bit ARM assembly files. Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'mpi')
-rw-r--r--mpi/aarch64/mpih-add1.S2
-rw-r--r--mpi/aarch64/mpih-mul1.S2
-rw-r--r--mpi/aarch64/mpih-mul2.S2
-rw-r--r--mpi/aarch64/mpih-mul3.S2
-rw-r--r--mpi/aarch64/mpih-sub1.S2
-rw-r--r--mpi/asm-common-aarch64.h6
6 files changed, 11 insertions, 5 deletions
diff --git a/mpi/aarch64/mpih-add1.S b/mpi/aarch64/mpih-add1.S
index 3370320e..bc62cf98 100644
--- a/mpi/aarch64/mpih-add1.S
+++ b/mpi/aarch64/mpih-add1.S
@@ -37,6 +37,7 @@
.globl _gcry_mpih_add_n
ELF(.type _gcry_mpih_add_n,%function)
_gcry_mpih_add_n:
+ CFI_STARTPROC()
and w5, w3, #3;
adds xzr, xzr, xzr; /* clear carry flag */
@@ -69,4 +70,5 @@ _gcry_mpih_add_n:
.Lend:
adc x0, xzr, xzr;
ret;
+ CFI_ENDPROC()
ELF(.size _gcry_mpih_add_n,.-_gcry_mpih_add_n;)
diff --git a/mpi/aarch64/mpih-mul1.S b/mpi/aarch64/mpih-mul1.S
index 8830845a..92fcd141 100644
--- a/mpi/aarch64/mpih-mul1.S
+++ b/mpi/aarch64/mpih-mul1.S
@@ -37,6 +37,7 @@
.globl _gcry_mpih_mul_1
ELF(.type _gcry_mpih_mul_1,%function)
_gcry_mpih_mul_1:
+ CFI_STARTPROC()
and w5, w2, #3;
mov x4, xzr;
@@ -94,4 +95,5 @@ _gcry_mpih_mul_1:
.Lend:
mov x0, x4;
ret;
+ CFI_ENDPROC()
ELF(.size _gcry_mpih_mul_1,.-_gcry_mpih_mul_1;)
diff --git a/mpi/aarch64/mpih-mul2.S b/mpi/aarch64/mpih-mul2.S
index 5d736990..aa0e5a2d 100644
--- a/mpi/aarch64/mpih-mul2.S
+++ b/mpi/aarch64/mpih-mul2.S
@@ -37,6 +37,7 @@
.globl _gcry_mpih_addmul_1
ELF(.type _gcry_mpih_addmul_1,%function)
_gcry_mpih_addmul_1:
+ CFI_STARTPROC()
and w5, w2, #3;
mov x6, xzr;
mov x7, xzr;
@@ -106,4 +107,5 @@ _gcry_mpih_addmul_1:
.Lend:
mov x0, x6;
ret;
+ CFI_ENDPROC()
ELF(.size _gcry_mpih_addmul_1,.-_gcry_mpih_addmul_1;)
diff --git a/mpi/aarch64/mpih-mul3.S b/mpi/aarch64/mpih-mul3.S
index f785e5e4..5a40b354 100644
--- a/mpi/aarch64/mpih-mul3.S
+++ b/mpi/aarch64/mpih-mul3.S
@@ -37,6 +37,7 @@
.globl _gcry_mpih_submul_1
ELF(.type _gcry_mpih_submul_1,%function)
_gcry_mpih_submul_1:
+ CFI_STARTPROC()
and w5, w2, #3;
mov x7, xzr;
cbz w5, .Large_loop;
@@ -119,4 +120,5 @@ _gcry_mpih_submul_1:
.Loop_end:
cinc x0, x7, cc;
ret;
+ CFI_ENDPROC()
ELF(.size _gcry_mpih_submul_1,.-_gcry_mpih_submul_1;)
diff --git a/mpi/aarch64/mpih-sub1.S b/mpi/aarch64/mpih-sub1.S
index 45a7b041..4f279a12 100644
--- a/mpi/aarch64/mpih-sub1.S
+++ b/mpi/aarch64/mpih-sub1.S
@@ -37,6 +37,7 @@
.globl _gcry_mpih_sub_n
ELF(.type _gcry_mpih_sub_n,%function)
_gcry_mpih_sub_n:
+ CFI_STARTPROC()
and w5, w3, #3;
subs xzr, xzr, xzr; /* prepare carry flag for sub */
@@ -69,4 +70,5 @@ _gcry_mpih_sub_n:
.Lend:
cset x0, cc;
ret;
+ CFI_ENDPROC()
ELF(.size _gcry_mpih_sub_n,.-_gcry_mpih_sub_n;)
diff --git a/mpi/asm-common-aarch64.h b/mpi/asm-common-aarch64.h
index 12694130..cf4bdb85 100644
--- a/mpi/asm-common-aarch64.h
+++ b/mpi/asm-common-aarch64.h
@@ -21,10 +21,6 @@
#ifndef MPI_ASM_COMMON_AARCH64_H
#define MPI_ASM_COMMON_AARCH64_H
-#ifdef __ELF__
-# define ELF(...) __VA_ARGS__
-#else
-# define ELF(...) /*_*/
-#endif
+#include "../cipher/asm-common-aarch64.h"
#endif /* MPI_ASM_COMMON_AARCH64_H */