[PATCH 2/4] Fix non-PIC reference in PIC for poly1305/ARMv7-NEON
Jussi Kivilinna
jussi.kivilinna at iki.fi
Thu Jun 30 23:55:28 CEST 2016
* cipher/poly1305-armv7-neon.S (GET_DATA_POINTER): New.
(_gcry_poly1305_armv7_neon_init_ext): Use GET_DATA_POINTER.
--
Reported-by: Michael Plass <mfpnb at plass-family.net>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
---
cipher/poly1305-armv7-neon.S | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/cipher/poly1305-armv7-neon.S b/cipher/poly1305-armv7-neon.S
index 1134e85..b1554ed 100644
--- a/cipher/poly1305-armv7-neon.S
+++ b/cipher/poly1305-armv7-neon.S
@@ -33,6 +33,19 @@
.fpu neon
.arm
+#ifdef __PIC__
+# define GET_DATA_POINTER(reg, name, rtmp) \
+ ldr reg, 1f; \
+ ldr rtmp, 2f; \
+ b 3f; \
+ 1: .word _GLOBAL_OFFSET_TABLE_-(3f+8); \
+ 2: .word name(GOT); \
+ 3: add reg, pc, reg; \
+ ldr reg, [reg, rtmp];
+#else
+# define GET_DATA_POINTER(reg, name, rtmp) ldr reg, =name
+#endif
+
.text
.p2align 2
@@ -52,7 +65,7 @@ _gcry_poly1305_armv7_neon_init_ext:
and r2, r2, r2
moveq r14, #-1
ldmia r1!, {r2-r5}
- ldr r7, =.Lpoly1305_init_constants_neon
+ GET_DATA_POINTER(r7,.Lpoly1305_init_constants_neon,r8)
mov r6, r2
mov r8, r2, lsr #26
mov r9, r3, lsr #20
More information about the Gcrypt-devel
mailing list