2023-12-28 10:36:31

by Helge Deller

[permalink] [raw]
Subject: [PATCH] linux/export: Ensure natural alignment of kcrctab array

The ___kcrctab section holds an array of 32-bit CRC values.
Add a .balign 4 to tell the linker the correct memory alignment.

Signed-off-by: Helge Deller <[email protected]>
Fixes: f3304ecd7f06 ("linux/export: use inline assembler to populate symbol CRCs")
Link: https://lore.kernel.org/r/CAK7LNAT5gyn0C9EJhh1EeFT7gF0rOudWcdqAVN=+C4jR42W90w@mail.gmail.com/

diff --git a/include/linux/export-internal.h b/include/linux/export-internal.h
index 69501e0ec239..51b8cf3f60ef 100644
--- a/include/linux/export-internal.h
+++ b/include/linux/export-internal.h
@@ -61,6 +61,7 @@

#define SYMBOL_CRC(sym, crc, sec) \
asm(".section \"___kcrctab" sec "+" #sym "\",\"a\"" "\n" \
+ ".balign 4" "\n" \
"__crc_" #sym ":" "\n" \
".long " #crc "\n" \
".previous" "\n")


2023-12-28 16:33:12

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH] linux/export: Ensure natural alignment of kcrctab array

On Thu, Dec 28, 2023 at 7:36 PM Helge Deller <[email protected]> wrote:
>
> The ___kcrctab section holds an array of 32-bit CRC values.
> Add a .balign 4 to tell the linker the correct memory alignment.
>
> Signed-off-by: Helge Deller <[email protected]>
> Fixes: f3304ecd7f06 ("linux/export: use inline assembler to populate symbol CRCs")
> Link: https://lore.kernel.org/r/CAK7LNAT5gyn0C9EJhh1EeFT7gF0rOudWcdqAVN=+C4jR42W90w@mail.gmail.com/



Applied to linux-kbuild/fixes.
Thanks!





> diff --git a/include/linux/export-internal.h b/include/linux/export-internal.h
> index 69501e0ec239..51b8cf3f60ef 100644
> --- a/include/linux/export-internal.h
> +++ b/include/linux/export-internal.h
> @@ -61,6 +61,7 @@
>
> #define SYMBOL_CRC(sym, crc, sec) \
> asm(".section \"___kcrctab" sec "+" #sym "\",\"a\"" "\n" \
> + ".balign 4" "\n" \
> "__crc_" #sym ":" "\n" \
> ".long " #crc "\n" \
> ".previous" "\n")



--
Best Regards
Masahiro Yamada