From 21e95723aa631b1eb5f618c8cf6061226d2a7d05 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Tue, 18 Mar 2025 21:04:38 +0000 Subject: [PATCH] final CFI hacks --- arch/x86/kernel/machine_kexec_64.c | 4 +++- tools/objtool/elf.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index e1f5fc858aee2..c24b84a03005a 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86/kernel/machine_kexec_64.c @@ -453,9 +453,11 @@ void machine_kexec(struct kimage *image) * Take advantage of this here by force loading the segments, * before the GDT is zapped with an invalid value. */ - load_segments(); + // load_segments(); /* now call it */ + printk("About to call relocate_kernel at %lx, CFI info %x\n", + (unsigned long)relocate_kernel_ptr, *(unsigned int *) (((void *)relocate_kernel_ptr) - 0xf)); image->start = relocate_kernel_ptr((unsigned long)image->head, virt_to_phys(control_page), image->start, diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index 6f64d611faea9..cd9321b99fcd5 100644 --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c @@ -898,7 +898,7 @@ struct reloc *elf_init_reloc_text_sym(struct elf *elf, struct section *sec, if (!(insn_sec->sh.sh_flags & SHF_EXECINSTR)) { WARN("bad call to %s() for data symbol %s", __func__, sym->name); - return NULL; + //return NULL; } if (!sym) { -- 2.50.1