linux/arch/x86/boot
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
..
compressed kbuild: Split .modinfo out from ELF_DETAILS 2026-02-26 11:50:19 -07:00
startup mm.git review status for linus..mm-stable 2026-02-12 11:32:37 -08:00
.gitignore x86 boot build: make git ignore stale 'tools' directory 2025-03-24 23:09:14 -07:00
a20.c x86/boot: Clean up whitespace in a20.c 2025-11-28 20:29:52 +01:00
apm.c x86/boot: Fix comment spelling 2020-03-17 20:52:52 +01:00
bioscall.S x86/boot: Remove semicolon from "rep" prefixes 2025-04-18 09:32:57 +02:00
bitops.h x86/asm: Remove code depending on __GCC_ASM_FLAG_OUTPUTS__ 2025-09-08 15:38:06 +02:00
boot.h x86/{boot,mtrr}: Remove unused function declarations 2025-11-22 21:26:36 +01:00
cmdline.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
copy.S x86/boot: Remove semicolon from "rep" prefixes 2025-04-18 09:32:57 +02:00
cpu.c x86/cpu: Remove X86_FEATURE_NAMES 2023-05-15 20:03:08 +02:00
cpucheck.c x86/boot: Move boot_*msr helpers to asm/shared/msr.h 2025-10-30 16:29:53 +01:00
cpuflags.c x86/sev: Move GHCB page based HV communication out of startup code 2025-09-03 17:55:25 +02:00
cpuflags.h x86/boot: Do not test if AC and ID eflags are changeable on x86_64 2025-03-08 20:36:26 +01:00
ctype.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
early_serial_console.c x86: Clean up 'sizeof x' => 'sizeof(x)' 2018-10-29 07:13:28 +01:00
edd.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
genimage.sh x86/build: Fix broken copy command in genimage.sh when making isoimage 2025-02-25 21:13:33 +01:00
header.S x86/efi: Implement support for embedding SBAT data for x86 2025-06-21 13:53:44 +02:00
install.sh kbuild: Abort make on install failures 2024-07-20 13:34:54 +09:00
io.h x86/boot: Port I/O: Allow to hook up alternative helpers 2022-04-07 08:27:52 -07:00
main.c x86/boot: Clean up the arch/x86/boot/main.c code a bit 2024-05-22 09:36:49 +02:00
Makefile x86/efi: Implement support for embedding SBAT data for x86 2025-06-21 13:53:44 +02:00
memory.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
mkcpustr.c x86/cpufeatures: Generate the <asm/cpufeaturemasks.h> header based on build config 2025-03-19 11:15:11 +01:00
mtools.conf.in x86/boot: Fix make hdimage with older versions of mtools 2021-09-29 11:06:47 +02:00
pm.c x86/asm: Always set A (accessed) flag in GDT descriptors 2023-12-20 10:57:51 +01:00
pmjump.S x86/asm: Do not annotate functions with GLOBAL 2019-10-18 11:25:58 +02:00
printf.c x86/boot: Address clang -Wimplicit-fallthrough in vsprintf() 2024-05-17 09:22:56 +02:00
regs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 83 2019-05-24 17:37:52 +02:00
setup.ld x86/boot: Drop CRC-32 checksum and the build tool that generates it 2025-03-07 23:59:10 +01:00
string.c x86/asm: Remove code depending on __GCC_ASM_FLAG_OUTPUTS__ 2025-09-08 15:38:06 +02:00
string.h x86/boot: Remove unused function atou() 2024-11-07 18:08:23 +01:00
tty.c treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
version.c kbuild: build init/built-in.a just once 2022-09-29 04:40:15 +09:00
vesa.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 48 2019-05-24 17:27:13 +02:00
video-bios.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
video-mode.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
video-vesa.c sysfb: Enable boot time VESA graphic mode selection 2022-03-04 20:55:33 +01:00
video-vga.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
video.c x86/boot: Remove semicolon from "rep" prefixes 2025-04-18 09:32:57 +02:00
video.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00