]> git.itanic.dy.fi Git - linux-stable/commitdiff
modpost: disallow the combination of EXPORT_SYMBOL and __meminit*
authorMasahiro Yamada <masahiroy@kernel.org>
Sun, 22 Oct 2023 17:06:10 +0000 (02:06 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sat, 28 Oct 2023 12:31:22 +0000 (21:31 +0900)
Theoretically, we could export conditionally-discarded code sections,
such as .meminit*, if all the users can become modular under a certain
condition. However, that would be difficult to control and such a tricky
case has never occurred.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/mod/modpost.c

index 160336efedba70e0756f2d1ff879a841cbd5a5e4..f76ae0909ccd2b45c10cc1bff2d49a53f6e8c907 100644 (file)
@@ -1164,7 +1164,7 @@ static void check_export_symbol(struct module *mod, struct elf_info *elf,
            ELF_ST_TYPE(sym->st_info) == STT_LOPROC)
                s->is_func = true;
 
-       if (match(secname, PATTERNS(INIT_SECTIONS)))
+       if (match(secname, PATTERNS(ALL_INIT_SECTIONS)))
                warn("%s: %s: EXPORT_SYMBOL used for init symbol. Remove __init or EXPORT_SYMBOL.\n",
                     mod->name, name);
        else if (match(secname, PATTERNS(ALL_EXIT_SECTIONS)))