Skip to content

Commit f684780

Browse files
hdellermasahir0y
authored andcommitted
linux/export: Fix alignment for 64-bit ksymtab entries
An alignment of 4 bytes is wrong for 64-bit platforms which don't define CONFIG_HAVE_ARCH_PREL32_RELOCATIONS (which then store 64-bit pointers). Fix their alignment to 8 bytes. Fixes: ddb5cdb ("kbuild: generate KSYMTAB entries by modpost") Signed-off-by: Helge Deller <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 2cc14f5 commit f684780

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

include/linux/export-internal.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@
1616
* and eliminates the need for absolute relocations that require runtime
1717
* processing on relocatable kernels.
1818
*/
19+
#define __KSYM_ALIGN ".balign 4"
1920
#define __KSYM_REF(sym) ".long " #sym "- ."
2021
#elif defined(CONFIG_64BIT)
22+
#define __KSYM_ALIGN ".balign 8"
2123
#define __KSYM_REF(sym) ".quad " #sym
2224
#else
25+
#define __KSYM_ALIGN ".balign 4"
2326
#define __KSYM_REF(sym) ".long " #sym
2427
#endif
2528

@@ -42,7 +45,7 @@
4245
" .asciz \"" ns "\"" "\n" \
4346
" .previous" "\n" \
4447
" .section \"___ksymtab" sec "+" #name "\", \"a\"" "\n" \
45-
" .balign 4" "\n" \
48+
__KSYM_ALIGN "\n" \
4649
"__ksymtab_" #name ":" "\n" \
4750
__KSYM_REF(sym) "\n" \
4851
__KSYM_REF(__kstrtab_ ##name) "\n" \

0 commit comments

Comments
 (0)