Skip to content

Commit a3df152

Browse files
committed
modpost: disallow the combination of EXPORT_SYMBOL and __meminit*
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 <[email protected]>
1 parent 48cd8df commit a3df152

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/mod/modpost.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ static void check_export_symbol(struct module *mod, struct elf_info *elf,
11641164
ELF_ST_TYPE(sym->st_info) == STT_LOPROC)
11651165
s->is_func = true;
11661166

1167-
if (match(secname, PATTERNS(INIT_SECTIONS)))
1167+
if (match(secname, PATTERNS(ALL_INIT_SECTIONS)))
11681168
warn("%s: %s: EXPORT_SYMBOL used for init symbol. Remove __init or EXPORT_SYMBOL.\n",
11691169
mod->name, name);
11701170
else if (match(secname, PATTERNS(ALL_EXIT_SECTIONS)))

0 commit comments

Comments
 (0)