summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2023-10-23 02:06:10 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-12-09 10:32:58 +0100
commitdb081efa9b8017b683230702a83e4b644a739a4d (patch)
tree18aae72f909fbee07341d35af28eb06cb999ccc6 /scripts
parenta169a023e064be3f6662aeac4c623ea08e5b6b56 (diff)
downloadlinux-db081efa9b8017b683230702a83e4b644a739a4d.tar.gz
linux-db081efa9b8017b683230702a83e4b644a739a4d.tar.bz2
linux-db081efa9b8017b683230702a83e4b644a739a4d.zip
modpost: disallow the combination of EXPORT_SYMBOL and __meminit*
[ Upstream commit a3df1526da480c089c20868b7f4d486b9f266001 ] 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> Stable-dep-of: bb43a59944f4 ("Rename .data.unlikely to .data..unlikely") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mod/modpost.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 0426c1bf3a69..c4c09e28dc90 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1176,7 +1176,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)))