summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2023-11-23 01:18:11 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-05 17:19:41 +0300
commit466e9af1550724e3c47600e26904d740a4cf2a92 (patch)
treec42651fba2688a4886874c577e34c9315e36130a /include
parent7844d7d8d8af0eed290004f5f139bc050e2d98bc (diff)
downloadlinux-466e9af1550724e3c47600e26904d740a4cf2a92.tar.xz
linux/export: Fix alignment for 64-bit ksymtab entries
[ Upstream commit f6847807c22f6944c71c981b630b9fff30801e73 ] 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: ddb5cdbafaaa ("kbuild: generate KSYMTAB entries by modpost") Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/export-internal.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/export-internal.h b/include/linux/export-internal.h
index 45fca09b2319..b842aeecef79 100644
--- a/include/linux/export-internal.h
+++ b/include/linux/export-internal.h
@@ -16,10 +16,13 @@
* and eliminates the need for absolute relocations that require runtime
* processing on relocatable kernels.
*/
+#define __KSYM_ALIGN ".balign 4"
#define __KSYM_REF(sym) ".long " #sym "- ."
#elif defined(CONFIG_64BIT)
+#define __KSYM_ALIGN ".balign 8"
#define __KSYM_REF(sym) ".quad " #sym
#else
+#define __KSYM_ALIGN ".balign 4"
#define __KSYM_REF(sym) ".long " #sym
#endif
@@ -42,7 +45,7 @@
" .asciz \"" ns "\"" "\n" \
" .previous" "\n" \
" .section \"___ksymtab" sec "+" #name "\", \"a\"" "\n" \
- " .balign 4" "\n" \
+ __KSYM_ALIGN "\n" \
"__ksymtab_" #name ":" "\n" \
__KSYM_REF(sym) "\n" \
__KSYM_REF(__kstrtab_ ##name) "\n" \