History

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.

Josh Poimboeuf committed 1 year ago

Commit 41090431 parent 6717e8f1 file · +5 −0Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/mod/modpost.c+5−0
@@ -606,6 +606,11 @@ static int ignore_undef_symbol(struct elf_info *info, const char *symname) · 605 unmodified lines
606606 strstarts(symname, "_savevr_") ||
607607 strcmp(symname, ".TOC.") == 0)
608608 return 1;
609+
610+ /* ignore linker-created section bounds variables */
611+ if (strstarts(symname, "__start_") || strstarts(symname, "__stop_"))
612+ return 1;
613+
609614 /* Do not ignore this symbol */
610615 return 0;
611616 }