summaryrefslogtreecommitdiff
path: root/kexec/arch/loongarch/kexec-elf-loongarch.c
diff options
context:
space:
mode:
Diffstat (limited to 'kexec/arch/loongarch/kexec-elf-loongarch.c')
-rw-r--r--kexec/arch/loongarch/kexec-elf-loongarch.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/kexec/arch/loongarch/kexec-elf-loongarch.c b/kexec/arch/loongarch/kexec-elf-loongarch.c
index 2bf128f..45387ca 100644
--- a/kexec/arch/loongarch/kexec-elf-loongarch.c
+++ b/kexec/arch/loongarch/kexec-elf-loongarch.c
@@ -90,6 +90,14 @@ int elf_loongarch_load(int argc, char **argv, const char *kernel_buf,
}
}
+ /* load the kernel */
+ if (info->kexec_flags & KEXEC_ON_CRASH)
+ /*
+ * offset addresses in elf header in order to load
+ * vmlinux (elf_exec) into crash kernel's memory.
+ */
+ fixup_elf_addrs(&ehdr);
+
info->entry = (void *)virt_to_phys(ehdr.e_entry);
result = elf_exec_load(&ehdr, info);