[PATCH] x86: fix .bss with -fdata-sections

From: Sami Tolvanen
Date: Mon Apr 15 2019 - 12:50:04 EST


With LD_DEAD_CODE_DATA_ELIMINATION, we compile the kernel with
-fdata-sections, which also splits the .bss section. Use the
common BSS_MAIN macro in the linker script to properly merge all
the generated sections.

Signed-off-by: Sami Tolvanen <samitolvanen@xxxxxxxxxx>
---
arch/x86/kernel/vmlinux.lds.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index bad8c51fee6e..a5127b2c195f 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -362,7 +362,7 @@ SECTIONS
.bss : AT(ADDR(.bss) - LOAD_OFFSET) {
__bss_start = .;
*(.bss..page_aligned)
- *(.bss)
+ *(BSS_MAIN)
BSS_DECRYPTED
. = ALIGN(PAGE_SIZE);
__bss_stop = .;
--
2.21.0.392.gf8f6787159e-goog