diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h index 2d835b7dc918cb50618824dff11cb1d89ebb0022..0b4541cb4c74053c81f08e01f02c77c6b300f95e 100644 --- a/include/linux/moduleloader.h +++ b/include/linux/moduleloader.h @@ -39,6 +39,11 @@ bool module_init_section(const char *name); */ bool module_exit_section(const char *name); +/* Describes whether within_module_init() will consider this an init section + * or not. This behaviour changes with CONFIG_MODULE_UNLOAD. + */ +bool module_init_layout_section(const char *sname); + /* * Apply the given relocation to the (simplified) ELF. Return -error * or 0. diff --git a/kernel/module.c b/kernel/module.c index 23c5349a54ea75a95adc8f1fba0ff1cbe7adf282..e978debc93df3d34f93a881d21037195e3fc0c39 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -2301,7 +2301,7 @@ void *__symbol_get(const char *symbol) } EXPORT_SYMBOL_GPL(__symbol_get); -static bool module_init_layout_section(const char *sname) +bool module_init_layout_section(const char *sname) { #ifndef CONFIG_MODULE_UNLOAD if (module_exit_section(sname))