asm: missing function alignment#31284
Conversation
clang-22 reports missing alignment on MacOS. ld: warning: arm64 function not 4-byte aligned: _asm_aescbc_sha1_hmac from libcrypto.a(libcrypto-lib-aes-sha1-armv8.o) ld: warning: arm64 function not 4-byte aligned: _asm_aescbc_sha256_hmac from libcrypto.a(libcrypto-lib-aes-sha256-armv8.o) ld: warning: arm64 function not 4-byte aligned: _asm_sha1_hmac_aescbc_dec from libcrypto.a(libcrypto-lib-aes-sha1-armv8.o) ld: warning: arm64 function not 4-byte aligned: _asm_sha256_hmac_aescbc_dec from libcrypto.a(libcrypto-lib-aes-sha256-armv8.o) Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Sashan
left a comment
There was a problem hiding this comment.
I think I'm fine with it. Still have a question for arm folks (@tom-cosgrove-arm)
why some files are using .align 4 for functions for example here in
crypto/aes/asm/aes-sha512-armv8.pl
2071
2072 .global asm_sha512_hmac_aescbc_dec
2073 .type asm_sha512_hmac_aescbc_dec,%function
2074
2075 .align 4
2076 asm_sha512_hmac_aescbc_dec:
and other places OpenSSL uses .align 5 like here for montgomery multiplication in ./bn/asm/armv8-mont.pl
76
77 .globl bn_mul_mont
78 .type bn_mul_mont,%function
79 .align 5
80 bn_mul_mont:
81 AARCH64_SIGN_LINK_REGISTER
82 .Lbn_mul_mont:
83 tst $num,#3
Is .align 5 meaningful? in other words: when .align 4 should be used and when .align 5 should be used? thanks.
|
|
|
@tom-cosgrove-arm is there any reason to use |
Given the use of both |
esyr
left a comment
There was a problem hiding this comment.
Not sure what the actual alignment should be.
|
Hmmm, a quick @tom-cosgrove-arm, may I ask to evaluate whether those functions need |
Thanks for checking. Yes, looks like |
|
24 hours has passed since 'approval: done' was set, but as this PR has been updated in that time the label 'approval: ready to merge' is not being automatically set. Please review the updates and set the label manually. |
clang-22 reported missing alignment on MacOS:
ld: warning: arm64 function not 4-byte aligned: _asm_sha1_hmac_aescbc_dec from libcrypto.a(libcrypto-lib-aes-sha1-armv8.o)
ld: warning: arm64 function not 4-byte aligned: _asm_sha256_hmac_aescbc_dec from libcrypto.a(libcrypto-lib-aes-sha256-armv8.o)
Add ".align 4" directives to the affected functions.
Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Thu May 28 08:31:59 2026
(Merged from #31284)
And that array should be in |
Yes, but that's not a change for a "missing function alignment" PR |
clang-22 reported missing alignment on MacOS:
ld: warning: arm64 function not 4-byte aligned: _asm_sha1_hmac_aescbc_dec from libcrypto.a(libcrypto-lib-aes-sha1-armv8.o)
ld: warning: arm64 function not 4-byte aligned: _asm_sha256_hmac_aescbc_dec from libcrypto.a(libcrypto-lib-aes-sha256-armv8.o)
Add ".align 4" directives to the affected functions.
Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Thu May 28 08:31:59 2026
(Merged from #31284)
(cherry picked from commit 94fbc02)
clang-22 reported missing alignment on MacOS:
ld: warning: arm64 function not 4-byte aligned: _asm_sha1_hmac_aescbc_dec from libcrypto.a(libcrypto-lib-aes-sha1-armv8.o)
ld: warning: arm64 function not 4-byte aligned: _asm_sha256_hmac_aescbc_dec from libcrypto.a(libcrypto-lib-aes-sha256-armv8.o)
Add ".align 4" directives to the affected functions.
Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Thu May 28 08:31:59 2026
(Merged from #31284)
(cherry picked from commit 94fbc02)
|
The commit that has introduced the affected files, |
|
Applied to |
clang-22 reports missing alignment on MacOS.
ld: warning: arm64 function not 4-byte aligned: _asm_aescbc_sha1_hmac from libcrypto.a(libcrypto-lib-aes-sha1-armv8.o)
ld: warning: arm64 function not 4-byte aligned: _asm_aescbc_sha256_hmac from libcrypto.a(libcrypto-lib-aes-sha256-armv8.o)
ld: warning: arm64 function not 4-byte aligned: _asm_sha1_hmac_aescbc_dec from libcrypto.a(libcrypto-lib-aes-sha1-armv8.o)
ld: warning: arm64 function not 4-byte aligned: _asm_sha256_hmac_aescbc_dec from libcrypto.a(libcrypto-lib-aes-sha256-armv8.o)