From mboxrd@z Thu Jan 1 00:00:00 1970 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 3F819C433EF for ; Thu, 2 Jun 2022 01:02:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232926AbiFBBCR (ORCPT ); Wed, 1 Jun 2022 21:02:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232915AbiFBBCP (ORCPT ); Wed, 1 Jun 2022 21:02:15 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 656B4258DC9; Wed, 1 Jun 2022 18:02:13 -0700 (PDT) Received: from kwepemi500014.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LD74C5FsSzjWwG; Thu, 2 Jun 2022 09:00:59 +0800 (CST) Received: from [10.67.111.227] (10.67.111.227) by kwepemi500014.china.huawei.com (7.221.188.232) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 2 Jun 2022 09:02:10 +0800 Subject: Re: [PATCH] RISCV: kexec: Fix build error without CONFIG_MODULES To: Randy Dunlap , CC: , , , , , , , References: <20220601063924.13037-1-lizhengyu3@huawei.com> From: "lizhengyu (E)" Message-ID: Date: Thu, 2 Jun 2022 09:02:09 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.111.227] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500014.china.huawei.com (7.221.188.232) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org On Wed, 01 Jun 2022 09:08:16 -0700, Randy Dunlap wrote: > Hi-- > > On 5/31/22 23:39, Li Zhengyu wrote: >> When CONFIG_MODULES is not set/enabled: >> >> ../arch/riscv/kernel/elf_kexec.c:353:9: error: unknown type name 'Elf_Rela'; did you mean 'Elf64_Rela'? >> 353 | Elf_Rela *relas; >> | ^~~~~~~~ >> | Elf64_Rela >> >> Replace Elf_Rela by Elf64_Rela to avoid relying on CONFIG_MODULES. >> > BTW, does this mean that RISC-V kexec is only available on 64BIT > and not on 32BIT? Currently, yes, CONFIG_KEXEC_FILE depends on 64BIT. Palmer is working on it, see https://lore.kernel.org/all/20220520154430.18593-1-palmer@rivosinc.com/ . > > thanks. > >> Signed-off-by: Li Zhengyu >> --- >> arch/riscv/kernel/elf_kexec.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/arch/riscv/kernel/elf_kexec.c b/arch/riscv/kernel/elf_kexec.c >> index 9cb85095fd45..0cb94992c15b 100644 >> --- a/arch/riscv/kernel/elf_kexec.c >> +++ b/arch/riscv/kernel/elf_kexec.c >> @@ -349,7 +349,7 @@ int arch_kexec_apply_relocations_add(struct purgatory_info *pi, >> { >> const char *strtab, *name, *shstrtab; >> const Elf_Shdr *sechdrs; >> - Elf_Rela *relas; >> + Elf64_Rela *relas; >> int i, r_type; >> >> /* String & section header string table */