From: Masahiro Yamada Date: Fri, 10 Jun 2022 18:32:30 +0000 (+0900) Subject: modpost: fix section mismatch check for exported init/exit sections X-Git-Tag: v5.15.73~2731 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bcf2087ce4de18a55c23b1985b7ba8440224b775;p=platform%2Fkernel%2Flinux-rpi.git modpost: fix section mismatch check for exported init/exit sections commit 28438794aba47a27e922857d27b31b74e8559143 upstream. Since commit f02e8a6596b7 ("module: Sort exported symbols"), EXPORT_SYMBOL* is placed in the individual section ___ksymtab(_gpl)+ (3 leading underscores instead of 2). Since then, modpost cannot detect the bad combination of EXPORT_SYMBOL and __init/__exit. Fix the .fromsec field. Fixes: f02e8a6596b7 ("module: Sort exported symbols") Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers Signed-off-by: Greg Kroah-Hartman --- diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 94041ee..b284ee0 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1108,7 +1108,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 },