Skip to content

Commit 850d7b1

Browse files
ziyao233palmer-dabbelt
authored andcommitted
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: 838b3e2 ("RISC-V: Load purgatory in kexec_file") Signed-off-by: Yao Zi <[email protected]> Reviewed-by: Björn Töpel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Ghiti <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 9c32cda commit 850d7b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/kernel/elf_kexec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ int arch_kexec_apply_relocations_add(struct purgatory_info *pi,
390390
const Elf_Sym *sym; /* symbol to relocate */
391391
unsigned long addr; /* final location after relocation */
392392
unsigned long val; /* relocated symbol value */
393-
unsigned long sec_base; /* relocated symbol value */
393+
unsigned long sec_base; /* relocated section base address */
394394
void *loc; /* tmp location to modify */
395395

396396
sym = (void *)pi->ehdr + symtab->sh_offset;

0 commit comments

Comments
 (0)