linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] RISCV: kexec: Fix build error without CONFIG_MODULES
@ 2022-06-01  6:39 Li Zhengyu
  2022-06-01 15:59 ` Randy Dunlap
  2022-06-01 16:08 ` Randy Dunlap
  0 siblings, 2 replies; 4+ messages in thread
From: Li Zhengyu @ 2022-06-01  6:39 UTC (permalink / raw)
  To: rdunlap, palmer
  Cc: paul.walmsley, aou, liaochang1, linux-riscv, linux-kernel,
	ebiederm, kexec, linux-next

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.

Signed-off-by: Li Zhengyu <lizhengyu3@huawei.com>
---
 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 */
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] RISCV: kexec: Fix build error without CONFIG_MODULES
  2022-06-01  6:39 [PATCH] RISCV: kexec: Fix build error without CONFIG_MODULES Li Zhengyu
@ 2022-06-01 15:59 ` Randy Dunlap
  2022-06-01 16:08 ` Randy Dunlap
  1 sibling, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2022-06-01 15:59 UTC (permalink / raw)
  To: Li Zhengyu, palmer
  Cc: paul.walmsley, aou, liaochang1, linux-riscv, linux-kernel,
	ebiederm, kexec, linux-next



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.
> 
> Signed-off-by: Li Zhengyu <lizhengyu3@huawei.com>

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>

thanks.

> ---
>  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 */

-- 
~Randy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] RISCV: kexec: Fix build error without CONFIG_MODULES
  2022-06-01  6:39 [PATCH] RISCV: kexec: Fix build error without CONFIG_MODULES Li Zhengyu
  2022-06-01 15:59 ` Randy Dunlap
@ 2022-06-01 16:08 ` Randy Dunlap
  2022-06-02  1:02   ` lizhengyu (E)
  1 sibling, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2022-06-01 16:08 UTC (permalink / raw)
  To: Li Zhengyu, palmer
  Cc: paul.walmsley, aou, liaochang1, linux-riscv, linux-kernel,
	ebiederm, kexec, linux-next

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?

thanks.

> Signed-off-by: Li Zhengyu <lizhengyu3@huawei.com>
> ---
>  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 */

-- 
~Randy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] RISCV: kexec: Fix build error without CONFIG_MODULES
  2022-06-01 16:08 ` Randy Dunlap
@ 2022-06-02  1:02   ` lizhengyu (E)
  0 siblings, 0 replies; 4+ messages in thread
From: lizhengyu (E) @ 2022-06-02  1:02 UTC (permalink / raw)
  To: Randy Dunlap, palmer
  Cc: paul.walmsley, aou, liaochang1, linux-riscv, linux-kernel,
	ebiederm, kexec, linux-next


On Wed, 01 Jun 2022 09:08:16 -0700, Randy Dunlap <rdunlap@infradead.org> 
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 <lizhengyu3@huawei.com>
>> ---
>>   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 */

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-02  1:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-01  6:39 [PATCH] RISCV: kexec: Fix build error without CONFIG_MODULES Li Zhengyu
2022-06-01 15:59 ` Randy Dunlap
2022-06-01 16:08 ` Randy Dunlap
2022-06-02  1:02   ` lizhengyu (E)

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