From: Josh Poimboeuf Date: Wed, 17 Sep 2025 16:03:17 +0000 (-0700) Subject: modpost: Ignore unresolved section bounds symbols X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4109043bff31f95d3da9ace33eb3c1925fd62cbd;p=thirdparty%2Fkernel%2Flinux.git modpost: Ignore unresolved section bounds symbols 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 Acked-by: Petr Mladek Tested-by: Joe Lawrence Signed-off-by: Josh Poimboeuf --- diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 47c8aa2a69392..755b842f1f9b7 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -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; }