Skip to content

Commit 5f51c5d

Browse files
ardbiesheuvelIngo Molnar
authored andcommitted
x86/efi: Drop EFI stub .bss from .data section
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 <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9fdfb15 commit 5f51c5d

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

arch/x86/boot/compressed/vmlinux.lds.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ SECTIONS
4747
_data = . ;
4848
*(.data)
4949
*(.data.*)
50-
*(.bss.efistub)
5150
_edata = . ;
5251
}
5352
. = ALIGN(L1_CACHE_BYTES);

drivers/firmware/efi/libstub/Makefile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,6 @@ lib-y := $(patsubst %.o,%.stub.o,$(lib-y))
108108
# https://bugs.llvm.org/show_bug.cgi?id=46480
109109
STUBCOPY_FLAGS-y += --remove-section=.note.gnu.property
110110

111-
#
112-
# For x86, bootloaders like systemd-boot or grub-efi do not zero-initialize the
113-
# .bss section, so the .bss section of the EFI stub needs to be included in the
114-
# .data section of the compressed kernel to ensure initialization. Rename the
115-
# .bss section here so it's easy to pick out in the linker script.
116-
#
117-
STUBCOPY_FLAGS-$(CONFIG_X86) += --rename-section .bss=.bss.efistub,load,alloc
118111
STUBCOPY_RELOC-$(CONFIG_X86_32) := R_386_32
119112
STUBCOPY_RELOC-$(CONFIG_X86_64) := R_X86_64_64
120113

0 commit comments

Comments
 (0)