Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/boot: Revert "Reject absolute references in .head.text"

This reverts commit

faf0ed487415 ("x86/boot: Reject absolute references in .head.text")

The startup code is checked directly for the absence of absolute symbol
references, so checking the .head.text section in the relocs tool is no
longer needed.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/20250828102202.1849035-41-ardb+git@google.com

authored by

Ard Biesheuvel and committed by
Borislav Petkov (AMD)
2578560d 296650c8

+1 -7
+1 -7
arch/x86/tools/relocs.c
··· 740 740 static int do_reloc64(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym, 741 741 const char *symname) 742 742 { 743 - int headtext = !strcmp(sec_name(sec->shdr.sh_info), ".head.text"); 744 743 unsigned r_type = ELF64_R_TYPE(rel->r_info); 745 744 ElfW(Addr) offset = rel->r_offset; 746 745 int shn_abs = (sym->st_shndx == SHN_ABS) && !is_reloc(S_REL, symname); 746 + 747 747 if (sym->st_shndx == SHN_UNDEF) 748 748 return 0; 749 749 ··· 780 780 break; 781 781 782 782 die("Invalid absolute %s relocation: %s\n", rel_type(r_type), symname); 783 - break; 784 - } 785 - 786 - if (headtext) { 787 - die("Absolute reference to symbol '%s' not permitted in .head.text\n", 788 - symname); 789 783 break; 790 784 } 791 785