The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <stable@xxxxxxxxxxxxxxx>. To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x 505b02957e74f0c5c4655647ccb04bdc945d18f6 # <resolve conflicts, build, test, etc.> git commit -s git send-email --to '<stable@xxxxxxxxxxxxxxx>' --in-reply-to '2023101510-cork-decade-3bfd@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: 505b02957e74 ("riscv: Remove duplicate objcopy flag") 26e7aacb83df ("riscv: Allow to downgrade paging mode from the command line") 559d1e45a16d ("riscv: Use --emit-relocs in order to move .rela.dyn in init") c2dea0bc5339 ("riscv: Check relocations at compile time") 39b33072941f ("riscv: Introduce CONFIG_RELOCATABLE") 69a90d2fe107 ("riscv: Move .rela.dyn outside of init to avoid empty relocations") f3af3b0039fe ("Merge patch series "riscv: improve link and support ARCH_WANT_LD_ORPHAN_WARN"") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 505b02957e74f0c5c4655647ccb04bdc945d18f6 Mon Sep 17 00:00:00 2001 From: Song Shuai <songshuaishuai@xxxxxxxxxxx> Date: Thu, 14 Sep 2023 17:13:34 +0800 Subject: [PATCH] riscv: Remove duplicate objcopy flag There are two duplicate `-O binary` flags when objcopying from vmlinux to Image/xipImage. RISC-V set `-O binary` flag in both OBJCOPYFLAGS in the top-level riscv Makefile and OBJCOPYFLAGS_* in the boot/Makefile, and the objcopy cmd in Kbuild would join them together. The `-O binary` flag is only needed for objcopying Image, so remove the OBJCOPYFLAGS in the top-level riscv Makefile. Fixes: c0fbcd991860 ("RISC-V: Build flat and compressed kernel images") Signed-off-by: Song Shuai <songshuaishuai@xxxxxxxxxxx> Reviewed-by: Palmer Dabbelt <palmer@xxxxxxxxxxxx> Link: https://lore.kernel.org/r/20230914091334.1458542-1-songshuaishuai@xxxxxxxxxxx Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Palmer Dabbelt <palmer@xxxxxxxxxxxx> diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index 1329e060c548..b43a6bb7e4dc 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -6,7 +6,6 @@ # for more details. # -OBJCOPYFLAGS := -O binary LDFLAGS_vmlinux := -z norelro ifeq ($(CONFIG_RELOCATABLE),y) LDFLAGS_vmlinux += -shared -Bsymbolic -z notext --emit-relocs