ARM: module: Use module_init_layout_section() to spot init sections
authorJames Morse <james.morse@arm.com>
Tue, 1 Aug 2023 14:54:09 +0000 (14:54 +0000)
committerLuis Chamberlain <mcgrof@kernel.org>
Thu, 3 Aug 2023 20:42:02 +0000 (13:42 -0700)
commita6846234f45801441f0e31a8b37f901ef0abd2df
treeb106ac698cd6f0585659316036a77da683c34e27
parentf928f8b1a2496e7af95b860f9acf553f20f68f16
ARM: module: Use module_init_layout_section() to spot init sections

Today module_frob_arch_sections() spots init sections from their
'init' prefix, and uses this to keep the init PLTs separate from the rest.

get_module_plt() uses within_module_init() to determine if a
location is in the init text or not, but this depends on whether
core code thought this was an init section.

Naturally the logic is different.

module_init_layout_section() groups the init and exit text together if
module unloading is disabled, as the exit code will never run. The result
is kernels with this configuration can't load all their modules because
there are not enough PLTs for the combined init+exit section.

A previous patch exposed module_init_layout_section(), use that so the
logic is the same.

Fixes: 055f23b74b20 ("module: check for exit sections in layout_sections() instead of module_init_section()")
Cc: stable@vger.kernel.org
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
arch/arm/kernel/module-plts.c