linux/arch/um/kernel
Nathan Chancellor 8678591b47
kbuild: Split .modinfo out from ELF_DETAILS
Commit 3e86e4d74c ("kbuild: keep .modinfo section in
vmlinux.unstripped") added .modinfo to ELF_DETAILS while removing it
from COMMON_DISCARDS, as it was needed in vmlinux.unstripped and
ELF_DETAILS was present in all architecture specific vmlinux linker
scripts. While this shuffle is fine for vmlinux, ELF_DETAILS and
COMMON_DISCARDS may be used by other linker scripts, such as the s390
and x86 compressed boot images, which may not expect to have a .modinfo
section. In certain circumstances, this could result in a bootloader
failing to load the compressed kernel [1].

Commit ddc6cbef3e ("s390/boot/vmlinux.lds.S: Ensure bzImage ends with
SecureBoot trailer") recently addressed this for the s390 bzImage but
the same bug remains for arm, parisc, and x86. The presence of .modinfo
in the x86 bzImage was the root cause of the issue worked around with
commit d50f210913 ("kbuild: align modinfo section for Secureboot
Authenticode EDK2 compat"). misc.c in arch/x86/boot/compressed includes
lib/decompress_unzstd.c, which in turn includes lib/xxhash.c and its
MODULE_LICENSE / MODULE_DESCRIPTION macros due to the STATIC definition.

Split .modinfo out from ELF_DETAILS into its own macro and handle it in
all vmlinux linker scripts. Discard .modinfo in the places where it was
previously being discarded from being in COMMON_DISCARDS, as it has
never been necessary in those uses.

Cc: stable@vger.kernel.org
Fixes: 3e86e4d74c ("kbuild: keep .modinfo section in vmlinux.unstripped")
Reported-by: Ed W <lists@wildgooses.com>
Closes: https://lore.kernel.org/587f25e0-a80e-46a5-9f01-87cb40cfa377@wildgooses.com/ [1]
Tested-by: Ed W <lists@wildgooses.com> # x86_64
Link: https://patch.msgid.link/20260225-separate-modinfo-from-elf-details-v1-1-387ced6baf4b@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
2026-02-26 11:50:19 -07:00
..
skas um: Fix incorrect __acquires/__releases annotations 2026-01-05 16:43:32 +01:00
asm-offsets.c Address various objtool scalability bugs/inefficiencies exposed by 2025-12-06 11:56:51 -08:00
config.c.in um: Add SPDX headers to files in arch/um/kernel/ 2019-09-15 21:37:17 +02:00
dtb.c um: Add missing trailing newline to help messages 2025-09-10 14:23:37 +02:00
dyn.lds.S kbuild: Split .modinfo out from ELF_DETAILS 2026-02-26 11:50:19 -07:00
early_printk.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
exec.c um: Stop tracking stub's PID via userspace_pid[] 2025-07-13 19:42:49 +02:00
exitcode.c proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
gprof_syms.c um: Add SPDX headers to files in arch/um/kernel/ 2019-09-15 21:37:17 +02:00
initrd.c um: Do not propagate initrd parameter to kernel 2024-10-23 09:52:49 +02:00
irq.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
kmsg_dump.c arch: um: kmsg_dump: Use console_is_usable 2025-11-27 15:54:50 +01:00
ksyms.c um: Turn signals_* into thread-local variables 2025-10-27 16:41:15 +01:00
load_file.c mm/memblock: add memblock_alloc_or_panic interface 2025-01-25 20:22:38 -08:00
Makefile um: Add initial SMP support 2025-10-27 16:41:15 +01:00
mem.c arch, mm: consolidate initialization of nodes, zones and memory map 2026-01-26 20:02:18 -08:00
physmem.c um: Remove file-based iomem emulation support 2025-10-27 16:37:12 +01:00
process.c um: Add initial SMP support 2025-10-27 16:41:15 +01:00
ptrace.c um/ptrace: Implement HAVE_SYSCALL_TRACEPOINTS 2025-07-11 08:49:02 +02:00
reboot.c um: Remove unused mm_fd field from mm_id 2024-09-12 20:36:22 +02:00
sigio.c um: Rewrite the sigio workaround based on epoll and tgkill 2025-03-20 09:28:44 +01:00
signal.c um: Drop support for hosts without SYSEMU_SINGLESTEP support 2024-01-04 23:29:11 +01:00
smp.c um: Add initial SMP support 2025-10-27 16:41:15 +01:00
stacktrace.c UML: add support for KASAN under x86_64 2022-07-17 23:35:22 +02:00
sysrq.c um: Always dump trace for specified task in show_stack 2024-11-07 18:05:22 +01:00
time.c um: Define timers on a per-CPU basis 2025-10-27 16:41:15 +01:00
tlb.c um: Add initial SMP support 2025-10-27 16:41:15 +01:00
trap.c um: Add initial SMP support 2025-10-27 16:41:15 +01:00
um_arch.c um: Add initial SMP support 2025-10-27 16:41:15 +01:00
um_arch.h um: Move declarations to proper headers 2024-04-22 21:58:48 +02:00
umid.c uml: Remove the initialization of statics to 0 2022-09-19 23:10:07 +02:00
uml.lds.S kbuild: Split .modinfo out from ELF_DETAILS 2026-02-26 11:50:19 -07:00
vmlinux.lds.S UML: define RUNTIME_DISCARD_EXIT 2023-02-13 10:14:31 +01:00