--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -1896,6 +1896,13 @@ config TRIM_UNUSED_KSYMS
+@@ -1903,6 +1903,13 @@ config TRIM_UNUSED_KSYMS
If unsure, or if you need to build out-of-tree modules, say N.
config MODULES_TREE_LOOKUP
--- a/kernel/module.c
+++ b/kernel/module.c
-@@ -2997,9 +2997,11 @@ static struct module *setup_load_info(st
+@@ -3008,9 +3008,11 @@ static struct module *setup_load_info(st
static int check_modinfo(struct module *mod, struct load_info *info, int flags)
{
if (flags & MODULE_INIT_IGNORE_VERMAGIC)
modmagic = NULL;
-@@ -3020,6 +3022,7 @@ static int check_modinfo(struct module *
+@@ -3031,6 +3033,7 @@ static int check_modinfo(struct module *
mod->name);
add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK);
}
+#endif
- if (get_modinfo(info, "staging")) {
- add_taint_module(mod, TAINT_CRAP, LOCKDEP_STILL_OK);
+ check_modinfo_retpoline(mod, info);
+
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
-@@ -1982,7 +1982,9 @@ static void read_symbols(char *modname)
+@@ -1984,7 +1984,9 @@ static void read_symbols(char *modname)
symname = remove_dot(info.strtab + sym->st_name);
handle_modversions(mod, &info, sym, symname);
}
if (!is_vmlinux(modname) ||
(is_vmlinux(modname) && vmlinux_section_warnings))
-@@ -2143,8 +2145,10 @@ static void add_header(struct buffer *b,
+@@ -2145,8 +2147,10 @@ static void add_header(struct buffer *b,
buf_printf(b, "#include <linux/vermagic.h>\n");
buf_printf(b, "#include <linux/compiler.h>\n");
buf_printf(b, "\n");
buf_printf(b, "\n");
buf_printf(b, "__visible struct module __this_module\n");
buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n");
-@@ -2161,16 +2165,20 @@ static void add_header(struct buffer *b,
+@@ -2163,8 +2167,10 @@ static void add_header(struct buffer *b,
static void add_intree_flag(struct buffer *b, int is_intree)
{
+#endif
}
+ /* Cannot check for assembler */
+@@ -2177,10 +2183,12 @@ static void add_retpoline(struct buffer
+
static void add_staging_flag(struct buffer *b, const char *name)
{
+#ifndef CONFIG_MODULE_STRIPPED
}
/**
-@@ -2269,11 +2277,13 @@ static void add_depends(struct buffer *b
+@@ -2279,11 +2287,13 @@ static void add_depends(struct buffer *b
static void add_srcversion(struct buffer *b, struct module *mod)
{
}
static void write_if_changed(struct buffer *b, const char *fname)
-@@ -2509,7 +2519,9 @@ int main(int argc, char **argv)
+@@ -2520,7 +2530,9 @@ int main(int argc, char **argv)
add_staging_flag(&buf, mod->name);
err |= add_versions(&buf, mod);
add_depends(&buf, mod, modules);