]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/efi: Drop EFI stub .bss from .data section
authorArd Biesheuvel <ardb@kernel.org>
Tue, 12 Sep 2023 09:00:52 +0000 (09:00 +0000)
committerIngo Molnar <mingo@kernel.org>
Fri, 15 Sep 2023 09:18:40 +0000 (11:18 +0200)
Now that the EFI stub always zero inits its BSS section upon entry,
there is no longer a need to place the BSS symbols carried by the stub
into the .data section.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20230912090051.4014114-18-ardb@google.com
arch/x86/boot/compressed/vmlinux.lds.S
drivers/firmware/efi/libstub/Makefile

index b22f34b8684a725b92c2b044f1a4efbbff959773..4ff6ab1b67d9b336d6f5872c8eca829e443444c2 100644 (file)
@@ -47,7 +47,6 @@ SECTIONS
                _data = . ;
                *(.data)
                *(.data.*)
-               *(.bss.efistub)
                _edata = . ;
        }
        . = ALIGN(L1_CACHE_BYTES);
index a1157c2a7170402922fa526d84a3353f9fbb053c..ef4c12f0877ba428f55db3510771da69b0c7cad9 100644 (file)
@@ -108,13 +108,6 @@ lib-y                              := $(patsubst %.o,%.stub.o,$(lib-y))
 # https://bugs.llvm.org/show_bug.cgi?id=46480
 STUBCOPY_FLAGS-y               += --remove-section=.note.gnu.property
 
-#
-# For x86, bootloaders like systemd-boot or grub-efi do not zero-initialize the
-# .bss section, so the .bss section of the EFI stub needs to be included in the
-# .data section of the compressed kernel to ensure initialization. Rename the
-# .bss section here so it's easy to pick out in the linker script.
-#
-STUBCOPY_FLAGS-$(CONFIG_X86)   += --rename-section .bss=.bss.efistub,load,alloc
 STUBCOPY_RELOC-$(CONFIG_X86_32)        := R_386_32
 STUBCOPY_RELOC-$(CONFIG_X86_64)        := R_X86_64_64