[PATCH 1/3] um: link .lbss/.ldata/.lrodata correctly

Johannes Berg johannes at sipsolutions.net
Wed Sep 23 08:34:30 PDT 2026


From: Johannes Berg <johannes.berg at intel.com>

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.

Signed-off-by: Johannes Berg <johannes.berg at intel.com>
---
 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 = .);
-- 
2.55.0




More information about the linux-um mailing list