From a4df2071f1a2bb5b003eb179e1a51625d26b04d5 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Mon, 20 Oct 2025 11:16:13 +0200 Subject: modpost: drop '*_probe' from section check whitelist Several symbol patterns used to be whitelisted to allow drivers to refer to functions annotated with __devinit and __devexit, which have since been removed. Commit e1dc1bfe5b27 ("modpost: remove more symbol patterns from the section check whitelist") removed most of these patterns but left '*_probe' after a reported warning in an irqchip driver. Turns out that was indeed an incorrect reference which has now been fixed by commit 9b685058ca93 ("irqchip/qcom-irq-combiner: Fix section mismatch"). A recently added clocksource driver also relies on this suffix to suppress another valid warning, and that is being fixed separately. [1] Note that drivers with valid reasons for suppressing the warnings can use the __ref macros. Link: https://lore.kernel.org/lkml/20251017054943.7195-1-johan@kernel.org/ [1] Signed-off-by: Johan Hovold Reviewed-by: Thomas Gleixner Reviewed-by: Nathan Chancellor Link: https://patch.msgid.link/20251020091613.22562-1-johan@kernel.org Signed-off-by: Nathan Chancellor --- scripts/mod/modpost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/mod') diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 755b842f1f9b..d042b355c9d6 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -958,7 +958,7 @@ static int secref_whitelist(const char *fromsec, const char *fromsym, /* symbols in data sections that may refer to any init/exit sections */ if (match(fromsec, PATTERNS(DATA_SECTIONS)) && match(tosec, PATTERNS(ALL_INIT_SECTIONS, ALL_EXIT_SECTIONS)) && - match(fromsym, PATTERNS("*_ops", "*_probe", "*_console"))) + match(fromsym, PATTERNS("*_ops", "*_console"))) return 0; /* Check for pattern 3 */ -- cgit v1.2.3 From 3cd9763ce4ad999d015cf0734e6b968cead95077 Mon Sep 17 00:00:00 2001 From: René Rebe Date: Sun, 23 Nov 2025 13:13:30 +0100 Subject: modpost: Amend ppc64 save/restfpr symnames for -Os build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Building a size optimized ppc64 kernel (-Os), gcc emits more FP save/restore symbols, that the linker generates on demand into the .sfpr section. Explicitly allow-list those in scripts/mod/modpost.c, too. They are needed for the amdgpu in-kernel floating point support. MODPOST Module.symvers ERROR: modpost: "_restfpr_20" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! ERROR: modpost: "_restfpr_26" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! ERROR: modpost: "_restfpr_22" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! ERROR: modpost: "_savegpr1_27" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! ERROR: modpost: "_savegpr1_25" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! ERROR: modpost: "_restfpr_28" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! ERROR: modpost: "_savegpr1_29" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! ERROR: modpost: "_savefpr_20" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! ERROR: modpost: "_savefpr_22" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! ERROR: modpost: "_restfpr_15" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! WARNING: modpost: suppressed 56 unresolved symbol warnings because there were too many) Signed-off-by: René Rebe Link: https://patch.msgid.link/20251123.131330.407910684435629198.rene@exactco.de Signed-off-by: Nathan Chancellor --- scripts/mod/modpost.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts/mod') diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index d042b355c9d6..0c25b5ad497b 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -602,6 +602,10 @@ static int ignore_undef_symbol(struct elf_info *info, const char *symname) /* Special register function linked on all modules during final link of .ko */ if (strstarts(symname, "_restgpr0_") || strstarts(symname, "_savegpr0_") || + strstarts(symname, "_restgpr1_") || + strstarts(symname, "_savegpr1_") || + strstarts(symname, "_restfpr_") || + strstarts(symname, "_savefpr_") || strstarts(symname, "_restvr_") || strstarts(symname, "_savevr_") || strcmp(symname, ".TOC.") == 0) -- cgit v1.2.3