This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 9fb8a17d494 boards/qemu-intel64/qemu.ld: add .lbss, .ldata and 
.lrodata to approriate sections
9fb8a17d494 is described below

commit 9fb8a17d49411663a74d1741b87cbd322d486f72
Author: p-szafonimateusz <p-szafonimate...@xiaomi.com>
AuthorDate: Mon May 5 12:09:26 2025 +0200

    boards/qemu-intel64/qemu.ld: add .lbss, .ldata and .lrodata to approriate 
sections
    
    These sections can be emited by gcc in some cases for huge data blocks.
    For  example huge global static uninitialzied arrays can be placed in .lbss 
section
    which can mess NuttX memory organization and cause hard to find bugs.
    Unfortunately this is not well documented in GCC and all we have is this 
bug report:
    https://sourceware.org/bugzilla/show_bug.cgi?id=22553
    
    Signed-off-by: p-szafonimateusz <p-szafonimate...@xiaomi.com>
---
 boards/x86_64/intel64/qemu-intel64/scripts/qemu-kernel.ld | 3 +++
 boards/x86_64/intel64/qemu-intel64/scripts/qemu.ld        | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/boards/x86_64/intel64/qemu-intel64/scripts/qemu-kernel.ld 
b/boards/x86_64/intel64/qemu-intel64/scripts/qemu-kernel.ld
index 341bc0c44e5..7a1c77f6085 100644
--- a/boards/x86_64/intel64/qemu-intel64/scripts/qemu-kernel.ld
+++ b/boards/x86_64/intel64/qemu-intel64/scripts/qemu-kernel.ld
@@ -71,6 +71,7 @@ SECTIONS
     {
         _srodata = ABSOLUTE(.);
         *(.rodata .rodata.*)
+        *(.lrodata .lrodata.*)
         *(.fixup)
         *(.gnu.warning)
         *(.glue_7)
@@ -87,6 +88,7 @@ SECTIONS
     {
         _sdata = ABSOLUTE(.);
         *(.data .data.*)
+        *(.ldata .ldata.*)
         *(.gnu.linkonce.d.*)
         CONSTRUCTORS
         . = ALIGN(4);
@@ -104,6 +106,7 @@ SECTIONS
     {
         _sbss = ABSOLUTE(.);
         *(.bss .bss.*)
+        *(.lbss .lbss.*)
         *(.gnu.linkonce.b.*)
         *(COMMON)
         . = ALIGN(16);
diff --git a/boards/x86_64/intel64/qemu-intel64/scripts/qemu.ld 
b/boards/x86_64/intel64/qemu-intel64/scripts/qemu.ld
index 4ba79aa2d81..df74cb01af5 100644
--- a/boards/x86_64/intel64/qemu-intel64/scripts/qemu.ld
+++ b/boards/x86_64/intel64/qemu-intel64/scripts/qemu.ld
@@ -93,6 +93,7 @@ SECTIONS
     {
         _srodata = ABSOLUTE(.);
         *(.rodata .rodata.*)
+        *(.lrodata .lrodata.*)
         *(.fixup)
         *(.gnu.warning)
         *(.glue_7)
@@ -119,6 +120,7 @@ SECTIONS
     {
         _sdata = ABSOLUTE(.);
         *(.data .data.*)
+        *(.ldata .ldata.*)
         *(.gnu.linkonce.d.*)
         CONSTRUCTORS
         . = ALIGN(4);
@@ -129,6 +131,7 @@ SECTIONS
     {
         _sbss = ABSOLUTE(.);
         *(.bss .bss.*)
+        *(.lbss .lbss.*)
         *(.gnu.linkonce.b.*)
         *(COMMON)
         . = ALIGN(16);

Reply via email to