Skip to contentSkip to conversation

linux/export: Ensure natural alignment of kcrctab array

PATCH In review Helge Deller 2 participants 2 messages Dec 28, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

Fixes f3304ecd7f06 ("linux/export: use inline assembler to populate symbol CRCs")
include/linux/export-internal.h +1 -0
index 69501e0ec239..51b8cf3f60ef 100644
@@ -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")
#1 lore raw
Quoted 7 lines · Helge Deller

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

Fixes f3304ecd7f06 ("linux/export: use inline assembler to populate symbol CRCs")

Applied to linux-kbuild/fixes.
Thanks!

Quoted 12 lines
include/linux/export-internal.h +1 -0
index 69501e0ec239..51b8cf3f60ef 100644
@@ -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")
Signature · 2 lines
Best Regards
Masahiro Yamada