Skip to content

Commit 420b6d0

Browse files
nivedita76ardbiesheuvel
authored andcommitted
efi/arm: Remove __efistub_global annotation
Instead of using __efistub_global to force variables into the .data section, leave them in the .bss but pull the EFI stub's .bss section into .data in the linker script for the compressed kernel. Signed-off-by: Arvind Sankar <[email protected]> Reviewed-by: Ard Biesheuvel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ard Biesheuvel <[email protected]>
1 parent 685d816 commit 420b6d0

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ SECTIONS
7878
* The EFI stub always executes from RAM, and runs strictly before the
7979
* decompressor, so we can make an exception for its r/w data, and keep it
8080
*/
81-
*(.data.efistub)
81+
*(.data.efistub .bss.efistub)
8282
__pecoff_data_end = .;
8383

8484
/*

drivers/firmware/efi/libstub/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ quiet_cmd_stubcopy = STUBCPY $@
101101

102102
#
103103
# ARM discards the .data section because it disallows r/w data in the
104-
# decompressor. So move our .data to .data.efistub, which is preserved
105-
# explicitly by the decompressor linker script.
104+
# decompressor. So move our .data to .data.efistub and .bss to .bss.efistub,
105+
# which are preserved explicitly by the decompressor linker script.
106106
#
107-
STUBCOPY_FLAGS-$(CONFIG_ARM) += --rename-section .data=.data.efistub
107+
STUBCOPY_FLAGS-$(CONFIG_ARM) += --rename-section .data=.data.efistub \
108+
--rename-section .bss=.bss.efistub,load,alloc
108109
STUBCOPY_RELOC-$(CONFIG_ARM) := R_ARM_ABS

drivers/firmware/efi/libstub/efistub.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#define EFI_ALLOC_ALIGN EFI_PAGE_SIZE
2626
#endif
2727

28-
#if defined(CONFIG_ARM) || defined(CONFIG_X86)
28+
#if defined(CONFIG_X86)
2929
#define __efistub_global __section(.data)
3030
#else
3131
#define __efistub_global

0 commit comments

Comments
 (0)