From: Alexandre Ghiti <alex@ghiti.fr>
To: "Alexandre Ghiti" <alexghiti@rivosinc.com>,
"Paul Walmsley" <paul.walmsley@sifive.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Björn Töpel" <bjorn@rivosinc.com>,
"Masahiro Yamada" <masahiroy@kernel.org>,
"Nathan Chancellor" <nathan@kernel.org>,
"Nicolas Schier" <nicolas@fjasle.eu>,
"Ard Biesheuvel" <ardb@kernel.org>,
"Charlie Jenkins" <charlie@rivosinc.com>,
linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
linux-kbuild@vger.kernel.org
Subject: Re: [PATCH v3] scripts: Do not strip .rela.dyn section
Date: Mon, 21 Apr 2025 08:04:21 +0200 [thread overview]
Message-ID: <75e07bb8-e9e2-428f-85d7-5c5b9dc7b1c5@ghiti.fr> (raw)
In-Reply-To: <20250408072851.90275-1-alexghiti@rivosinc.com>
Hi Masahiro,
On 08/04/2025 09:28, Alexandre Ghiti wrote:
> The .rela.dyn section contains runtime relocations and is only emitted
> for a relocatable kernel.
>
> riscv uses this section to relocate the kernel at runtime but that section
> is stripped from vmlinux. That prevents kexec to successfully load vmlinux
> since it does not contain the relocations info needed.
>
> Fixes: 559d1e45a16d ("riscv: Use --emit-relocs in order to move .rela.dyn in init")
> Tested-by: Björn Töpel <bjorn@rivosinc.com>
> Reviewed-by: Björn Töpel <bjorn@rivosinc.com>
> Acked-by: Ard Biesheuvel <ardb@kernel.org>
> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> ---
>
> Changes in v3:
> - Rebase on top of 6.15-rc1
> - Change the fixes tag
>
> Changes in v2:
> - Changelog modification (Ard)
> - Remove ARCH_WANTS_RELA_DYN (Ard)
>
> scripts/Makefile.vmlinux | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux
> index b0a6cd5b818c..85d60d986401 100644
> --- a/scripts/Makefile.vmlinux
> +++ b/scripts/Makefile.vmlinux
> @@ -13,7 +13,7 @@ ifdef CONFIG_ARCH_VMLINUX_NEEDS_RELOCS
> vmlinux-final := vmlinux.unstripped
>
> quiet_cmd_strip_relocs = RSTRIP $@
> - cmd_strip_relocs = $(OBJCOPY) --remove-section='.rel*' $< $@
> + cmd_strip_relocs = $(OBJCOPY) --remove-section='.rel*' --remove-section=!'.rel*.dyn' $< $@
>
> vmlinux: $(vmlinux-final) FORCE
> $(call if_changed,strip_relocs)
Do you think you can merge that in the next rc? If not, I can merge it
if you add your AB :)
Thanks,
Alex
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2025-04-21 6:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 7:28 [PATCH v3] scripts: Do not strip .rela.dyn section Alexandre Ghiti
2025-04-21 6:04 ` Alexandre Ghiti [this message]
2025-05-08 16:52 ` patchwork-bot+linux-riscv
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=75e07bb8-e9e2-428f-85d7-5c5b9dc7b1c5@ghiti.fr \
--to=alex@ghiti.fr \
--cc=alexghiti@rivosinc.com \
--cc=ardb@kernel.org \
--cc=bjorn@rivosinc.com \
--cc=charlie@rivosinc.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=nicolas@fjasle.eu \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
/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