]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
objtool: Add action to check for absence of absolute relocations
authorArd Biesheuvel <ardb@kernel.org>
Thu, 28 Aug 2025 10:22:18 +0000 (12:22 +0200)
committerBorislav Petkov (AMD) <bp@alien8.de>
Wed, 3 Sep 2025 15:59:51 +0000 (17:59 +0200)
commit0d6e4563fc03d83f948e6a6f7963cc31a4c81914
treebc24f8f840d956dc73d1ac740207432f929256f1
parent05ce314ba5155d57c86f8f276cb17f78ac5fb4f0
objtool: Add action to check for absence of absolute relocations

The x86 startup code must not use absolute references to code or data,
as it executes before the kernel virtual mapping is up.

Add an action to objtool to check all allocatable sections (with the
exception of __patchable_function_entries, which uses absolute
references for nebulous reasons) and raise an error if any absolute
references are found.

Note that debug sections typically contain lots of absolute references
too, but those are not allocatable so they will be ignored.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/20250828102202.1849035-39-ardb+git@google.com
tools/objtool/arch/x86/decode.c
tools/objtool/builtin-check.c
tools/objtool/check.c
tools/objtool/include/objtool/arch.h
tools/objtool/include/objtool/builtin.h