Re: next-20251002: S390: gcc-8-defconfig: symbol `.modinfo' required but not present - no symbols

From: Heiko Carstens
Date: Wed Oct 08 2025 - 07:33:56 EST


Hi Nathan,

On Tue, Oct 07, 2025 at 08:18:49PM -0700, Nathan Chancellor wrote:
> On Mon, Oct 06, 2025 at 04:41:19PM -0700, Nathan Chancellor wrote:
> ...
> > > > ### Build error log
> > > > s390x-linux-gnu-ld: .tmp_vmlinux1: warning: allocated section `.got.plt' not in segment
> > > > s390x-linux-gnu-ld: .tmp_vmlinux2: warning: allocated section `.got.plt' not in segment
> > > > s390x-linux-gnu-ld: vmlinux.unstripped: warning: allocated section `.got.plt' not in segment
> > > > s390x-linux-gnu-objcopy: vmlinux: warning: allocated section `.got.plt' not in segment
> > > > s390x-linux-gnu-objcopy: stM7JmYX: warning: allocated section `.got.plt' not in segment
>
> So these warnings should be fixed with:

...

> I am unsure why newer binutils does not show this but I did not care
> enough to actually bisect.
>
> > > > s390x-linux-gnu-objcopy: stM7JmYX: symbol `.modinfo' required but not present
> > > > s390x-linux-gnu-objcopy:stM7JmYX: no symbols
>
> I did bisect binutils to figure out that commit c12d9fa2afe ("Support
> objcopy --remove-section=.relaFOO") [1] in binutils 2.32 resolves this
> error.
>
> I can fix this for those older binutils with:
>
> diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux
> index 7c6ae9886f8f..9ea92c3317dc 100644
> --- a/scripts/Makefile.vmlinux
> +++ b/scripts/Makefile.vmlinux
> @@ -82,7 +82,7 @@ endif
> # ---------------------------------------------------------------------------
>
> remove-section-y := .modinfo
> -remove-section-$(CONFIG_ARCH_VMLINUX_NEEDS_RELOCS) += '.rel*'
> +remove-section-$(CONFIG_ARCH_VMLINUX_NEEDS_RELOCS) += '.rel*' '.rel.*'
>
> remove-symbols := -w --strip-symbol='__mod_device_table__*'
>
> I can send a patch series tomorrow.

Thank you for figuring this out. Highly appreciated!