diff mbox series

linux/export: Ensure natural alignment of kcrctab array

Message ID ZY1Pk61PP5HvLDag@p100 (mailing list archive)
State Accepted, archived
Headers show
Series linux/export: Ensure natural alignment of kcrctab array | expand

Commit Message

Helge Deller Dec. 28, 2023, 10:36 a.m. UTC
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 <deller@gmx.de>
Fixes: f3304ecd7f06 ("linux/export: use inline assembler to populate symbol CRCs")
Link: https://lore.kernel.org/r/CAK7LNAT5gyn0C9EJhh1EeFT7gF0rOudWcdqAVN=+C4jR42W90w@mail.gmail.com/

Comments

Masahiro Yamada Dec. 28, 2023, 4:32 p.m. UTC | #1
On Thu, Dec 28, 2023 at 7:36 PM Helge Deller <deller@kernel.org> 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 <deller@gmx.de>
> 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")
diff mbox series

Patch

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")