]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
modpost: Ignore unresolved section bounds symbols
authorJosh Poimboeuf <jpoimboe@kernel.org>
Wed, 17 Sep 2025 16:03:17 +0000 (09:03 -0700)
committerJosh Poimboeuf <jpoimboe@kernel.org>
Tue, 14 Oct 2025 21:45:22 +0000 (14:45 -0700)
In preparation for klp-build livepatch module creation tooling,
suppress warnings for unresolved references to linker-generated
__start_* and __stop_* section bounds symbols.

These symbols are expected to be undefined when modpost runs, as they're
created later by the linker.

Cc: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Petr Mladek <pmladek@suse.com>
Tested-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
scripts/mod/modpost.c

index 47c8aa2a69392509b380ec6f22372232f26540da..755b842f1f9b7a32dd2bc4e6636cdf34dfd331ba 100644 (file)
@@ -606,6 +606,11 @@ static int ignore_undef_symbol(struct elf_info *info, const char *symname)
                    strstarts(symname, "_savevr_") ||
                    strcmp(symname, ".TOC.") == 0)
                        return 1;
+
+       /* ignore linker-created section bounds variables */
+       if (strstarts(symname, "__start_") || strstarts(symname, "__stop_"))
+               return 1;
+
        /* Do not ignore this symbol */
        return 0;
 }