public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: fix .bss with -fdata-sections
@ 2019-04-15 16:49 Sami Tolvanen
  2019-04-15 17:33 ` Nick Desaulniers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sami Tolvanen @ 2019-04-15 16:49 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, H . Peter Anvin,
	Nicholas Piggin, x86, linux-kernel
  Cc: Kees Cook, Nick Desaulniers, Sami Tolvanen

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@google.com>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-16  6:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-15 16:49 [PATCH] x86: fix .bss with -fdata-sections Sami Tolvanen
2019-04-15 17:33 ` Nick Desaulniers
2019-04-16  3:23 ` Kees Cook
2019-04-16  6:25 ` [tip:x86/urgent] x86/build/lto: Fix truncated " tip-bot for Sami Tolvanen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox