mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 18:43:33 +02:00
crypto: riscv - Use SYM_FUNC_START for functions only called directly
After some recent changes to the RISC-V crypto code that turned some indirect function calls into direct ones, builds with CONFIG_CFI_CLANG fail with: ld.lld: error: undefined symbol: __kcfi_typeid_sm3_transform_zvksh_zvkb >>> referenced by arch/riscv/crypto/sm3-riscv64-zvksh-zvkb.o:(.text+0x2) in archive vmlinux.a ld.lld: error: undefined symbol: __kcfi_typeid_sha512_transform_zvknhb_zvkb >>> referenced by arch/riscv/crypto/sha512-riscv64-zvknhb-zvkb.o:(.text+0x2) in archive vmlinux.a ld.lld: error: undefined symbol: __kcfi_typeid_sha256_transform_zvknha_or_zvknhb_zvkb >>> referenced by arch/riscv/crypto/sha256-riscv64-zvknha_or_zvknhb-zvkb.o:(.text+0x2) in archive vmlinux.a As these functions are no longer indirectly called (i.e., have their address taken), the compiler will not emit __kcfi_typeid symbols for them but SYM_TYPED_FUNC_START expects these to exist at link time. Switch the definitions of these functions to use SYM_FUNC_START, as they no longer need kCFI type information since they are only called directly. Fixes:1523eaed0a("crypto: riscv/sm3 - Use API partial block handling") Fixes:561aab1104("crypto: riscv/sha512 - Use API partial block handling") Fixes:e6c5597bad("crypto: riscv/sha256 - Use API partial block handling") Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
aa38d87ec8
commit
bf0b4f1526
|
|
@ -43,7 +43,7 @@
|
|||
// - RISC-V Vector SHA-2 Secure Hash extension ('Zvknha' or 'Zvknhb')
|
||||
// - RISC-V Vector Cryptography Bit-manipulation extension ('Zvkb')
|
||||
|
||||
#include <linux/cfi_types.h>
|
||||
#include <linux/linkage.h>
|
||||
|
||||
.text
|
||||
.option arch, +zvknha, +zvkb
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
|
||||
// void sha256_transform_zvknha_or_zvknhb_zvkb(u32 state[8], const u8 *data,
|
||||
// int num_blocks);
|
||||
SYM_TYPED_FUNC_START(sha256_transform_zvknha_or_zvknhb_zvkb)
|
||||
SYM_FUNC_START(sha256_transform_zvknha_or_zvknhb_zvkb)
|
||||
|
||||
// Load the round constants into K0-K15.
|
||||
vsetivli zero, 4, e32, m1, ta, ma
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
// - RISC-V Vector SHA-2 Secure Hash extension ('Zvknhb')
|
||||
// - RISC-V Vector Cryptography Bit-manipulation extension ('Zvkb')
|
||||
|
||||
#include <linux/cfi_types.h>
|
||||
#include <linux/linkage.h>
|
||||
|
||||
.text
|
||||
.option arch, +zvknhb, +zvkb
|
||||
|
|
@ -95,7 +95,7 @@
|
|||
|
||||
// void sha512_transform_zvknhb_zvkb(u64 state[8], const u8 *data,
|
||||
// int num_blocks);
|
||||
SYM_TYPED_FUNC_START(sha512_transform_zvknhb_zvkb)
|
||||
SYM_FUNC_START(sha512_transform_zvknhb_zvkb)
|
||||
|
||||
// Setup mask for the vmerge to replace the first word (idx==0) in
|
||||
// message scheduling. There are 4 words, so an 8-bit mask suffices.
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
// - RISC-V Vector SM3 Secure Hash extension ('Zvksh')
|
||||
// - RISC-V Vector Cryptography Bit-manipulation extension ('Zvkb')
|
||||
|
||||
#include <linux/cfi_types.h>
|
||||
#include <linux/linkage.h>
|
||||
|
||||
.text
|
||||
.option arch, +zvksh, +zvkb
|
||||
|
|
@ -81,7 +81,7 @@
|
|||
.endm
|
||||
|
||||
// void sm3_transform_zvksh_zvkb(u32 state[8], const u8 *data, int num_blocks);
|
||||
SYM_TYPED_FUNC_START(sm3_transform_zvksh_zvkb)
|
||||
SYM_FUNC_START(sm3_transform_zvksh_zvkb)
|
||||
|
||||
// Load the state and endian-swap each 32-bit word.
|
||||
vsetivli zero, 8, e32, m2, ta, ma
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user