linux-stable/scripts/mod
Nathan Chancellor 3f9ba399b0 modpost: Add '.ltext' and '.ltext.*' to TEXT_SECTIONS
commit 397586506c upstream.

After the linked LLVM change, building ARCH=um defconfig results in a
segmentation fault in modpost. Prior to commit a23e7584ec ("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: stable@vger.kernel.org
Closes: https://github.com/ClangBuiltLinux/linux/issues/1981
Link: 4bf8a68895
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-02-23 09:51:39 +01:00
..
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
Makefile modpost: Optimize symbol search from linear to binary search 2023-10-03 20:25:59 +09:00
devicetable-offsets.c Staging driver updates for 6.7-rc1 2023-11-03 15:31:04 -10:00
empty.c
file2alias.c Kbuild updates for v6.7 2023-11-04 08:07:19 -10:00
list.h modpost: import include/linux/list.h 2022-05-08 03:17:00 +09:00
mk_elfconfig.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
modpost.c modpost: Add '.ltext' and '.ltext.*' to TEXT_SECTIONS 2024-02-23 09:51:39 +01:00
modpost.h Kbuild updates for v6.7 2023-11-04 08:07:19 -10:00
sumversion.c modpost: trim leading spaces when processing source files list 2024-02-23 09:51:34 +01:00
symsearch.c modpost: Optimize symbol search from linear to binary search 2023-10-03 20:25:59 +09:00