Skip to content

Commit ef178f9

Browse files
Andi KleenH. Peter Anvin
authored andcommitted
Kbuild, lto: Handle basic LTO in modpost
- Don't warn about LTO marker symbols. modpost runs before the linker, so the module is not necessarily LTOed yet. - Don't complain about .gnu.lto* sections Signed-off-by: Andi Kleen <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: H. Peter Anvin <[email protected]>
1 parent 1e64ff4 commit ef178f9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/mod/modpost.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,10 @@ static void handle_modversions(struct module *mod, struct elf_info *info,
623623

624624
switch (sym->st_shndx) {
625625
case SHN_COMMON:
626-
warn("\"%s\" [%s] is COMMON symbol\n", symname, mod->name);
626+
if (!strncmp(symname, "__gnu_lto_", sizeof("__gnu_lto_")-1)) {
627+
/* Should warn here, but modpost runs before the linker */
628+
} else
629+
warn("\"%s\" [%s] is COMMON symbol\n", symname, mod->name);
627630
break;
628631
case SHN_UNDEF:
629632
/* undefined symbol */
@@ -849,6 +852,7 @@ static const char *section_white_list[] =
849852
".xt.lit", /* xtensa */
850853
".arcextmap*", /* arc */
851854
".gnu.linkonce.arcext*", /* arc : modules */
855+
".gnu.lto*",
852856
NULL
853857
};
854858

0 commit comments

Comments
 (0)