summaryrefslogtreecommitdiff
path: root/sha256_armv4.S
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-05-24 16:33:47 -0400
committerJeffrey Walton <noloader@gmail.com>2019-05-24 16:33:47 -0400
commitea96b9d37504d90ac17744e9c642235100a115ba (patch)
tree0a7d9b0af64725039c6b8a0cec16d8f5fc7b2ac7 /sha256_armv4.S
parent1650cac3f3223456538d8bf2fdd9e3d47f1d2d80 (diff)
downloadcryptopp-git-ea96b9d37504d90ac17744e9c642235100a115ba.tar.gz
Use CRYPTOGAMS_armcap_P for ARM (GH #846)
Andy advised against removing the global caps variable. This commit reintroduces CRYPTOGAMS_armcap_P. However, due to the shared object symbol loading problem, we needed to use CRYPTOGAMS_armcap_P as a global, and not CRYPTOGAMS_armcap as a local. Using CRYPTOGAMS_armcap_P directly caused the symbol to be marked as R_ARM_ABS32 which avoids the problem with R_ARM_REL32.
Diffstat (limited to 'sha256_armv4.S')
-rw-r--r--sha256_armv4.S20
1 files changed, 17 insertions, 3 deletions
diff --git a/sha256_armv4.S b/sha256_armv4.S
index 80d347d7..74c208f7 100644
--- a/sha256_armv4.S
+++ b/sha256_armv4.S
@@ -1,4 +1,4 @@
-@ Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved.
+@ Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
@
@ ====================================================================
@ Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
@@ -76,6 +76,8 @@
.code 32
#endif
+.extern CRYPTOGAMS_armcap_P
+
.text
.type K256,%object
@@ -101,18 +103,26 @@ K256:
.word 0 @ terminator
.align 5
+
.globl sha256_block_data_order
.type sha256_block_data_order,%function
sha256_block_data_order:
.Lsha256_block_data_order:
#if __ARM_ARCH__<7 && !defined(__thumb2__)
- mov r12,r3
sub r3,pc,#8 @ sha256_block_data_order
#else
- mov r12,r3
adr r3,.Lsha256_block_data_order
#endif
#if __ARM_MAX_ARCH__>=7
+ @ldr r12,.LCRYPTOGAMS_armcap
+ ldr r12,=CRYPTOGAMS_armcap_P
+# if !defined(_WIN32)
+ @ldr r12,[r3,r12] @ CRYPTOGAMS_armcap_P
+ ldr r12,[r12] @ CRYPTOGAMS_armcap_P
+# endif
+# if defined(__APPLE__) || defined(_WIN32)
+ ldr r12,[r12]
+# endif
tst r12,#ARMV7_NEON
bne .LNEON
#endif
@@ -1882,6 +1892,10 @@ sha256_block_data_order:
.word 0xe12fff1e @ interoperable with Thumb ISA:-)
#endif
.size sha256_block_data_order,.-sha256_block_data_order
+
+@ CRYPTOGAMS_armcap_P
+.ltorg
+
#if __ARM_MAX_ARCH__>=7
.arch armv7-a
.fpu neon