linux/arch/openrisc/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
asm-offsets.c arch: Add the macro COMPILE_OFFSETS to all the asm-offsets.c 2025-09-25 09:57:15 +02:00
cacheinfo.c openrisc: Add cacheinfo support 2025-04-20 07:06:54 +01:00
dma.c mm/pagewalk: split walk_page_range_novma() into kernel/user parts 2025-07-09 22:42:05 -07:00
entry.S openrisc: Add support for restartable sequences 2025-01-14 17:17:16 +00:00
head.S openrisc: Fix misalignments in head.S 2024-12-10 12:04:19 +00:00
irq.c irq: openrisc: perform irqentry in entry code 2021-10-26 10:13:28 +01:00
jump_label.c openrisc: Add jump label support 2025-09-11 11:27:59 +01:00
Makefile openrisc: Add jump label support 2025-09-11 11:27:59 +01:00
Makefile.syscalls openrisc: convert to generic syscall table 2024-07-10 14:23:38 +02:00
module.c openrisc: Add R_OR1K_32_PCREL relocation type module support 2025-09-11 11:27:59 +01:00
or32_ksyms.c mm: remove unneeded includes of <asm/pgalloc.h> 2020-08-07 11:33:26 -07:00
patching.c openrisc: Add text patching API support 2025-09-11 11:27:59 +01:00
process.c arch: copy_thread: pass clone_flags as u64 2025-09-01 15:31:34 +02: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 openrisc: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names 2025-07-14 22:27:48 -07:00
setup.c openrisc: Add jump label support 2025-09-11 11:27:59 +01:00
signal.c openrisc: Add support for restartable sequences 2025-01-14 17:17:16 +00:00
smp.c openrisc: Fix IPIs on simple multicore systems 2026-01-16 16:38:56 +00:00
stacktrace.c openrisc: Fix oops caused when dumping stack 2020-08-04 10:59:45 +09:00
sync-timer.c openrisc: add tick timer multi-core sync logic 2017-11-03 14:01:16 +09:00
sys_call_table.c openrisc: convert to generic syscall table 2024-07-10 14:23:38 +02:00
time.c openrisc: Add missing prototypes for assembly called fnctions 2023-08-21 08:11:54 +01:00
traps.c openrisc: Move FPU state out of pt_regs 2024-04-15 15:20:39 +01:00
unwinder.c openrisc: unwinder: Fix grammar issue in comment 2022-06-28 17:31:24 +09:00
vmlinux.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vmlinux.lds.S kbuild: Split .modinfo out from ELF_DETAILS 2026-02-26 11:50:19 -07:00