Skip to contentSkip to conversation

riscv/kexec_file: Fix comment in purgatory relocator

PATCH Applied Yao Zi 3 participants 3 messages Mar 26, 2025 – Jun 2, 2025 RISC-V

lore
Share & tools
lore

Yao Zi

author
#0 lore raw

PATCH 1/1 riscv/kexec_file: Fix comment in purgatory relocator

Apparently sec_base doesn't mean relocated symbol value, which seems a copy-pasting error in the comment. Assigned with the address of section indexed by sym->st_shndx, it should represent base address of the relevant section. Let's fix the comment to avoid possible confusion.

Fixes 838b3e28488f ("RISC-V: Load purgatory in kexec_file")
---
 arch/riscv/kernel/elf_kexec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/elf_kexec.c +1 -1
index 3c37661801f9..9b8ff87630f6 100644
@@ -390,7 +390,7 @@ int arch_kexec_apply_relocations_add(struct purgatory_info *pi,
 		const Elf_Sym *sym;	/* symbol to relocate */
 		unsigned long addr;	/* final location after relocation */
 		unsigned long val;	/* relocated symbol value */
-		unsigned long sec_base;	/* relocated symbol value */
+		unsigned long sec_base;	/* relocated section base address */
 		void *loc;		/* tmp location to modify */
 
 		sym = (void *)pi->ehdr + symtab->sh_offset;
Signature · 1 line
2.49.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Yao Zi

Apparently sec_base doesn't mean relocated symbol value, which seems a copy-pasting error in the comment. Assigned with the address of section indexed by sym->st_shndx, it should represent base address of the relevant section. Let's fix the comment to avoid possible confusion.

Fixes 838b3e28488f ("RISC-V: Load purgatory in kexec_file")
#2 lore raw
In reply to Yao Zi
This patch was applied to riscv/linux.git (for-next) by Alexandre Ghiti <[email protected]>:

Hello:

This patch was applied to riscv/linux.git (for-next) by Alexandre Ghiti <[email protected]>:

Quoted 9 lines · On Wed, 26 Mar 2025 07:34:51 +0000 you wrote:

Apparently sec_base doesn't mean relocated symbol value, which seems a copy-pasting error in the comment. Assigned with the address of section indexed by sym->st_shndx, it should represent base address of the relevant section. Let's fix the comment to avoid possible confusion.

Fixes 838b3e28488f ("RISC-V: Load purgatory in kexec_file")

[...]

Here is the summary with links:
- riscv/kexec_file: Fix comment in purgatory relocator

    https://git.kernel.org/riscv/c/0f6edcccfbd8

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html