Skip to content

Commit

Permalink
Linker: use GROUP_NOLOAD_LINK_IN and SECTION_PROLOGUE for noload sect…
Browse files Browse the repository at this point in the history
…ions

If a section is marked as noload, it will not be loaded
into memory by the program loader. So move to use:

- SECTION_PROLOGUE: because SECTION_DATA_PROLOGUE has
  ALIGN_WITH_INPUT attribute (on XIP) which seems is
  not needed for this sections

- GROUP_NOLOAD_LINK_IN: as it's supposed to be used for
  this sections. The ROM region will be consumed if using
  GROUP_DATA_LINK_IN and LMA != VMA

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
  • Loading branch information
Dat-NguyenDuy committed Jan 9, 2025
1 parent 77c4dd4 commit 867b6c7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions arch/common/nocache.ld
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/* Copied from linker.ld */

/* Non-cached region of RAM */
SECTION_DATA_PROLOGUE(_NOCACHE_SECTION_NAME,(NOLOAD),)
SECTION_PROLOGUE(_NOCACHE_SECTION_NAME,(NOLOAD),)
{
#if defined(CONFIG_MMU)
MMU_ALIGN;
Expand All @@ -27,5 +27,5 @@ SECTION_DATA_PROLOGUE(_NOCACHE_SECTION_NAME,(NOLOAD),)
MPU_ALIGN(_nocache_ram_size);
#endif
_nocache_ram_end = .;
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
} GROUP_NOLOAD_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
_nocache_ram_size = _nocache_ram_end - _nocache_ram_start;
2 changes: 1 addition & 1 deletion include/zephyr/arch/arm/cortex_a_r/scripts/linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ GROUP_END(OCM)
* section ends on a 4 byte boundary. This wastes a maximum of 3 bytes.
*/
__bss_end = ALIGN(4);
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
} GROUP_NOLOAD_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)

#include <zephyr/linker/common-noinit.ld>

Expand Down
4 changes: 2 additions & 2 deletions include/zephyr/linker/kobject-priv-stacks.ld
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#ifdef CONFIG_USERSPACE
#ifdef CONFIG_GEN_PRIV_STACKS
SECTION_DATA_PROLOGUE(priv_stacks_noinit,(NOLOAD),)
SECTION_PROLOGUE(priv_stacks_noinit,(NOLOAD),)
{
z_priv_stacks_ram_start = .;

Expand Down Expand Up @@ -53,6 +53,6 @@ for privileged stacks."
#endif /* KOBJECT_PRIV_STACKS_ALIGN */
#endif /* LINKER_ZEPHYR_FINAL */

} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
} GROUP_NOLOAD_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
#endif /* CONFIG_GEN_PRIV_STACKS */
#endif /* CONFIG_USERSPACE */

0 comments on commit 867b6c7

Please sign in to comment.