Skip to content

Commit 4060bae

Browse files
nathanchanceSasha Levin
authored and
Sasha Levin
committed
modpost: Add '.ltext' and '.ltext.*' to TEXT_SECTIONS
[ Upstream commit 3975865 ] After the linked LLVM change, building ARCH=um defconfig results in a segmentation fault in modpost. Prior to commit a23e758 ("modpost: unify 'sym' and 'to' in default_mismatch_handler()"), there was a warning: WARNING: modpost: vmlinux.o(__ex_table+0x88): Section mismatch in reference to the .ltext:(unknown) WARNING: modpost: The relocation at __ex_table+0x88 references section ".ltext" which is not in the list of authorized sections. If you're adding a new section and/or if this reference is valid, add ".ltext" to the list of authorized sections to jump to on fault. This can be achieved by adding ".ltext" to OTHER_TEXT_SECTIONS in scripts/mod/modpost.c. The linked LLVM change moves global objects to the '.ltext' (and '.ltext.*' with '-ffunction-sections') sections with '-mcmodel=large', which ARCH=um uses. These sections should be handled just as '.text' and '.text.*' are, so add them to TEXT_SECTIONS. Cc: [email protected] Closes: ClangBuiltLinux/linux#1981 Link: llvm/llvm-project@4bf8a68 Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 9ca4344 commit 4060bae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/mod/modpost.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,8 @@ static void check_section(const char *modname, struct elf_info *elf,
937937

938938
#define DATA_SECTIONS ".data", ".data.rel"
939939
#define TEXT_SECTIONS ".text", ".text.*", ".sched.text", \
940-
".kprobes.text", ".cpuidle.text", ".noinstr.text"
940+
".kprobes.text", ".cpuidle.text", ".noinstr.text", \
941+
".ltext", ".ltext.*"
941942
#define OTHER_TEXT_SECTIONS ".ref.text", ".head.text", ".spinlock.text", \
942943
".fixup", ".entry.text", ".exception.text", \
943944
".coldtext", ".softirqentry.text"

0 commit comments

Comments
 (0)