[PATCH 1/3] kbuild: Restore pattern to avoid stripping .rela.dyn from vmlinux

Nathan Chancellor posted 3 patches 2 months, 1 week ago
[PATCH 1/3] kbuild: Restore pattern to avoid stripping .rela.dyn from vmlinux
Posted by Nathan Chancellor 2 months, 1 week ago
Commit 0ce5139fd96e ("kbuild: always create intermediate
vmlinux.unstripped") removed the pattern to avoid stripping .rela.dyn
sections added by commit e9d86b8e17e7 ("scripts: Do not strip .rela.dyn
section"). Restore it so that .rela.dyn sections remain in the final
vmlinux.

Fixes: 0ce5139fd96e ("kbuild: always create intermediate vmlinux.unstripped")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Alexandre Ghiti <alexghiti@rivosinc.com>
---
 scripts/Makefile.vmlinux | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux
index 7c6ae9886f8f..a62639982be5 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*.dyn'
 
 remove-symbols := -w --strip-symbol='__mod_device_table__*'
 

-- 
2.51.0
Re: [PATCH 1/3] kbuild: Restore pattern to avoid stripping .rela.dyn from vmlinux
Posted by Ard Biesheuvel 2 months, 1 week ago
On Wed, 8 Oct 2025 at 15:47, Nathan Chancellor <nathan@kernel.org> wrote:
>
> Commit 0ce5139fd96e ("kbuild: always create intermediate
> vmlinux.unstripped") removed the pattern to avoid stripping .rela.dyn
> sections added by commit e9d86b8e17e7 ("scripts: Do not strip .rela.dyn
> section"). Restore it so that .rela.dyn sections remain in the final
> vmlinux.
>
> Fixes: 0ce5139fd96e ("kbuild: always create intermediate vmlinux.unstripped")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Acked-by: Ard Biesheuvel <ardb@kernel.org>

> ---
> Cc: Ard Biesheuvel <ardb@kernel.org>
> Cc: Alexandre Ghiti <alexghiti@rivosinc.com>
> ---
>  scripts/Makefile.vmlinux | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux
> index 7c6ae9886f8f..a62639982be5 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*.dyn'
>
>  remove-symbols := -w --strip-symbol='__mod_device_table__*'
>
>
> --
> 2.51.0
>