mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 18:39:59 +00:00
![Masahiro Yamada](/assets/img/avatar_default.png)
Since commit7b4537199a
("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:7b4537199a
("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>
19 lines
502 B
C
19 lines
502 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Please do not include this explicitly.
|
|
* This is used by C files generated by modpost.
|
|
*/
|
|
|
|
#ifndef __LINUX_EXPORT_INTERNAL_H__
|
|
#define __LINUX_EXPORT_INTERNAL_H__
|
|
|
|
#include <linux/compiler.h>
|
|
#include <linux/types.h>
|
|
|
|
#define SYMBOL_CRC(sym, crc, sec) \
|
|
asm(".section \"___kcrctab" sec "+" #sym "\",\"a\"" "\n" \
|
|
"__crc_" #sym ":" "\n" \
|
|
".long " #crc "\n" \
|
|
".previous" "\n")
|
|
|
|
#endif /* __LINUX_EXPORT_INTERNAL_H__ */
|