Linux kbuild/kconfig development
 help / color / mirror / Atom feed
* [PATCH] modpost: fix section mismatch check for exported init/exit sections
@ 2022-05-30 12:52 Masahiro Yamada
  2022-06-06 21:00 ` Nick Desaulniers
  0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2022-05-30 12:52 UTC (permalink / raw)
  To: linux-kbuild
  Cc: linux-kernel, Masahiro Yamada, Alessio Igor Bogani, Michal Marek,
	Nick Desaulniers, Rusty Russell

Since commit f02e8a6596b7 ("module: Sort exported symbols"),
EXPORT_SYMBOL is placed in the individual section ___ksymtab(_gpl)+<sym>
(3 leading underscores, not 2).

Since then, modpost cannot detect the bad combination of EXPORT_SYMBOL
and __init/__exit.

Fix the .fromsec to ___ksymtab*.

Fixes: f02e8a6596b7 ("module: Sort exported symbols")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/mod/modpost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 29d5a841e215..620dc8c4c814 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -980,7 +980,7 @@ static const struct sectioncheck sectioncheck[] = {
 },
 /* Do not export init/exit functions or data */
 {
-	.fromsec = { "__ksymtab*", NULL },
+	.fromsec = { "___ksymtab*", NULL },
 	.bad_tosec = { INIT_SECTIONS, EXIT_SECTIONS, NULL },
 	.mismatch = EXPORT_TO_INIT_EXIT,
 	.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-06 21:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-30 12:52 [PATCH] modpost: fix section mismatch check for exported init/exit sections Masahiro Yamada
2022-06-06 21:00 ` Nick Desaulniers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox