modpost: fix section mismatch check for exported init/exit sections
authorMasahiro Yamada <masahiroy@kernel.org>
Fri, 10 Jun 2022 18:32:30 +0000 (03:32 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jun 2022 07:03:31 +0000 (09:03 +0200)
commitbcf2087ce4de18a55c23b1985b7ba8440224b775
tree4c6d41c540a9ac7106bacff603c23efd213aacee
parentda3ee7cd2f15922ad88a7ca6deee2eafdc7cd214
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)+<sym>
(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 <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
scripts/mod/modpost.c