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 .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
access-helper.h MIPS: Fix new sparse warnings 2021-04-07 16:11:05 +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
bmips_5xxx_init.S MIPS: BCM5xxx: Remove dead init_fpu code 2018-11-08 11:20:57 -08:00
bmips_vec.S
branch.c MIPS: kernel: include probes-common.h header in branch.c 2020-09-21 22:14:24 +02:00
cacheinfo.c drivers: base: cacheinfo: Get rid of DEFINE_SMP_CALL_CACHE_FUNCTION() 2021-09-01 10:29:10 +02:00
cevt-bcm1480.c MIPS: Fix the wrong format specifier 2025-01-11 12:33:01 +01:00
cevt-ds1287.c MIPS: cevt-ds1287: Add missing ds1287.h include 2025-02-27 10:46:30 +01:00
cevt-gt641xx.c MIPS: Replace setup_irq() by request_irq() 2020-03-05 16:47:35 +01:00
cevt-r4k.c MIPS: Move IP30 timer to request_percpu_irq() 2025-12-15 22:20:50 +01:00
cevt-sb1250.c MIPS: Replace setup_irq() by request_irq() 2020-03-05 16:47:35 +01:00
cevt-txx9.c mips: kernel: convert comma to semicolon 2020-12-28 22:32:28 +01:00
cmpxchg.c MIPS: export __cmpxchg_small() 2024-10-23 18:10:24 +02:00
cps-vec-ns16550.S mips: Add CPS_NS16550_WIDTH config 2020-05-22 09:12:52 +02:00
cps-vec.S MIPS: CPS: Introduce struct cluster_boot_config 2025-02-21 10:19:34 +01:00
cpu-probe.c MIPS: Unify Loongson1 PRID_REV 2025-08-29 22:34:31 +02:00
cpu-r3k-probe.c mips: move cache declarations into header 2023-12-10 17:21:41 -08:00
crash.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
crash_dump.c vmcore: convert copy_oldmem_page() to take an iov_iter 2022-04-29 14:37:59 -07:00
csrc-bcm1480.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
csrc-ioasic.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
csrc-r4k.c Revert "MIPS: csrc-r4k: Apply verification clocksource flags" 2024-08-25 15:26:30 -07:00
csrc-sb1250.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
early_printk.c mips: unify prom_putchar() declarations 2018-07-17 09:40:17 -07:00
early_printk_8250.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 1 2019-05-21 11:28:39 +02:00
elf.c MIPS: Implement ieee754 NAN2008 emulation mode 2024-07-12 13:09:25 +02:00
entry.S MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
fpu-probe.c MIPS: Implement ieee754 NAN2008 emulation mode 2024-07-12 13:09:25 +02:00
fpu-probe.h MIPS: cpu-probe: move fpu probing/handling into its own file 2020-10-12 12:04:50 +02:00
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 MIPS: Add a blank line after __HEAD 2025-01-11 12:32:12 +01:00
i8253.c MIPS: Replace setup_irq() by request_irq() 2020-03-05 16:47:35 +01:00
idle.c MIPS: Fix idle VS timer enqueue 2025-04-27 10:12:03 +02:00
irq-gt641xx.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 1 2019-05-21 11:28:39 +02:00
irq-msc01.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
irq.c MIPS: Only use current_stack_pointer on GCC 2022-03-14 15:02:53 +01:00
irq_txx9.c MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
jump_label.c MIPS: jump_label: Fix compat branch range check 2022-11-11 15:46:03 +01:00
kgdb.c MIPS: kernel: Drop kgdb_call_nmi_hook 2021-02-15 12:23:54 +01:00
kprobes.c MIPS: Fix typos 2024-01-08 10:39:12 +01:00
linux32.c mips: add asm/syscalls.h header 2023-12-10 17:21:38 -08:00
machine_kexec.c mips: kexec: include linux/reboot.h 2023-12-10 17:21:42 -08:00
Makefile arch: use always-$(KBUILD_BUILTIN) for vmlinux.lds 2025-06-07 14:38:07 +09:00
mcount.S mips: replace #include <asm/export.h> with #include <linux/export.h> 2023-08-15 10:22:23 +02:00
mips-cm.c MIPS: CPS: Improve mips_cps_first_online_in_cluster() 2025-07-16 18:34:49 +02:00
mips-cpc.c mips: cpc: Fix refcount leak in mips_cpc_default_phys_base 2022-04-26 15:11:25 +02:00
mips-mt-fpaff.c mips: add asm/syscalls.h header 2023-12-10 17:21:38 -08:00
mips-mt.c MIPS: kernel: Rename read/write_c0_ecc to read/writec0_errctl 2025-01-11 12:31:21 +01:00
mips-r2-to-r6-emul.c MIPS: Fix build error due to PTR used in more places 2022-01-27 09:04:19 +01:00
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 mips: remove unneeded #include <asm/export.h> 2023-08-15 10:22:23 +02:00
perf_event.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
perf_event_mipsxx.c mips/perf: Remove driver-specific throttle support 2025-05-21 13:57:47 +02:00
perf_regs.c MIPS: kernel: Support extracting off-line stack traces from user-space with perf 2021-02-04 21:55:45 +01:00
pm-cps.c MIPS: CPS: Introduce struct cluster_boot_config 2025-02-21 10:19:34 +01:00
pm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
probes-common.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
proc.c MIPS: kernel: proc: Use str_yes_no() helper function 2024-11-12 15:46:20 +01:00
process.c MIPS: kernel: Fix random segmentation faults 2025-11-21 13:24:05 +01:00
prom.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
ptrace.c MIPS: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names 2025-07-14 22:27:47 -07:00
ptrace32.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
r4k-bugs64.c mips: add missing declarations for trap handlers 2023-12-10 17:21:38 -08:00
r4k_fpu.S mips: replace #include <asm/export.h> with #include <linux/export.h> 2023-08-15 10:22:23 +02:00
r4k_switch.S Kbuild: rename CC_STACKPROTECTOR[_STRONG] config variables 2018-06-14 12:21:18 +09:00
r2300_fpu.S mips: replace #include <asm/export.h> with #include <linux/export.h> 2023-08-15 10:22:23 +02:00
r2300_switch.S mips: remove unneeded #include <asm/export.h> 2023-08-15 10:22:23 +02:00
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 MIPS: Fix typos 2024-01-08 10:39:12 +01:00
reset.c mips: Use do_kernel_power_off() 2022-05-19 19:30:31 +02:00
rtlx-mt.c mips: mt: make mt_class constant 2024-03-07 17:18:50 +01:00
rtlx.c vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
scall32-o32.S MIPS: Export syscall stack arguments properly for remote use 2025-02-13 12:41:18 +01:00
scall64-n32.S MIPS: scall: Save thread_info.syscall unconditionally on entry 2024-04-09 16:52:21 +02:00
scall64-n64.S MIPS: scall: Save thread_info.syscall unconditionally on entry 2024-04-09 16:52:21 +02:00
scall64-o32.S MIPS: scall: Save thread_info.syscall unconditionally on entry 2024-04-09 16:52:21 +02:00
segment.c mips: kernel: convert to DEFINE_SHOW_ATTRIBUTE 2022-09-19 16:40:17 +02:00
setup.c mm.git review status for linus..mm-nonmm-stable 2026-02-12 12:13:01 -08:00
signal-common.h mips: signal: move sigcontext declarations to header 2023-12-10 17:21:39 -08:00
signal.c Just cleanups and fixes 2024-01-17 11:20:50 -08:00
signal32.c mips: add asm/syscalls.h header 2023-12-10 17:21:38 -08:00
signal_n32.c mips: signal: move sigcontext declarations to header 2023-12-10 17:21:39 -08:00
signal_o32.c mips: add asm/syscalls.h header 2023-12-10 17:21:38 -08:00
smp-bmips.c mips: bmips: enable RAC on BMIPS4350 2024-06-27 10:44:36 +02:00
smp-cps.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
smp-mt.c MIPS: Rework smt cmdline parameters 2023-06-09 10:34:14 +02:00
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 mips: kernel: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe() 2021-03-14 14:09:49 +01:00
spram.c MIPS: kernel: Rename read/write_c0_ecc to read/writec0_errctl 2025-01-11 12:31:21 +01:00
stacktrace.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
sync-r4k.c MIPS: sync-r4k: Rework based on x86 tsc_sync 2024-07-03 16:50:12 +02:00
syscall.c mips: add asm/syscalls.h header 2023-12-10 17:21:38 -08:00
sysrq.c tty: sysrq: switch sysrq handlers from int to u8 2023-07-25 19:21:03 +02:00
time.c MIPS: Fix CP0 counter erratum detection for R4k CPUs 2022-04-29 15:52:00 +02:00
topology.c drivers/base/node: consolidate node device subsystem initialization in node_dev_init() 2022-03-22 15:57:10 -07:00
traps.c MIPS: rename rollback_handler with skipover_handler 2025-04-27 10:12:44 +02:00
unaligned.c mips: add missing declarations for trap handlers 2023-12-10 17:21:38 -08:00
uprobes.c mips/uprobes: use kmap_local_page() in arch_uprobe_copy_ixol() 2026-01-06 16:34:27 +01:00
vdso.c MIPS: vdso: Switch to generic storage implementation 2025-02-21 09:54:02 +01:00
vmlinux.lds.S kbuild: Split .modinfo out from ELF_DETAILS 2026-02-26 11:50:19 -07:00
vpe-mt.c MIPS: Implement microMIPS MT ASE helpers 2024-02-23 10:13:47 +01:00
vpe.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
watch.c MIPS: Use fallthrough for arch/mips 2020-05-07 11:55:47 +02:00