* [PATCH] modpost: amend ppc symnames for -Os build
@ 2025-11-18 12:17 René Rebe
2025-11-18 14:25 ` Christophe Leroy
0 siblings, 1 reply; 3+ messages in thread
From: René Rebe @ 2025-11-18 12:17 UTC (permalink / raw)
To: linux-kbuild, linuxppc-dev
Cc: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy
Building a size optimized ppc kernel, gcc emmits more symbols than
currently allowed listed in scripts/mod/modpost.c. Add to fix:
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 <rene@exactco.de>
---
scripts/mod/modpost.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 47c8aa2a6939..133dfa16308a 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)
--
2.46.0
--
René Rebe, ExactCODE GmbH, Berlin, Germany
https://exactco.de • https://t2linux.com • https://patreon.com/renerebe
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] modpost: amend ppc symnames for -Os build
2025-11-18 12:17 [PATCH] modpost: amend ppc symnames for -Os build René Rebe
@ 2025-11-18 14:25 ` Christophe Leroy
2025-11-18 17:19 ` René Rebe
0 siblings, 1 reply; 3+ messages in thread
From: Christophe Leroy @ 2025-11-18 14:25 UTC (permalink / raw)
To: René Rebe, linux-kbuild, linuxppc-dev
Cc: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin
Hi,
Le 18/11/2025 à 13:17, René Rebe a écrit :
> [Vous ne recevez pas souvent de courriers de rene@exactco.de. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
>
> Building a size optimized ppc kernel, gcc emmits more symbols than
> currently allowed listed in scripts/mod/modpost.c. Add to fix:
You should say when the problem started to happen, and what those
functions are supposed to save and restore.
As an exemple see commit 8fe9c93e7453 ("powerpc: Add vr save/restore
functions")
Also confirm it is only needed on powerpc64, if so make it clear in the
commit message.
Christophe
>
> 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 <rene@exactco.de>
>
> ---
> scripts/mod/modpost.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 47c8aa2a6939..133dfa16308a 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)
> --
> 2.46.0
>
> --
> René Rebe, ExactCODE GmbH, Berlin, Germany
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fexactco.de%2F&data=05%7C02%7Cchristophe.leroy%40csgroup.eu%7Cbdf81becff764b00d8a708de269c7176%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C638990651958650397%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=2A4ilqQu%2BNxeycBQUMFIN6GVW3x4jkwjpIwwEzVag5w%3D&reserved=0 • https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ft2linux.com%2F&data=05%7C02%7Cchristophe.leroy%40csgroup.eu%7Cbdf81becff764b00d8a708de269c7176%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C638990651958676828%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=6toFxcnt16OW6NLOHBJEAN0DFy2UWNYV7GxZ5hqpwlQ%3D&reserved=0 • https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatreon.com%2Frenerebe&data=05%7C02%7Cchristophe.leroy%40csgroup.eu%7Cbdf81becff764b00d8a708de269c7176%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C638990651958693482%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=u1j5OGCbVwcEDwlfw0CZhTE75Sy%2BJiT4VA3OPeSebX4%3D&reserved=0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] modpost: amend ppc symnames for -Os build
2025-11-18 14:25 ` Christophe Leroy
@ 2025-11-18 17:19 ` René Rebe
0 siblings, 0 replies; 3+ messages in thread
From: René Rebe @ 2025-11-18 17:19 UTC (permalink / raw)
To: christophe.leroy; +Cc: linux-kbuild, linuxppc-dev, maddy, mpe, npiggin
Hey Christophe,
thank you for your quick review!
On Tue, 18 Nov 2025 15:25:14 +0100, Christophe Leroy <christophe.leroy@csgroup.eu> wrote:
> Le 18/11/2025 à 13:17, René Rebe a écrit :
> > [Vous ne recevez pas souvent de courriers de
> > rene@exactco.de. Découvrez pourquoi ceci est important à
> > https://aka.ms/LearnAboutSenderIdentification ]
> > Building a size optimized ppc kernel, gcc emmits more symbols than
> > currently allowed listed in scripts/mod/modpost.c. Add to fix:
>
> You should say when the problem started to happen, and what those
I guess always, or at least for a long time with -Os functions have a
certain pattern or size. Maybe the size of amdgpu and certainly the
DC_FP use triggered the floating point ones for me.
> functions are supposed to save and restore.
>
> As an exemple see commit 8fe9c93e7453 ("powerpc: Add vr save/restore
> functions")
>
> Also confirm it is only needed on powerpc64, if so make it clear in
> the commit message.
The fp ones can only occur for ppc64 right now as long as:
ARCH_HAS_KERNEL_FPU_SUPPORT if PPC64 && PPC_FPU
If the gpr ones are emitted by gcc for ppc(32) I would need to
specifically review. As it is mostly the more modern ppc64, I'll use
that for v2 then, ...
René
--
René Rebe, ExactCODE GmbH, Berlin, Germany
https://exactco.de • https://t2linux.com • https://patreon.com/renerebe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-18 17:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-18 12:17 [PATCH] modpost: amend ppc symnames for -Os build René Rebe
2025-11-18 14:25 ` Christophe Leroy
2025-11-18 17:19 ` René Rebe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox