diff options
author | Andy Polyakov <appro@openssl.org> | 2019-02-15 09:44:39 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-02-16 16:59:23 +0100 |
commit | 3405db97e5448c784729b56837f3f8c776a01067 (patch) | |
tree | 3038d1d73fb0964915fdfd6377bb717722c02ea7 /crypto/chacha/asm | |
parent | s390x assembly pack: fix formal interface bug in chacha module (diff) | |
download | openssl-3405db97e5448c784729b56837f3f8c776a01067.tar.xz openssl-3405db97e5448c784729b56837f3f8c776a01067.zip |
ARM assembly pack: make it Windows-friendly.
"Windows friendliness" means a) flipping .thumb and .text directives,
b) always generate Thumb-2 code when asked(*); c) Windows-specific
references to external OPENSSL_armcap_P.
(*) so far *some* modules were compiled as .code 32 even if Thumb-2
was targeted. It works at hardware level because processor can alternate
between the modes with no overhead. But clang --target=arm-windows's
builtin assembler just refuses to compile .code 32...
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8252)
Diffstat (limited to 'crypto/chacha/asm')
-rwxr-xr-x | crypto/chacha/asm/chacha-armv4.pl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/crypto/chacha/asm/chacha-armv4.pl b/crypto/chacha/asm/chacha-armv4.pl index 9bbfc6b376..c4402961d4 100755 --- a/crypto/chacha/asm/chacha-armv4.pl +++ b/crypto/chacha/asm/chacha-armv4.pl @@ -171,7 +171,6 @@ my @ret; $code.=<<___; #include "arm_arch.h" -.text #if defined(__thumb2__) || defined(__clang__) .syntax unified #endif @@ -185,6 +184,8 @@ $code.=<<___; #define ldrhsb ldrbhs #endif +.text + .align 5 .Lsigma: .long 0x61707865,0x3320646e,0x79622d32,0x6b206574 @ endian-neutral @@ -192,7 +193,11 @@ $code.=<<___; .long 1,0,0,0 #if __ARM_MAX_ARCH__>=7 .LOPENSSL_armcap: +# ifdef _WIN32 +.word OPENSSL_armcap_P +# else .word OPENSSL_armcap_P-.LChaCha20_ctr32 +# endif #else .word -1 #endif @@ -219,8 +224,10 @@ ChaCha20_ctr32: cmp r2,#192 @ test len bls .Lshort ldr r4,[r14,#-32] +# if !defined(_WIN32) ldr r4,[r14,r4] -# ifdef __APPLE__ +# endif +# if defined(__APPLE__) || defined(_WIN32) ldr r4,[r4] # endif tst r4,#ARMV7_NEON |