linux/arch/arc/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
..
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
arc_hostlink.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
arcksyms.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
asm-offsets.c arch: Add the macro COMPILE_OFFSETS to all the asm-offsets.c 2025-09-25 09:57:15 +02:00
ctx_sw_asm.S ARC: __switch_to: move ksp to thread_info from thread_struct 2023-08-17 20:31:59 -07:00
devtree.c of/fdt: add dt_phys arg to early_init_dt_scan and early_init_dt_verify 2024-10-29 15:32:45 -05:00
disasm.c ARC: disasm: handle ARCv2 case in kprobe get/set functions 2022-04-26 09:34:42 -07:00
entry-arcv2.S ARC: Fix typos 2024-04-01 18:40:39 -07:00
entry-compact.S ARC: entry: Add more common chores to EXCEPTION_PROLOGUE 2023-08-18 10:30:07 -07:00
entry.S ARC: Fix typos 2024-04-01 18:40:39 -07:00
fpu.c ARC: fp: set FPU_STATUS.FWE to enable FPU_STATUS update on context switch 2021-08-03 18:58:33 -07:00
head.S ARC: Fix typos 2024-04-01 18:40:39 -07:00
intc-arcv2.c ARC: Switch to irq_domain_create_linear() 2025-05-16 21:06:08 +02:00
intc-compact.c ARC: Switch to irq_domain_create_linear() 2025-05-16 21:06:08 +02:00
irq.c irq: arc: avoid CONFIG_HANDLE_DOMAIN_IRQ 2021-10-25 10:05:28 +01:00
jump_label.c jump_label: make initial NOP patching the special case 2022-06-24 09:48:55 +02:00
kgdb.c ARC: pt_regs: create seperate type for ecr 2023-08-18 10:30:47 -07:00
kprobes.c ARC: Fix -Wmissing-prototypes warnings 2024-04-01 18:40:39 -07:00
Makefile arch: use always-$(KBUILD_BUILTIN) for vmlinux.lds 2025-06-07 14:38:07 +09:00
Makefile.syscalls arc: convert to generic syscall table 2024-07-10 14:23:38 +02:00
mcip.c ARC: Switch to irq_domain_create_linear() 2025-05-16 21:06:08 +02:00
module.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
perf_event.c arc/perf: Remove driver-specific throttle support 2025-05-21 13:57:45 +02:00
process.c arch: copy_thread: pass clone_flags as u64 2025-09-01 15:31:34 +02:00
ptrace.c ARC: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names 2025-07-14 22:27:46 -07:00
reset.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
setup.c ARC: Fix typos 2024-04-01 18:40:39 -07:00
signal.c ARC: Fix typos 2024-04-01 18:40:39 -07:00
smp.c smp: Consolidate smp_prepare_boot_cpu() 2024-03-04 12:01:54 +01:00
stacktrace.c ARC: -Wmissing-prototype warning fixes 2023-08-13 16:53:02 -07:00
sys.c arc: convert to generic syscall table 2024-07-10 14:23:38 +02:00
traps.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
troubleshoot.c fs: create helper file_user_path() for user displayed mapped file path 2023-10-19 11:03:15 +02:00
unaligned.c arch: remove get_task_comm() and print task comm directly 2025-01-12 20:21:15 -08:00
unaligned.h arc: get rid of private asm/unaligned.h 2024-10-02 17:22:47 -04:00
unwind.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vmlinux.lds.S kbuild: Split .modinfo out from ELF_DETAILS 2026-02-26 11:50:19 -07:00