[PATCH 1/2] modpost: don't add warnings for LTO-generated symbols
From: Arnd Bergmann
Date: Mon Feb 05 2018 - 10:14:10 EST
WARNING: vmlinux.o(.data+0x12e0): Section mismatch in reference from the variable pfkey_net_ops.lto_priv.2992 to the function .init.text:pfkey_net_init.lto_priv.2977()
The variable pfkey_net_ops.lto_priv.2992 references
the function __init pfkey_net_init.lto_priv.2977()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
---
scripts/mod/modpost.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index f75224d59294..8a8a473cee08 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1027,7 +1027,7 @@ static const struct sectioncheck sectioncheck[] = {
.bad_tosec = { INIT_SECTIONS, NULL },
.mismatch = DATA_TO_ANY_INIT,
.symbol_white_list = {
- "*_template", "*_timer", "*_sht", "*_ops",
+ "*_template", "*_timer", "*_sht", "*_ops", "*_ops.lto_priv*",
"*_probe", "*_probe_one", "*_console", NULL
},
},
--
2.9.0