Commit 80375980 authored by Joe Mario's avatar Joe Mario Committed by H. Peter Anvin
Browse files

lto: Handle LTO common symbols in module loader

Here is the workaround I made for having the kernel not reject modules
built with -flto.  The clean solution would be to get the compiler to not
emit the symbol.  Or if it has to emit the symbol, then emit it as
initialized data but put it into a comdat/linkonce section.

Minor tweaks by AK over Joe's patch.

Cc: Rusty Russell <>
Signed-off-by: default avatarAndi Kleen <>

Signed-off-by: default avatarH. Peter Anvin <>
parent ef1b893c
......@@ -1948,6 +1948,10 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
switch (sym[i].st_shndx) {
/* Ignore common symbols */
if (!strncmp(name, "__gnu_lto", 9))
/* We compiled with -fno-common. These are not
supposed to happen. */
pr_debug("Common symbol: %s\n", name);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment