]> git.baikalelectronics.ru Git - kernel.git/commit
linux/export: use inline assembler to populate symbol CRCs
authorMasahiro Yamada <masahiroy@kernel.org>
Fri, 16 Sep 2022 06:29:53 +0000 (15:29 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 28 Sep 2022 19:40:15 +0000 (04:40 +0900)
commitbb22aa3d7e8ffd1a156a720421fd6a566de372e3
tree3e4cbf7e79aa70b17fe39ae202d00859d14be4d9
parent99400c8e2d017d9cb66361a5d6ca740ae9ab2b15
linux/export: use inline assembler to populate symbol CRCs

Since commit 202351226f7b ("kbuild: link symbol CRCs at final link,
removing CONFIG_MODULE_REL_CRCS"), the module versioning on the
(non-upstreamed-yet) kvx Linux port is broken due to unexpected padding
for __crc_* symbols. The kvx GCC adds padding so u32 gets 8-byte
alignment instead of 4.

I do not know if this happens for upstream architectures in general,
but any compiler has the freedom to insert padding for faster access.

Use the inline assembler to directly specify the wanted data layout.
This is how we previously did before the breakage.

Link: https://lore.kernel.org/lkml/20220817161438.32039-1-ysionneau@kalray.eu/
Link: https://lore.kernel.org/linux-kbuild/31ce5305-a76b-13d7-ea55-afca82c46cf2@kalray.eu/
Fixes: 202351226f7b ("kbuild: link symbol CRCs at final link, removing CONFIG_MODULE_REL_CRCS")
Reported-by: Yann Sionneau <ysionneau@kalray.eu>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Tested-by: Yann Sionneau <ysionneau@kalray.eu>
include/linux/export-internal.h