[PATCH] nios2: ksyms: Export __divsi3_table
From: Sasha Levin
Date: Mon Oct 26 2026 - 19:45:06 EST
lib/lz4 is built with -O3, and at -O3 GCC enables -mfast-sw-div, which
expands divisions by small numbers using __divsi3_table, a lookup table
in libgcc. Without CONFIG_NIOS2_HW_DIV_SUPPORT that leaves
lz4_compress.ko with a reference modpost cannot resolve:
ERROR: modpost: lib/lz4/lz4_compress.ko: symbol '__divsi3_table' undefined!
libgcc is linked into vmlinux, so built-in code finds the table, but it
is not exported to modules. Export it next to __divsi3.
The error predates commit 2180d11e06fb ("nios2: ksyms: Declare __mulsi3
export"), which only made it visible: before that commit, modpost used
up its ten unresolved symbol reports on __mulsi3 and suppressed the rest.
Fixes: 2fc8483fdcde ("nios2: Build infrastructure")
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202610270503.NGox5O6j-lkp@xxxxxxxxx/
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
arch/nios2/kernel/nios2_ksyms.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/nios2/kernel/nios2_ksyms.c b/arch/nios2/kernel/nios2_ksyms.c
index e8710a269b398..b7152258430a6 100644
--- a/arch/nios2/kernel/nios2_ksyms.c
+++ b/arch/nios2/kernel/nios2_ksyms.c
@@ -31,6 +31,7 @@ EXPORT_SYMBOL(flush_icache_range);
DECLARE_EXPORT(__gcc_bcmp);
DECLARE_EXPORT(__divsi3);
+DECLARE_EXPORT(__divsi3_table);
DECLARE_EXPORT(__moddi3);
DECLARE_EXPORT(__modsi3);
DECLARE_EXPORT(__udivmoddi4);
base-commit: d135ab453a7400a34930bdda1ef4bdc8acfac80e
--
2.53.0