]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
objtool: Ignore __pi___cfi_ prefixed symbols
authorNathan Chancellor <nathan@kernel.org>
Mon, 8 Sep 2025 20:04:18 +0000 (13:04 -0700)
committerBorislav Petkov (AMD) <bp@alien8.de>
Tue, 9 Sep 2025 10:02:01 +0000 (12:02 +0200)
When building with CONFIG_CFI_CLANG=y after the recent series to
separate the x86 startup code, there are objtool warnings along the
lines of:

  vmlinux.o: warning: objtool: __pi___cfi_startup_64_load_idt() falls through to next function __pi_startup_64_load_idt()
  vmlinux.o: warning: objtool: __pi___cfi_startup_64_setup_gdt_idt() falls through to next function __pi_startup_64_setup_gdt_idt()
  vmlinux.o: warning: objtool: __pi___cfi___startup_64() falls through to next function __pi___startup_64()

As the comment in validate_branch() states, this is expected, so ignore
these symbols in the same way that __cfi_ and __pfx_ symbols are already
ignored for the rest of the kernel.

Fixes: 7b38dec3c5af ("x86/boot: Create a confined code area for startup code")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
tools/objtool/check.c

index d0d20666e872752760fc0b764ffdf58b5339b882..093fcd01dd6e065f9e7ef16dcd97d265c24cce06 100644 (file)
@@ -3565,6 +3565,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
                        /* Ignore KCFI type preambles, which always fall through */
                        if (!strncmp(func->name, "__cfi_", 6) ||
                            !strncmp(func->name, "__pfx_", 6) ||
+                           !strncmp(func->name, "__pi___cfi_", 11) ||
                            !strncmp(func->name, "__pi___pfx_", 11))
                                return 0;