linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Fix a linkage error related to CONFIG_KEXEC{,_FILE}
@ 2022-06-10 11:46 GONG, Ruiqi
  0 siblings, 0 replies; only message in thread
From: GONG, Ruiqi @ 2022-06-10 11:46 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Liao Chang, Li Zhengyu
  Cc: linux-riscv, linux-kernel, Wang Weiyang, Gong Ruiqi

Following files (currently compiled with CONFIG_KEXEC=y) are needed to
be linked with kernel/kexec_core.o (compiled with CONFIG_KEXEC_CORE=y):

  arch/riscv/kernel/kexec_relocate.o,
  arch/riscv/kernel/crash_save_regs.o,
  arch/riscv/kernel/machine_kexec.o

But CONFIG_KEXEC_CORE can also be selected by CONFIG_KEXEC_FILE
regardless of CONFIG_KEXEC, which causes the problem as the Link
specifies.

Fix this problem by changing the controling config of the above
arch/riscv/kernel/*.o to be CONFIG_KEXEC_CORE, as how some other
architectures do.

Link: https://lore.kernel.org/all/202206100324.B0KDSd1C-lkp@intel.com/
Reported-by: kernel test robot <lkp@intel.com>
Fixes: 6261586e0c91 ("RISC-V: Add kexec_file support")
Signed-off-by: GONG, Ruiqi <gongruiqi1@huawei.com>
---
 arch/riscv/kernel/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/Makefile b/arch/riscv/kernel/Makefile
index c71d6591d539..33bb60a354cd 100644
--- a/arch/riscv/kernel/Makefile
+++ b/arch/riscv/kernel/Makefile
@@ -78,7 +78,7 @@ obj-$(CONFIG_SMP) += cpu_ops_sbi.o
 endif
 obj-$(CONFIG_HOTPLUG_CPU)	+= cpu-hotplug.o
 obj-$(CONFIG_KGDB)		+= kgdb.o
-obj-$(CONFIG_KEXEC)		+= kexec_relocate.o crash_save_regs.o machine_kexec.o
+obj-$(CONFIG_KEXEC_CORE)	+= kexec_relocate.o crash_save_regs.o machine_kexec.o
 obj-$(CONFIG_KEXEC_FILE)	+= elf_kexec.o machine_kexec_file.o
 obj-$(CONFIG_CRASH_DUMP)	+= crash_dump.o
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-10  3:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-10 11:46 [PATCH] RISC-V: Fix a linkage error related to CONFIG_KEXEC{,_FILE} GONG, Ruiqi

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).