linux/arch/mips/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
..
syscalls rseq: Implement sys_rseq_slice_yield() 2026-01-22 11:11:17 +01:00
.gitignore
Makefile arch: use always-$(KBUILD_BUILTIN) for vmlinux.lds 2025-06-07 14:38:07 +09:00
access-helper.h
asm-offsets.c arch: Add the macro COMPILE_OFFSETS to all the asm-offsets.c 2025-09-25 09:57:15 +02:00
bmips_5xxx_init.S
bmips_vec.S
branch.c
cacheinfo.c
cevt-bcm1480.c
cevt-ds1287.c
cevt-gt641xx.c
cevt-r4k.c MIPS: Move IP30 timer to request_percpu_irq() 2025-12-15 22:20:50 +01:00
cevt-sb1250.c
cevt-txx9.c
cmpxchg.c
cps-vec-ns16550.S
cps-vec.S
cpu-probe.c MIPS: Unify Loongson1 PRID_REV 2025-08-29 22:34:31 +02:00
cpu-r3k-probe.c
crash.c
crash_dump.c
csrc-bcm1480.c
csrc-ioasic.c
csrc-r4k.c
csrc-sb1250.c
early_printk.c
early_printk_8250.c
elf.c
entry.S
fpu-probe.c
fpu-probe.h
ftrace.c MIPS: ftrace: Fix memory corruption when kernel is located beyond 32 bits 2025-12-01 10:07:25 +01:00
genex.S MIPS: Fix whitespace damage in r4k_wait from VS timer fix 2025-12-01 10:34:34 +01:00
gpio_txx9.c treewide: rename GPIO set callbacks back to their original names 2025-08-07 10:07:06 +02:00
head.S
i8253.c
idle.c MIPS: Fix idle VS timer enqueue 2025-04-27 10:12:03 +02:00
irq-gt641xx.c
irq-msc01.c
irq.c
irq_txx9.c
jump_label.c
kgdb.c
kprobes.c
linux32.c
machine_kexec.c
mcount.S
mips-cm.c MIPS: CPS: Improve mips_cps_first_online_in_cluster() 2025-07-16 18:34:49 +02:00
mips-cpc.c
mips-mt-fpaff.c
mips-mt.c
mips-r2-to-r6-emul.c
module.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
octeon_switch.S
perf_event.c
perf_event_mipsxx.c mips/perf: Remove driver-specific throttle support 2025-05-21 13:57:47 +02:00
perf_regs.c
pm-cps.c
pm.c
probes-common.h
proc.c
process.c MIPS: kernel: Fix random segmentation faults 2025-11-21 13:24:05 +01:00
prom.c
ptrace.c MIPS: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names 2025-07-14 22:27:47 -07:00
ptrace32.c
r4k-bugs64.c
r4k_fpu.S
r4k_switch.S
r2300_fpu.S
r2300_switch.S
relocate.c MIPS: Work around LLVM bug when gp is used as global register variable 2026-02-09 12:49:29 +01:00
relocate_kernel.S
reset.c
rtlx-mt.c
rtlx.c
scall32-o32.S
scall64-n32.S
scall64-n64.S
scall64-o32.S
segment.c
setup.c mm.git review status for linus..mm-nonmm-stable 2026-02-12 12:13:01 -08:00
signal-common.h
signal.c
signal32.c
signal_n32.c
signal_o32.c
smp-bmips.c
smp-cps.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
smp-mt.c
smp-up.c
smp.c MIPS: SMP: Move the AP sync point before the calibration delay 2025-05-25 15:00:23 +02:00
spinlock_test.c
spram.c
stacktrace.c
sync-r4k.c
syscall.c
sysrq.c
time.c
topology.c
traps.c MIPS: rename rollback_handler with skipover_handler 2025-04-27 10:12:44 +02:00
unaligned.c
uprobes.c mips/uprobes: use kmap_local_page() in arch_uprobe_copy_ixol() 2026-01-06 16:34:27 +01:00
vdso.c
vmlinux.lds.S kbuild: Split .modinfo out from ELF_DETAILS 2026-02-26 11:50:19 -07:00
vpe-mt.c
vpe.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
watch.c