From: Ard Biesheuvel <ardb@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Nicolas Schier <nsc@kernel.org>,
Alexey Gladkov <legion@kernel.org>,
Masahiro Yamada <masahiroy@kernel.org>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
Linux Kernel Functional Testing <lkft@linaro.org>
Subject: Re: [PATCH 2/3] kbuild: Add '.rel.*' strip pattern for vmlinux
Date: Fri, 10 Oct 2025 10:16:14 -0700 [thread overview]
Message-ID: <CAMj1kXH8zHwszosJVNYT=o+CfKBMz4mOp0NoxpEEDUpKm6Dcxw@mail.gmail.com> (raw)
In-Reply-To: <20251008-kbuild-fix-modinfo-regressions-v1-2-9fc776c5887c@kernel.org>
On Wed, 8 Oct 2025 at 15:47, Nathan Chancellor <nathan@kernel.org> wrote:
>
> Prior to binutils commit c12d9fa2afe ("Support objcopy
> --remove-section=.relaFOO") [1] in 2.32, stripping relocation sections
> required the trailing period (i.e., '.rel.*') to work properly.
>
> After commit 3e86e4d74c04 ("kbuild: keep .modinfo section in
> vmlinux.unstripped"), there is an error with binutils 2.31.1 or earlier
> because these sections are not properly removed:
>
> s390-linux-objcopy: st6tO8Ev: symbol `.modinfo' required but not present
> s390-linux-objcopy:st6tO8Ev: no symbols
>
> Add the old pattern to resolve this issue (along with a comment to allow
> cleaning this when binutils 2.32 or newer is the minimum supported
> version). While the aforementioned kbuild change exposes this, the
> pattern was originally changed by commit 71d815bf5dfd ("kbuild: Strip
> runtime const RELA sections correctly"), where it would still be
> incorrect with binutils older than 2.32.
>
> Fixes: 71d815bf5dfd ("kbuild: Strip runtime const RELA sections correctly")
> Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=c12d9fa2afe7abcbe407a00e15719e1a1350c2a7 [1]
> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
> Closes: https://lore.kernel.org/CA+G9fYvVktRhFtZXdNgVOL8j+ArsJDpvMLgCitaQvQmCx=hwOQ@mail.gmail.com/
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
> ---
> Cc: Ard Biesheuvel <ardb@kernel.org>
> ---
> scripts/Makefile.vmlinux | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux
> index a62639982be5..c02f85c2e241 100644
> --- a/scripts/Makefile.vmlinux
> +++ b/scripts/Makefile.vmlinux
> @@ -83,6 +83,9 @@ endif
>
> remove-section-y := .modinfo
> remove-section-$(CONFIG_ARCH_VMLINUX_NEEDS_RELOCS) += '.rel*' '!.rel*.dyn'
> +# for compatibility with binutils < 2.32
> +# https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=c12d9fa2afe7abcbe407a00e15719e1a1350c2a7
> +remove-section-$(CONFIG_ARCH_VMLINUX_NEEDS_RELOCS) += '.rel.*'
>
> remove-symbols := -w --strip-symbol='__mod_device_table__*'
>
>
> --
> 2.51.0
>
next prev parent reply other threads:[~2025-10-10 17:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-08 22:46 [PATCH 0/3] kbuild: Fixes for fallout from recent modules.builtin.modinfo series Nathan Chancellor
2025-10-08 22:46 ` [PATCH 1/3] kbuild: Restore pattern to avoid stripping .rela.dyn from vmlinux Nathan Chancellor
2025-10-10 17:13 ` Ard Biesheuvel
2025-10-08 22:46 ` [PATCH 2/3] kbuild: Add '.rel.*' strip pattern for vmlinux Nathan Chancellor
2025-10-10 17:16 ` Ard Biesheuvel [this message]
2025-10-08 22:46 ` [PATCH 3/3] s390/vmlinux.lds.S: Move .vmlinux.info to end of allocatable sections Nathan Chancellor
2025-10-09 11:37 ` Alexander Gordeev
2025-10-09 19:44 ` [PATCH 0/3] kbuild: Fixes for fallout from recent modules.builtin.modinfo series Nicolas Schier
2025-10-10 7:19 ` Alexey Gladkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMj1kXH8zHwszosJVNYT=o+CfKBMz4mOp0NoxpEEDUpKm6Dcxw@mail.gmail.com' \
--to=ardb@kernel.org \
--cc=legion@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkft@linaro.org \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).