From: Ard Biesheuvel Date: Tue, 8 Apr 2025 08:52:56 +0000 (+0200) Subject: x86/boot/startup: Disable objtool validation for library code X-Git-Tag: v6.16-rc1~195^2~30^2~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9fa398fe82728ee703ad2bd9cf5247df9626470;p=thirdparty%2Fkernel%2Flinux.git x86/boot/startup: Disable objtool validation for library code The library code built under arch/x86/boot/startup is not intended to be linked into vmlinux but only into the decompressor and/or the EFI stub. This means objtool validation is not needed here, and may result in false positive errors for things like missing retpolines. So disable it for all objects added to lib-y Tested-by: Chaitanya Kumar Borah Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Cc: H. Peter Anvin Cc: Kees Cook Cc: Linus Torvalds Cc: David Woodhouse Cc: Rafael J. Wysocki Cc: Len Brown Cc: Josh Poimboeuf Link: https://lore.kernel.org/r/20250408085254.836788-10-ardb+git@google.com --- diff --git a/arch/x86/boot/startup/Makefile b/arch/x86/boot/startup/Makefile index 73946a3f6b3ba..8919a1cbcb5ae 100644 --- a/arch/x86/boot/startup/Makefile +++ b/arch/x86/boot/startup/Makefile @@ -4,3 +4,9 @@ KBUILD_AFLAGS += -D__DISABLE_EXPORTS lib-$(CONFIG_X86_64) += la57toggle.o lib-$(CONFIG_EFI_MIXED) += efi-mixed.o + +# +# Disable objtool validation for all library code, which is intended +# to be linked into the decompressor or the EFI stub but not vmlinux +# +$(patsubst %.o,$(obj)/%.o,$(lib-y)): OBJECT_FILES_NON_STANDARD := y