modpost: fix section mismatch check for exported init/exit sections
PATCH 1/1 modpost: fix section mismatch check for exported init/exit sections
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 <[email protected]>
---
scripts/mod/modpost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/mod/modpost.c +1 -1
@@ -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 },
Signature · 1 line
2.32.0
Quoted 5 lines · Masahiro Yamada
Since commit
f02e8a6596b7("module: Sort exported symbols"),EXPORT_SYMBOLis placed in the individual section ___ksymtab(_gpl)+<sym> (3 leading underscores, not 2).
Quoted 7 lines
Since then, modpost cannot detect the bad combination of
EXPORT_SYMBOLand __init/__exit.Fix the .fromsec to ___ksymtab*.
Fixes f02e8a6596b7 ("module: Sort exported symbols")Signed-off-by Masahiro Yamada <[email protected]>
Thanks for the patch!
Reviewed-by Nick Desaulniers <[email protected]>
Quoted 21 lines
---
scripts/mod/modpost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/mod/modpost.c +1
-2@@ -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
Signature · 2 lines
Thanks, ~Nick Desaulniers