Skip to content

Commit 9fb8a17

Browse files
szafonimateusz-mixiaoxiang781216
authored andcommitted
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 <[email protected]>
1 parent f725c59 commit 9fb8a17

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

boards/x86_64/intel64/qemu-intel64/scripts/qemu-kernel.ld

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ SECTIONS
7171
{
7272
_srodata = ABSOLUTE(.);
7373
*(.rodata .rodata.*)
74+
*(.lrodata .lrodata.*)
7475
*(.fixup)
7576
*(.gnu.warning)
7677
*(.glue_7)
@@ -87,6 +88,7 @@ SECTIONS
8788
{
8889
_sdata = ABSOLUTE(.);
8990
*(.data .data.*)
91+
*(.ldata .ldata.*)
9092
*(.gnu.linkonce.d.*)
9193
CONSTRUCTORS
9294
. = ALIGN(4);
@@ -104,6 +106,7 @@ SECTIONS
104106
{
105107
_sbss = ABSOLUTE(.);
106108
*(.bss .bss.*)
109+
*(.lbss .lbss.*)
107110
*(.gnu.linkonce.b.*)
108111
*(COMMON)
109112
. = ALIGN(16);

boards/x86_64/intel64/qemu-intel64/scripts/qemu.ld

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ SECTIONS
9393
{
9494
_srodata = ABSOLUTE(.);
9595
*(.rodata .rodata.*)
96+
*(.lrodata .lrodata.*)
9697
*(.fixup)
9798
*(.gnu.warning)
9899
*(.glue_7)
@@ -119,6 +120,7 @@ SECTIONS
119120
{
120121
_sdata = ABSOLUTE(.);
121122
*(.data .data.*)
123+
*(.ldata .ldata.*)
122124
*(.gnu.linkonce.d.*)
123125
CONSTRUCTORS
124126
. = ALIGN(4);
@@ -129,6 +131,7 @@ SECTIONS
129131
{
130132
_sbss = ABSOLUTE(.);
131133
*(.bss .bss.*)
134+
*(.lbss .lbss.*)
132135
*(.gnu.linkonce.b.*)
133136
*(COMMON)
134137
. = ALIGN(16);

0 commit comments

Comments
 (0)