Skip to content

Commit 25e1b7b

Browse files
nathanchanceSasha Levin
authored and
Sasha Levin
committed
modpost: Add '.ltext' and '.ltext.*' to TEXT_SECTIONS
commit 3975865 upstream. 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: Greg Kroah-Hartman <[email protected]>
1 parent 1b18607 commit 25e1b7b

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
@@ -807,7 +807,8 @@ static void check_section(const char *modname, struct elf_info *elf,
807807

808808
#define DATA_SECTIONS ".data", ".data.rel"
809809
#define TEXT_SECTIONS ".text", ".text.*", ".sched.text", \
810-
".kprobes.text", ".cpuidle.text", ".noinstr.text"
810+
".kprobes.text", ".cpuidle.text", ".noinstr.text", \
811+
".ltext", ".ltext.*"
811812
#define OTHER_TEXT_SECTIONS ".ref.text", ".head.text", ".spinlock.text", \
812813
".fixup", ".entry.text", ".exception.text", \
813814
".coldtext", ".softirqentry.text"

0 commit comments

Comments
 (0)