]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
modpost: Include '.text.*' in TEXT_SECTIONS
authorNathan Chancellor <nathan@kernel.org>
Tue, 13 Dec 2022 18:35:29 +0000 (11:35 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:51:43 +0000 (19:51 +0100)
commit973cfc7ea3f6c2589061e1ce50b9551f0137caf1
tree091d9780e257e657a610dad551cca38d1a2840d6
parentd0f2889ec52b19df381a57dffb2917586eb48948
modpost: Include '.text.*' in TEXT_SECTIONS

[ Upstream commit 19331e84c3873256537d446afec1f6c507f8c4ef ]

Commit 6c730bfc894f ("modpost: handle -ffunction-sections") added
".text.*" to the OTHER_TEXT_SECTIONS macro to fix certain section
mismatch warnings. Unfortunately, this makes it impossible for modpost
to warn about section mismatches with LTO, which implies
'-ffunction-sections', as all functions are put in their own
'.text.<func_name>' sections, which may still reference functions in
sections they are not supposed to, such as __init.

Fix this by moving ".text.*" into TEXT_SECTIONS, so that configurations
with '-ffunction-sections' will see warnings about mismatched sections.

Link: https://lore.kernel.org/Y39kI3MOtVI5BAnV@google.com/
Reported-by: Vincent Donnefort <vdonnefort@google.com>
Reviewed-and-tested-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Tested-by: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Stable-dep-of: 7912405643a1 ("modpost: Add .irqentry.text to OTHER_SECTIONS")
Signed-off-by: Sasha Levin <sashal@kernel.org>
scripts/mod/modpost.c