mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-26 14:15:57 +00:00
This commit cleans up the section name definitions in the linker sections header file (`include/linker/sections.h`) to have the uniform format of `_(SECTION)_SECTION_NAME`. In addition, the scope of the short section reference aliases (e.g. `TEXT`, `DATA`, `BSS`) are now limited to the ASM code, as they are currently used (and intended to be used) only by the ASM code to specify the target section for functions and variables, and these short names can cause name conflicts with the symbols used in the C code. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
80 lines
2.1 KiB
C
80 lines
2.1 KiB
C
/*
|
|
* Copyright (c) 2013-2014, Wind River Systems, Inc.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @file
|
|
* @brief Definitions of various linker Sections.
|
|
*
|
|
* Linker Section declarations used by linker script, C files and Assembly
|
|
* files.
|
|
*/
|
|
|
|
#ifndef ZEPHYR_INCLUDE_LINKER_SECTIONS_H_
|
|
#define ZEPHYR_INCLUDE_LINKER_SECTIONS_H_
|
|
|
|
#define _TEXT_SECTION_NAME text
|
|
#define _RODATA_SECTION_NAME rodata
|
|
#define _CTOR_SECTION_NAME ctors
|
|
/* Linker issue with XIP where the name "data" cannot be used */
|
|
#define _DATA_SECTION_NAME datas
|
|
#define _BSS_SECTION_NAME bss
|
|
#define _NOINIT_SECTION_NAME noinit
|
|
|
|
#define _APP_SMEM_SECTION_NAME app_smem
|
|
#define _APP_DATA_SECTION_NAME app_datas
|
|
#define _APP_BSS_SECTION_NAME app_bss
|
|
#define _APP_NOINIT_SECTION_NAME app_noinit
|
|
|
|
#define _UNDEFINED_SECTION_NAME undefined
|
|
|
|
/* Interrupts */
|
|
#define _IRQ_VECTOR_TABLE_SECTION_NAME .gnu.linkonce.irq_vector_table
|
|
#define _SW_ISR_TABLE_SECTION_NAME .gnu.linkonce.sw_isr_table
|
|
|
|
/* Architecture-specific sections */
|
|
#if defined(CONFIG_ARM)
|
|
#define _KINETIS_FLASH_CONFIG_SECTION_NAME kinetis_flash_config
|
|
#define _TI_CCFG_SECTION_NAME .ti_ccfg
|
|
|
|
#define _CCM_DATA_SECTION_NAME .ccm_data
|
|
#define _CCM_BSS_SECTION_NAME .ccm_bss
|
|
#define _CCM_NOINIT_SECTION_NAME .ccm_noinit
|
|
|
|
#define _DTCM_DATA_SECTION_NAME .dtcm_data
|
|
#define _DTCM_BSS_SECTION_NAME .dtcm_bss
|
|
#define _DTCM_NOINIT_SECTION_NAME .dtcm_noinit
|
|
#endif
|
|
|
|
#define _IMX_BOOT_CONF_SECTION_NAME .boot_hdr.conf
|
|
#define _IMX_BOOT_DATA_SECTION_NAME .boot_hdr.data
|
|
#define _IMX_BOOT_IVT_SECTION_NAME .boot_hdr.ivt
|
|
#define _IMX_BOOT_DCD_SECTION_NAME .boot_hdr.dcd_data
|
|
|
|
#ifdef CONFIG_NOCACHE_MEMORY
|
|
#define _NOCACHE_SECTION_NAME nocache
|
|
#endif
|
|
|
|
/* Short section references for use in ASM files */
|
|
#if defined(_ASMLANGUAGE)
|
|
/* Various text section names */
|
|
#define TEXT text
|
|
#if defined(CONFIG_X86)
|
|
#define TEXT_START text_start /* beginning of TEXT section */
|
|
#else
|
|
#define TEXT_START text /* beginning of TEXT section */
|
|
#endif
|
|
|
|
/* Various data type section names */
|
|
#define BSS bss
|
|
#define RODATA rodata
|
|
#define DATA data
|
|
#define NOINIT noinit
|
|
#endif /* _ASMLANGUAGE */
|
|
|
|
#include <linker/section_tags.h>
|
|
|
|
#endif /* ZEPHYR_INCLUDE_LINKER_SECTIONS_H_ */
|