From: Alexey Moksyakov Date: Wed, 22 Jan 2025 07:28:33 +0000 (+0300) Subject: [sm3][aarch64] Move constant to .rodata section X-Git-Tag: openssl-3.5.0-alpha1~616 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1e42e76dda742e8c5cd118967113d69a19f02278;p=thirdparty%2Fopenssl.git [sm3][aarch64] Move constant to .rodata section Reviewed-by: Saša Nedvědický Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/26509) --- diff --git a/crypto/sm3/asm/sm3-armv8.pl b/crypto/sm3/asm/sm3-armv8.pl index bdbb1af1d6f..f3db3bd5637 100644 --- a/crypto/sm3/asm/sm3-armv8.pl +++ b/crypto/sm3/asm/sm3-armv8.pl @@ -22,6 +22,7 @@ open OUT,"| \"$^X\" $xlate $flavour \"$output\"" or die "can't call $xlate: $!"; *STDOUT=*OUT; +$prefix="sm3"; # Message expanding: # Wj <- P1(W[j-16]^W[j-9]^(W[j-3]<<<15))^(W[j-13]<<<7)^W[j-6] # Input: s0, s1, s2, s3 @@ -135,8 +136,19 @@ ossl_hwsm3_block_data_order: rev64 $state2.4s, $state2.4s ext $state1.16b, $state1.16b, $state1.16b, #8 ext $state2.16b, $state2.16b, $state2.16b, #8 - +___ +if ($flavour =~ /linux64/) +{ +$code.=<<___; + adrp $constaddr, .Tj + add $constaddr, $constaddr, #:lo12:.Tj +___ +} else { +$code.=<<___; adr $constaddr, .Tj +___ +} +$code.=<<___; ldp $sconst1, $sconst2, [$constaddr] .Loop: @@ -209,11 +221,22 @@ $code.=<<___; st1 {$state1.4s-$state2.4s}, [$pstate] ret .size ossl_hwsm3_block_data_order,.-ossl_hwsm3_block_data_order +___ +$code.=".rodata\n" if ($flavour =~ /linux64/); + +$code.=<<___; + +.type _${prefix}_consts,%object .align 3 +_${prefix}_consts: .Tj: .word 0x79cc4519, 0x9d8a7a87 +.size _${prefix}_consts,.-_${prefix}_consts ___ + +$code.=".previous\n" if ($flavour =~ /linux64/); + }}} #########################################