riscv/kexec_file: Fix comment in purgatory relocator
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.
--- arch/riscv/kernel/elf_kexec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/elf_kexec.c +1 -1
@@ -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
Quoted 7 lines · Yao Zi
Apparently
sec_basedoesn't mean relocated symbol value, which seems a copy-pasting error in the comment. Assigned with the address of section indexed bysym->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")Signed-off-by Yao Zi <[email protected]>
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_basedoesn't mean relocated symbol value, which seems a copy-pasting error in the comment. Assigned with the address of section indexed bysym->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")Signed-off-by Yao Zi <[email protected]>[...]
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