diff mbox series

[1/3] x86: Include bss subsections in linker script

Message ID 20180820123220.55342-2-agraf@suse.de
State Accepted
Commit 6331cb21650f097d2310de432647b2fbe66935c3
Headers show
Series efi_loader: Fix -fdata-section fallout with bss | expand

Commit Message

Alexander Graf Aug. 20, 2018, 12:32 p.m. UTC
When we build with -fdata-sections we may end up with bss subsections. Our
linker script explicitly lists only a single consecutive bss section though.

Adapt the statement to also include subsections.

This fixes booting efi-x86_app_defconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/x86/cpu/u-boot-64.lds      | 2 +-
 arch/x86/cpu/u-boot.lds         | 2 +-
 arch/x86/lib/elf_ia32_efi.lds   | 2 +-
 arch/x86/lib/elf_x86_64_efi.lds | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

Comments

Bin Meng Aug. 21, 2018, 8:34 a.m. UTC | #1
On Mon, Aug 20, 2018 at 8:32 PM, Alexander Graf <agraf@suse.de> wrote:
> When we build with -fdata-sections we may end up with bss subsections. Our
> linker script explicitly lists only a single consecutive bss section though.
>
> Adapt the statement to also include subsections.
>
> This fixes booting efi-x86_app_defconfig.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  arch/x86/cpu/u-boot-64.lds      | 2 +-
>  arch/x86/cpu/u-boot.lds         | 2 +-
>  arch/x86/lib/elf_ia32_efi.lds   | 2 +-
>  arch/x86/lib/elf_x86_64_efi.lds | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
diff mbox series

Patch

diff --git a/arch/x86/cpu/u-boot-64.lds b/arch/x86/cpu/u-boot-64.lds
index 862aa2d35e..98c7f8e9c5 100644
--- a/arch/x86/cpu/u-boot-64.lds
+++ b/arch/x86/cpu/u-boot-64.lds
@@ -95,7 +95,7 @@  SECTIONS
 
 	.bss __rel_dyn_start (OVERLAY) : {
 		__bss_start = .;
-		*(.bss)
+		*(.bss*)
 		*(COM*)
 		. = ALIGN(4);
 		__bss_end = .;
diff --git a/arch/x86/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds
index a1cc19ce4c..a283c290ee 100644
--- a/arch/x86/cpu/u-boot.lds
+++ b/arch/x86/cpu/u-boot.lds
@@ -94,7 +94,7 @@  SECTIONS
 
 	.bss __rel_dyn_start (OVERLAY) : {
 		__bss_start = .;
-		*(.bss)
+		*(.bss*)
 		*(COM*)
 		. = ALIGN(4);
 		__bss_end = .;
diff --git a/arch/x86/lib/elf_ia32_efi.lds b/arch/x86/lib/elf_ia32_efi.lds
index 983fabbc4d..aad61e7f81 100644
--- a/arch/x86/lib/elf_ia32_efi.lds
+++ b/arch/x86/lib/elf_ia32_efi.lds
@@ -46,7 +46,7 @@  SECTIONS
 		*(.sbss)
 		*(.scommon)
 		*(.dynbss)
-		*(.bss)
+		*(.bss*)
 		*(COMMON)
 
 		/* U-Boot lists and device tree */
diff --git a/arch/x86/lib/elf_x86_64_efi.lds b/arch/x86/lib/elf_x86_64_efi.lds
index 7cad70a2e4..b436429b33 100644
--- a/arch/x86/lib/elf_x86_64_efi.lds
+++ b/arch/x86/lib/elf_x86_64_efi.lds
@@ -44,7 +44,7 @@  SECTIONS
 		*(.sbss)
 		*(.scommon)
 		*(.dynbss)
-		*(.bss)
+		*(.bss*)
 		*(COMMON)
 		*(.rel.local)