]> git.ipfire.org Git - thirdparty/linux.git/commit
x86/boot: Check startup code for absence of absolute relocations
authorArd Biesheuvel <ardb@kernel.org>
Thu, 28 Aug 2025 10:22:19 +0000 (12:22 +0200)
committerBorislav Petkov (AMD) <bp@alien8.de>
Wed, 3 Sep 2025 15:59:54 +0000 (17:59 +0200)
commit296650c8ac4f18e886dd2a606152c00adf527219
tree5d8dc5481557f5f0207c1fa067376a2c57c9d78c
parent0d6e4563fc03d83f948e6a6f7963cc31a4c81914
x86/boot: Check startup code for absence of absolute relocations

Invoke objtool on each startup code object individually to check for the
absence of absolute relocations. This is needed because this code will
be invoked from the 1:1 mapping of memory before those absolute virtual
addresses (which are derived from the kernel virtual base address
provided to the linker and possibly shifted at boot) are mapped.

Only objects built under arch/x86/boot/startup/ have this restriction,
and once they have been incorporated into vmlinux.o, this distinction is
difficult to make. So force the invocation of objtool for each object
file individually, even if objtool is deferred to vmlinux.o for the rest
of the build. In the latter case, only pass --noabs and nothing else;
otherwise, append it to the existing objtool command line.

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