lib/crypto: arm/poly1305: fix poly1305_blocks_neon link failure
Subsystems (2)
PATCH 1/1 lib/crypto: arm/poly1305: fix poly1305_blocks_neon link failure
From: Arnd Bergmann <[email protected]>
The reference to poly1305_blocks_neon from generated assembler code is apparently the reason we had the silly __weak function in the wrapper. Removing it introduced a link failure:
ERROR: modpost: "poly1305_blocks_neon" [lib/crypto/arm/poly1305-arm.ko] undefined!
Moving the reference inside of the #if ARMv7 block avoids this problem.
---
I see that the neon code is always built when targetting ARMv7, even in configurations without CONFIG_KERNEL_MODE_NEON where it is never called. I tried cleaning that up as well but couldn't figure it out.
--- lib/crypto/arm/poly1305-armv4.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/crypto/arm/poly1305-armv4.pl +1 -1
@@ -46,7 +46,6 @@ $code.=<<___; # define poly1305_init poly1305_block_init_arch # define poly1305_blocks poly1305_blocks_arm # define poly1305_emit poly1305_emit_arch -.globl poly1305_blocks_neon #endif #if defined(__thumb2__)
@@ -722,6 +721,7 @@ poly1305_init_neon: ret @ bx lr .size poly1305_init_neon,.-poly1305_init_neon +.globl poly1305_blocks_neon .type poly1305_blocks_neon,%function .align 5 poly1305_blocks_neon:
Signature · 1 line
2.39.5
Eric Biggers
maintainerQuoted 12 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The reference to
poly1305_blocks_neonfrom generated assembler code is apparently the reason we had the silly__weakfunction in the wrapper. Removing it introduced a link failure:ERROR: modpost: "
poly1305_blocks_neon" [lib/crypto/arm/poly1305-arm.ko] undefined!Moving the reference inside of the #if ARMv7 block avoids this problem.
Fixes 16f9e0cc99ec ("lib/crypto: arm/poly1305: Remove unneeded empty weak function")Signed-off-by Arnd Bergmann <[email protected]>
Quoted 7 lines
---
I see that the neon code is always built when targetting ARMv7, even in configurations withoutCONFIG_KERNEL_MODE_NEONwhere it is never called. I tried cleaning that up as well but couldn't figure it out.--- lib/crypto/arm/poly1305-armv4.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks! That's an interesting one... unfortunately the "perlasm" files are kind of a mess.
To avoid a bisection hazard, I'm replacing the original patch with an updated version that includes your fix:
https://lore.kernel.org/r/[email protected]
- Eric