From 779c65ede6800595ec620b0b10aae7d5a5469cbd Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Wed, 23 Sep 2026 17:34:30 +0200 Subject: [PATCH] um: link .lbss/.ldata/.lrodata correctly clang 23 for me seems to put a bunch of data into these "large" sections, causing said data to not be considered kernel data by the kernel, in turn causing all kinds of strange bugs. Link the data from these sections in the right place rather than leaving them separate. Link: https://patch.msgid.link/20260923173523.3675aee4f2fc.Id8b553b971d1428abb1bd1222016758314af3098@changeid Signed-off-by: Johannes Berg --- arch/um/include/asm/common.lds.S | 2 ++ arch/um/kernel/dyn.lds.S | 2 ++ arch/um/kernel/uml.lds.S | 2 ++ 3 files changed, 6 insertions(+) diff --git a/arch/um/include/asm/common.lds.S b/arch/um/include/asm/common.lds.S index fd481ac371de..6585cb93e6eb 100644 --- a/arch/um/include/asm/common.lds.S +++ b/arch/um/include/asm/common.lds.S @@ -11,6 +11,8 @@ RO_DATA(4096) + .lrodata : { *(.lrodata .lrodata.[0-9a-zA-Z_]* .lrodata..L*) } + .unprotected : { *(.unprotected) } . = ALIGN(4096); PROVIDE (_unprotected_end = .); diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S index ad3cefeff2ac..a6b20c7953d6 100644 --- a/arch/um/kernel/dyn.lds.S +++ b/arch/um/kernel/dyn.lds.S @@ -117,6 +117,7 @@ SECTIONS .data : { INIT_TASK_DATA(KERNEL_STACK_SIZE) DATA_DATA + *(.ldata .ldata.[0-9a-zA-Z_]* .ldata..L*) *(.data.* .gnu.linkonce.d.*) SORT(CONSTRUCTORS) } @@ -159,6 +160,7 @@ SECTIONS __bss_start = .; *(.dynbss) *(.bss .bss.* .gnu.linkonce.b.*) + *(.lbss .lbss.[0-9a-zA-Z_]* .lbss..L*) *(COMMON) /* Align here to ensure that the .bss section occupies space up to _end. Align after .bss to ensure correct alignment even if the diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S index 30aa24348d60..f7ec7e7f5981 100644 --- a/arch/um/kernel/uml.lds.S +++ b/arch/um/kernel/uml.lds.S @@ -78,6 +78,7 @@ SECTIONS { INIT_TASK_DATA(KERNEL_STACK_SIZE) DATA_DATA + *(.ldata .ldata.[0-9a-zA-Z_]* .ldata..L*) *(.gnu.linkonce.d*) CONSTRUCTORS } @@ -107,6 +108,7 @@ SECTIONS PROVIDE(_bss_start = .); SBSS(0) BSS(0) + *(.lbss .lbss.[0-9a-zA-Z_]* .lbss..L*) __bss_stop = .; _end = .; PROVIDE (end = .);