From nobody Tue Apr 28 05:10:03 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B8FEC433EF for ; Mon, 6 Jun 2022 03:57:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229702AbiFFD47 (ORCPT ); Sun, 5 Jun 2022 23:56:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229679AbiFFD4t (ORCPT ); Sun, 5 Jun 2022 23:56:49 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74C5194197 for ; Sun, 5 Jun 2022 20:56:45 -0700 (PDT) Received: from kwepemi500013.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4LGfmq2KDvzKmJG; Mon, 6 Jun 2022 11:56:27 +0800 (CST) Received: from M910t (10.110.54.157) by kwepemi500013.china.huawei.com (7.221.188.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 6 Jun 2022 11:56:42 +0800 Date: Mon, 6 Jun 2022 11:56:35 +0800 From: Changbin Du To: Paul Walmsley , Palmer Dabbelt , Albert Ou CC: Changbin Du , Hui Wang , , , Subject: [PATCH] riscv: kexec: build {kexec_relocate,crash_save_regs,machine_kexec}.c as kexec core files Message-ID: <20220606035635.o52ja3bjpru3fqcf@M910t> MIME-Version: 1.0 Content-Disposition: inline X-Originating-IP: [10.110.54.157] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500013.china.huawei.com (7.221.188.120) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This fixes below linking errors when building with CONFIG_KEXEC_FILE=3Dy && CONFIG_KEXEC=3Dn. The {kexec_relocate,crash_save_regs,machine_kexec}.c shou= ld be core kexec source files. riscv64-linux-gnu-ld: kernel/kexec_core.o: in function `kimage_free': /home/changbin/work/linux-riscv/kernel/kexec_core.c:651: undefined referenc= e to `machine_kexec_cleanup' riscv64-linux-gnu-ld: kernel/kexec_core.o: in function `__crash_kexec': /home/changbin/work/linux-riscv/kernel/kexec_core.c:981: undefined referenc= e to `machine_crash_shutdown' riscv64-linux-gnu-ld: /home/changbin/work/linux-riscv/kernel/kexec_core.c:9= 82: undefined reference to `machine_kexec' riscv64-linux-gnu-ld: kernel/kexec_core.o: in function `crash_setup_regs': /home/changbin/work/linux-riscv/./arch/riscv/include/asm/kexec.h:35: undefi= ned reference to `riscv_crash_save_regs' riscv64-linux-gnu-ld: kernel/kexec_core.o: in function `kernel_kexec': /home/changbin/work/linux-riscv/kernel/kexec_core.c:1200: undefined referen= ce to `machine_shutdown' riscv64-linux-gnu-ld: /home/changbin/work/linux-riscv/kernel/kexec_core.c:1= 204: undefined reference to `machine_kexec' riscv64-linux-gnu-ld: kernel/kexec_file.o: in function `__do_sys_kexec_file= _load': /home/changbin/work/linux-riscv/kernel/kexec_file.c:363: undefined referenc= e to `machine_kexec_prepare' riscv64-linux-gnu-ld: /home/changbin/work/linux-riscv/kernel/kexec_file.c:3= 63: undefined reference to `machine_kexec_prepare' make: *** [Makefile:1160: vmlinux] Error 1 Signed-off-by: Changbin Du --- 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) +=3D cpu_ops_sbi.o endif obj-$(CONFIG_HOTPLUG_CPU) +=3D cpu-hotplug.o obj-$(CONFIG_KGDB) +=3D kgdb.o -obj-$(CONFIG_KEXEC) +=3D kexec_relocate.o crash_save_regs.o machine_kexec= .o +obj-$(CONFIG_KEXEC_CORE) +=3D kexec_relocate.o crash_save_regs.o machine_k= exec.o obj-$(CONFIG_KEXEC_FILE) +=3D elf_kexec.o machine_kexec_file.o obj-$(CONFIG_CRASH_DUMP) +=3D crash_dump.o =20 --=20 2.26.2 --=20 Cheers, Changbin Du