linux/arch/arm/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
arch_timer.c ARM: 8913/1: arch_timer: include <asm/arch_timer.h> 2019-10-27 21:14:43 +00:00
armksyms.c crypto: lib/sha1 - remove unnecessary includes of linux/cryptohash.h 2020-05-08 15:32:17 +10:00
asm-offsets.c arch: Add the macro COMPILE_OFFSETS to all the asm-offsets.c 2025-09-25 09:57:15 +02:00
atags.h ARM: 9011/1: centralize phys-to-virt conversion of DT/ATAGS address 2020-10-27 12:10:59 +00:00
atags_compat.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
atags_parse.c vgacon: clean up global screen_info instances 2023-10-17 10:17:02 +02:00
atags_proc.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
bios32.c ARM: 9454/1: kernel: bios32: use string choices helper 2025-10-02 08:44:37 +01:00
bugs.c ARM: cpu: Switch to arch_cpu_finalize_init() 2023-06-16 10:15:59 +02:00
cacheinfo.c ARM: 9440/1: cacheinfo fix format field mask 2025-01-22 20:55:01 +00:00
cpuidle.c ARM: cpuidle: Drop of_device.h include 2023-04-13 17:46:34 -05:00
crash_dump.c vmcore: convert copy_oldmem_page() to take an iov_iter 2022-04-29 14:37:59 -07:00
debug.S ARM: 9005/1: debug: Select flow control for all debug UARTs 2020-09-15 14:35:28 +01: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
dma.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
early_printk.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
efi.c vgacon: clean up global screen_info instances 2023-10-17 10:17:02 +02:00
elf.c arm32/64/elf: Split READ_IMPLIES_EXEC from executable PT_GNU_STACK 2020-04-20 19:42:19 +02:00
entry-armv.S ARM: 9430/1: entry: Do a dummy read from VMAP shadow 2024-11-13 08:15:23 +00:00
entry-common.S stackleak: Rename STACKLEAK to KSTACK_ERASE 2025-07-21 21:35:01 -07:00
entry-ftrace.S ARM: 9457/1: ftrace: Implement HAVE_FUNCTION_GRAPH_FREGS 2025-10-02 08:44:51 +01:00
entry-header.S context_tracking: Split user tracking Kconfig 2022-06-29 17:04:09 -07:00
entry-v7m.S ARM: mm: Make virt_to_pfn() a static inline 2023-05-29 11:27:08 +02:00
fiq.c ARM: 9315/1: fiq: include asm/mach/irq.h for prototypes 2023-06-19 09:36:00 +01:00
fiqasm.S
ftrace.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
head-common.S ARM: implement THREAD_INFO_IN_TASK for uniprocessor systems 2021-12-06 12:49:17 +01:00
head-inflate-data.c ARM: 9310/1: xip-kernel: add __inflate_kernel_data prototype 2023-06-19 09:35:56 +01:00
head-nommu.S ARM: mm: Make virt_to_pfn() a static inline 2023-05-29 11:27:08 +02:00
head.h ARM: 9310/1: xip-kernel: add __inflate_kernel_data prototype 2023-06-19 09:35:56 +01:00
head.S ARM: 9420/1: smp: Fix SMP for xip kernels 2024-11-12 16:38:47 +00:00
hibernate.c ARM: mm: Make virt_to_pfn() a static inline 2023-05-29 11:27:08 +02:00
hw_breakpoint.c kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
hyp-stub.S ARM: 9263/1: use .arch directives instead of assembler command line flags 2022-11-08 18:36:17 +00:00
insn.c ARM: 9078/1: Add warn suppress parameter to arm_gen_branch_link() 2021-06-07 12:56:20 +01:00
io.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
irq.c ARM: Switch to irq_get_nr_irqs() / irq_set_nr_irqs() 2024-10-16 21:56:56 +02:00
isa.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
iwmmxt.h ARM: 9029/1: Make iwmmxt.S support Clang's integrated assembler 2020-12-08 10:14:59 +00:00
iwmmxt.S ARM: 9352/1: iwmmxt: Remove support for PJ4/PJ4B cores 2024-02-26 10:16:31 +00:00
jump_label.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
kgdb.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
machine_kexec.c kexec: Consolidate machine_kexec_mask_interrupts() implementation 2024-12-11 20:32:34 +01:00
Makefile arm/paravirt: Use common code for paravirt_steal_clock() 2026-01-12 15:57:23 +01:00
module-plts.c ARM: module: Use RCU in all users of __module_text_address(). 2025-03-10 11:54:45 +01:00
module.c ARM: 9458/1: module: Ensure the override of module_arch_freeing_init() 2025-09-13 12:33:07 +01:00
opcodes.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
patch.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
perf_callchain.c perf/arm: Drop unused functions 2024-11-14 10:40:00 +01:00
perf_regs.c perf/arch: Remove perf_sample_data::regs_user_copy 2020-11-09 18:12:34 +01:00
phys2virt.S ARM: p2v: reduce p2v alignment requirement to 2 MiB 2020-10-28 16:59:43 +01:00
process.c arch: copy_thread: pass clone_flags as u64 2025-09-01 15:31:34 +02:00
psci_smp.c ARM: 9420/1: smp: Fix SMP for xip kernels 2024-11-12 16:38:47 +00:00
ptrace.c ARM: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names 2025-07-14 22:27:47 -07:00
reboot.c ARM: 9219/1: fix undeclared soft_restart 2022-07-28 15:09:17 +01:00
reboot.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
relocate_kernel.S ARM: kexec: fix oops after TLB are invalidated 2021-02-05 10:23:29 +00:00
return_address.c ARM: 9258/1: stacktrace: Make stack walk callback consistent with generic code 2022-11-08 18:36:18 +00:00
setup.c Add a new optional ",cma" suffix to the crashkernel= command line option 2025-07-19 19:08:22 -07:00
signal.c ARM: uapi: Drop PSR_ENDSTATE 2026-01-30 16:46:17 +01:00
signal.h ARM: 8920/1: share get_signal_page from signal.c to process.c 2019-10-31 16:58:53 +00:00
sigreturn_codes.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
sleep.S ARM: 9381/1: kasan: clear stale stack poison 2024-04-29 14:11:25 +01:00
smccc-call.S ARM: 9075/1: kernel: Fix interrupted SMC calls 2021-04-18 19:15:14 +01:00
smp.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
smp_scu.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
smp_tlb.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
smp_twd.c ARM: smp_twd: Remove clockevents shutdown call on offlining 2024-10-31 10:41:42 +01:00
spectre.c ARM: fix build error when BPF_SYSCALL is disabled 2022-03-08 12:53:05 -08:00
stacktrace.c ARM: 9259/1: stacktrace: Convert stacktrace to generic ARCH_STACKWALK 2022-11-14 12:00:57 +00:00
suspend.c ARM: 9358/2: Implement PAN for LPAE by TTBR0 page table walks disablement 2024-04-18 12:10:46 +01:00
swp_emulate.c ARM: 9263/1: use .arch directives instead of assembler command line flags 2022-11-08 18:36:17 +00:00
sys_arm.c ARM: 9309/1: add missing syscall prototypes 2023-06-19 09:35:55 +01:00
sys_oabi-compat.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
tcm.c ARM: mm: Make virt_to_pfn() a static inline 2023-05-29 11:27:08 +02:00
thumbee.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333 2019-06-05 17:37:06 +02:00
time.c ARM: rpc: use legacy_timer_tick 2020-10-30 21:57:05 +01:00
topology.c sched/balancing: Rename rebalance_domains() => sched_balance_domains() 2024-03-12 11:59:59 +01:00
traps.c arm: Rely on generic printing of preemption model 2025-03-17 11:23:39 +01:00
unwind.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
v7m.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
vdso.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vmcore_info.c arch, crash: move arch_crash_save_vmcoreinfo() out to file vmcore_info.c 2024-02-23 17:48:25 -08:00
vmlinux-xip.lds.S kbuild: Split .modinfo out from ELF_DETAILS 2026-02-26 11:50:19 -07:00
vmlinux.lds.S kbuild: Split .modinfo out from ELF_DETAILS 2026-02-26 11:50:19 -07:00
xscale-cp0.c ARM: iwmmxt: Use undef hook to enable coprocessor for task 2023-05-17 15:08:22 +02:00