Browse Source

linker: Place .tbss section in RAM, not FLASH

If this section is placed in FLASH, the section gets marked
as writable even though .tbss values will never be stored there.

Signed-off-by: Keith Packard <keithp@keithp.com>
pull/91391/head
Keith Packard 2 months ago committed by Benjamin Cabé
parent
commit
5890c73087
  1. 2
      cmake/linker_script/common/thread-local-storage.cmake
  2. 4
      include/zephyr/linker/thread-local-storage.ld

2
cmake/linker_script/common/thread-local-storage.cmake

@ -13,7 +13,7 @@ if(CONFIG_THREAD_LOCAL_STORAGE) @@ -13,7 +13,7 @@ if(CONFIG_THREAD_LOCAL_STORAGE)
zephyr_linker_section_configure(SECTION .tbss INPUT ".tbss.*")
zephyr_linker_section_configure(SECTION .tbss INPUT ".gnu.linkonce.tb.*")
zephyr_linker_section_configure(SECTION .tbss INPUT ".tcommon")
# GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
# GROUP_ROM_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
#
# These needs to be outside of the tdata/tbss

4
include/zephyr/linker/thread-local-storage.ld

@ -8,10 +8,10 @@ @@ -8,10 +8,10 @@
*(.tdata .tdata.* .gnu.linkonce.td.*);
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
SECTION_DATA_PROLOGUE(tbss,,)
SECTION_DATA_PROLOGUE(tbss,(NOLOAD),)
{
*(.tbss .tbss.* .gnu.linkonce.tb.* .tcommon);
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
} GROUP_ROM_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
/*
* These needs to be outside of the tdata/tbss

Loading…
Cancel
Save