Skip to content

Commit 19331e8

Browse files
nathanchancemasahir0y
authored andcommitted
modpost: Include '.text.*' in TEXT_SECTIONS
Commit 6c730bf ("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/[email protected]/ Reported-by: Vincent Donnefort <[email protected]> Reviewed-and-tested-by: Alexander Lobakin <[email protected]> Reviewed-by: Sami Tolvanen <[email protected]> Tested-by: Vincent Donnefort <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 0d24f1b commit 19331e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/mod/modpost.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,10 +822,10 @@ static void check_section(const char *modname, struct elf_info *elf,
822822
#define ALL_EXIT_SECTIONS EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS
823823

824824
#define DATA_SECTIONS ".data", ".data.rel"
825-
#define TEXT_SECTIONS ".text", ".text.unlikely", ".sched.text", \
825+
#define TEXT_SECTIONS ".text", ".text.*", ".sched.text", \
826826
".kprobes.text", ".cpuidle.text", ".noinstr.text"
827827
#define OTHER_TEXT_SECTIONS ".ref.text", ".head.text", ".spinlock.text", \
828-
".fixup", ".entry.text", ".exception.text", ".text.*", \
828+
".fixup", ".entry.text", ".exception.text", \
829829
".coldtext", ".softirqentry.text"
830830

831831
#define INIT_SECTIONS ".init.*"

0 commit comments

Comments
 (0)