Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
linker-tool-gcc.h File Reference

GCC toolchain linker defs. More...

#include <zephyr/kernel/mm.h>

Go to the source code of this file.

Macros

#define GROUP_START(where)
 
#define GROUP_END(where)
 
#define GROUP_LINK_IN(where)
 Route memory to a specified memory area.
 
#define GROUP_ROM_LINK_IN(vregion, lregion)
 Route memory for a read-only section.
 
#define GROUP_DATA_LINK_IN(vregion, lregion)
 Route memory for read-write sections that are loaded.
 
#define GROUP_NOLOAD_LINK_IN(vregion, lregion)
 Route memory for read-write sections that are NOT loaded; typically this is only used for 'BSS' and 'noinit'.
 
#define SECTION_PROLOGUE(name, options, align)
 The SECTION_PROLOGUE() macro is used to define the beginning of a section.
 
#define SECTION_DATA_PROLOGUE(name, options, align)
 Same as for SECTION_PROLOGUE(), except that this one must be used for data sections which on XIP platforms will have differing virtual and load addresses (i.e.
 
#define COMMON_SYMBOLS   *(COMMON)
 

Detailed Description

GCC toolchain linker defs.

This header file defines the necessary macros used by the linker script for use with the GCC linker.

Macro Definition Documentation

◆ COMMON_SYMBOLS

#define COMMON_SYMBOLS   *(COMMON)

◆ GROUP_DATA_LINK_IN

#define GROUP_DATA_LINK_IN ( vregion,
lregion )
Value:
> vregion

Route memory for read-write sections that are loaded.

Used for initialized data sections that on XIP platforms must be copied at startup.

Parameters
vregionOutput VMA
lregionOutput LMA (only used if CONFIG_MMU if VMA != LMA, or CONFIG_XIP)

◆ GROUP_END

#define GROUP_END ( where)

◆ GROUP_LINK_IN

#define GROUP_LINK_IN ( where)
Value:
> where

Route memory to a specified memory area.

The GROUP_LINK_IN() macro is located at the end of the section description and tells the linker that this section is located in the memory area specified by 'where' argument.

This macro is intentionally undefined for CONFIG_MMU systems when CONFIG_KERNEL_VM_BASE is not the same as CONFIG_SRAM_BASE_ADDRESS, as both the LMA and VMA destinations must be known for all sections as this corresponds to physical vs. virtual location.

Parameters
whereDestination memory area

◆ GROUP_NOLOAD_LINK_IN

#define GROUP_NOLOAD_LINK_IN ( vregion,
lregion )
Value:
> vregion

Route memory for read-write sections that are NOT loaded; typically this is only used for 'BSS' and 'noinit'.

Parameters
vregionOutput VMA
lregionOutput LMA (only used if CONFIG_MMU if VMA != LMA, corresponds to physical location)

◆ GROUP_ROM_LINK_IN

#define GROUP_ROM_LINK_IN ( vregion,
lregion )
Value:
> lregion

Route memory for a read-only section.

The GROUP_ROM_LINK_IN() macro is located at the end of the section description and tells the linker that this a read-only section that is physically placed at the 'lregion` argument.

If CONFIG_XIP is active, the 'lregion' area is flash memory.

If CONFIG_MMU is active, the vregion argument will be used to determine where this is located in the virtual memory map, otherwise it is ignored.

Parameters
vregionOutput VMA (only used if CONFIG_MMU where LMA != VMA)
lregionOutput LMA

◆ GROUP_START

#define GROUP_START ( where)

◆ SECTION_DATA_PROLOGUE

#define SECTION_DATA_PROLOGUE ( name,
options,
align )
Value:
SECTION_PROLOGUE(name, options, align)
#define SECTION_PROLOGUE(name, options, align)
The SECTION_PROLOGUE() macro is used to define the beginning of a section.
Definition linker-tool-gcc.h:180

Same as for SECTION_PROLOGUE(), except that this one must be used for data sections which on XIP platforms will have differing virtual and load addresses (i.e.

they'll be copied into RAM at program startup). Such a section must also use GROUP_DATA_LINK_IN to specify the correct output load address.

This is equivalent to SECTION_PROLOGUE() on non-XIP systems. On XIP systems there is an implicit ALIGN_WITH_INPUT specified.

Parameters
nameName of the output section
optionsSection options, or left blank
alignAlignment directives, such as SUBALIGN(). ALIGN() itself is not allowed. May be blank.

◆ SECTION_PROLOGUE

#define SECTION_PROLOGUE ( name,
options,
align )
Value:
name options : align

The SECTION_PROLOGUE() macro is used to define the beginning of a section.

On MMU systems where VMA != LMA there is an implicit ALIGN_WITH_INPUT specified.

Parameters
nameName of the output section
optionsSection options, such as (NOLOAD), or left blank
alignAlignment directives, such as SUBALIGN(). ALIGN() itself is not allowed. May be blank.