Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
linker-tool-lld.h File Reference

LLVM LLD linker defs. More...

Go to the source code of this file.

Macros

#define SECTION_PROLOGUE(name, options, align)    name options : align
 The SECTION_PROLOGUE() macro is used to define the beginning of a section.
 
#define SECTION_DATA_PROLOGUE(name, options, align)    SECTION_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.
 

Detailed Description

LLVM LLD linker defs.

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

Macro Definition Documentation

◆ SECTION_DATA_PROLOGUE

#define SECTION_DATA_PROLOGUE (   name,
  options,
  align 
)     SECTION_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.

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() when linking using LLD.

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

◆ SECTION_PROLOGUE

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

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

When –omagic (-N) option is provided to LLD then only the first output section of given region has aligned LMA (by default, without –omagic, LLD aligns LMA and VMA of every section to the same value) and the difference between VMA addresses (0 is this is the first section) is added. The difference between LMA and VMA is constant for every section, so this emulates ALIGN_WITH_INPUT option present in GNU LD (required by XIP systems).

The –omagic flag is defined in cmake/linker/lld/target_baremetal.cmake

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