]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
efi/arm: Remove __efistub_global annotation
authorArvind Sankar <nivedita@alum.mit.edu>
Thu, 16 Apr 2020 15:12:25 +0000 (11:12 -0400)
committerArd Biesheuvel <ardb@kernel.org>
Fri, 24 Apr 2020 12:52:16 +0000 (14:52 +0200)
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 <nivedita@alum.mit.edu>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20200416151227.3360778-2-nivedita@alum.mit.edu
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
arch/arm/boot/compressed/vmlinux.lds.S
drivers/firmware/efi/libstub/Makefile
drivers/firmware/efi/libstub/efistub.h

index b247f399de711b36a98f9945d51231797e248659..b6793c7932a9d1e55b8d2e2b81b2ceb943901093 100644 (file)
@@ -78,7 +78,7 @@ SECTIONS
      * The EFI stub always executes from RAM, and runs strictly before the
      * decompressor, so we can make an exception for its r/w data, and keep it
      */
-    *(.data.efistub)
+    *(.data.efistub .bss.efistub)
     __pecoff_data_end = .;
 
     /*
index 9a712a6e2f8740c95ab61e049938309599361fda..aa3ab9a4105ece957fd86e13f3ae20a59dcf9d2b 100644 (file)
@@ -101,8 +101,9 @@ quiet_cmd_stubcopy = STUBCPY $@
 
 #
 # ARM discards the .data section because it disallows r/w data in the
-# decompressor. So move our .data to .data.efistub, which is preserved
-# explicitly by the decompressor linker script.
+# decompressor. So move our .data to .data.efistub and .bss to .bss.efistub,
+# which are preserved explicitly by the decompressor linker script.
 #
-STUBCOPY_FLAGS-$(CONFIG_ARM)   += --rename-section .data=.data.efistub
+STUBCOPY_FLAGS-$(CONFIG_ARM)   += --rename-section .data=.data.efistub \
+                                  --rename-section .bss=.bss.efistub,load,alloc
 STUBCOPY_RELOC-$(CONFIG_ARM)   := R_ARM_ABS
index 2a0698d9dc780fb166d0f0ce2803b853fed3f555..96e25b17c88e324193b3378a0cad9ae9433b6ca0 100644 (file)
@@ -25,7 +25,7 @@
 #define EFI_ALLOC_ALIGN                EFI_PAGE_SIZE
 #endif
 
-#if defined(CONFIG_ARM) || defined(CONFIG_X86)
+#if defined(CONFIG_X86)
 #define __efistub_global       __section(.data)
 #else
 #define __efistub_global