linux-stable/scripts/mod
Nathan Chancellor 5953f2c7f8 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: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-02-23 09:12:38 +01:00
..
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
Makefile scripts/mod: disable LTO for empty.c 2021-01-14 08:21:09 -08:00
devicetable-offsets.c HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE() 2021-11-09 11:41:46 +01:00
empty.c
file2alias.c modpost: fix ishtp MODULE_DEVICE_TABLE built on big-endian host 2023-11-20 11:52:12 +01:00
list.h modpost: import include/linux/list.h 2022-05-08 03:17:00 +09:00
mk_elfconfig.c
modpost.c modpost: Add '.ltext' and '.ltext.*' to TEXT_SECTIONS 2024-02-23 09:12:38 +01:00
modpost.h modpost: refactor get_secindex() 2022-08-03 22:56:46 +09:00
sumversion.c modpost: trim leading spaces when processing source files list 2024-02-23 09:12:35 +01:00