arch: arm: cortex_r: linker.ld: Clean-up
This commit cleans up the linker.ld file for the Cortex-R arch. * Convert all TAB characters to SPACE. * Fix insane placement of curly brackets. * Fix overall text alignments. * Remove the special handlings for the Cortex-M devices that were copied from `include/arm/aarch32/cortex_m/scripts/linker.ld`. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit is contained in:
parent
d55c8ead03
commit
f053f1b25d
1 changed files with 129 additions and 166 deletions
|
@ -33,28 +33,17 @@
|
||||||
#define _DATA_IN_ROM
|
#define _DATA_IN_ROM
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(SKIP_TO_KINETIS_FLASH_CONFIG)
|
|
||||||
#define SKIP_TO_KINETIS_FLASH_CONFIG
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0)
|
#if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0)
|
||||||
#define ROM_ADDR RAM_ADDR
|
#define ROM_ADDR RAM_ADDR
|
||||||
#else
|
#else
|
||||||
#define ROM_ADDR (CONFIG_FLASH_BASE_ADDRESS + CONFIG_FLASH_LOAD_OFFSET)
|
#define ROM_ADDR (CONFIG_FLASH_BASE_ADDRESS + CONFIG_FLASH_LOAD_OFFSET)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_HAS_TI_CCFG
|
|
||||||
#define CCFG_SIZE 88
|
|
||||||
#define ROM_SIZE (CONFIG_FLASH_SIZE*1K - CONFIG_FLASH_LOAD_OFFSET - \
|
|
||||||
CCFG_SIZE)
|
|
||||||
#define CCFG_ADDR (ROM_ADDR + ROM_SIZE)
|
|
||||||
#else
|
|
||||||
#if CONFIG_FLASH_LOAD_SIZE > 0
|
#if CONFIG_FLASH_LOAD_SIZE > 0
|
||||||
#define ROM_SIZE CONFIG_FLASH_LOAD_SIZE
|
#define ROM_SIZE CONFIG_FLASH_LOAD_SIZE
|
||||||
#else
|
#else
|
||||||
#define ROM_SIZE (CONFIG_FLASH_SIZE*1K - CONFIG_FLASH_LOAD_OFFSET)
|
#define ROM_SIZE (CONFIG_FLASH_SIZE*1K - CONFIG_FLASH_LOAD_OFFSET)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CONFIG_XIP)
|
#if defined(CONFIG_XIP)
|
||||||
#if defined(CONFIG_IS_BOOTLOADER)
|
#if defined(CONFIG_IS_BOOTLOADER)
|
||||||
|
@ -81,37 +70,29 @@ _region_min_align = 4;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT)
|
#if defined(CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT)
|
||||||
#define MPU_ALIGN(region_size) \
|
#define MPU_ALIGN(region_size) \
|
||||||
. = ALIGN(_region_min_align); \
|
. = ALIGN(_region_min_align); \
|
||||||
. = ALIGN( 1 << LOG2CEIL(region_size))
|
. = ALIGN(1 << LOG2CEIL(region_size))
|
||||||
#else
|
#else
|
||||||
#define MPU_ALIGN(region_size) \
|
#define MPU_ALIGN(region_size) \
|
||||||
. = ALIGN(_region_min_align)
|
. = ALIGN(_region_min_align)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
FLASH (rx) : ORIGIN = ROM_ADDR, LENGTH = ROM_SIZE
|
FLASH (rx) : ORIGIN = ROM_ADDR, LENGTH = ROM_SIZE
|
||||||
#ifdef CONFIG_HAS_TI_CCFG
|
|
||||||
FLASH_CCFG (rwx): ORIGIN = CCFG_ADDR, LENGTH = CCFG_SIZE
|
|
||||||
#endif
|
|
||||||
#ifdef DT_CCM_BASE_ADDRESS
|
#ifdef DT_CCM_BASE_ADDRESS
|
||||||
CCM (rw) : ORIGIN = DT_CCM_BASE_ADDRESS, LENGTH = DT_CCM_SIZE * 1K
|
CCM (rw) : ORIGIN = DT_CCM_BASE_ADDRESS, LENGTH = DT_CCM_SIZE * 1K
|
||||||
#endif
|
#endif
|
||||||
SRAM (wx) : ORIGIN = RAM_ADDR, LENGTH = RAM_SIZE
|
SRAM (wx) : ORIGIN = RAM_ADDR, LENGTH = RAM_SIZE
|
||||||
#ifdef CONFIG_BT_STM32_IPM
|
|
||||||
SRAM1 (rw) : ORIGIN = RAM1_ADDR, LENGTH = RAM1_SIZE
|
|
||||||
SRAM2 (rw) : ORIGIN = RAM2_ADDR, LENGTH = RAM2_SIZE
|
|
||||||
#endif
|
|
||||||
/* Used by and documented in include/linker/intlist.ld */
|
/* Used by and documented in include/linker/intlist.ld */
|
||||||
IDT_LIST (wx) : ORIGIN = (RAM_ADDR + RAM_SIZE), LENGTH = 2K
|
IDT_LIST (wx) : ORIGIN = (RAM_ADDR + RAM_SIZE), LENGTH = 2K
|
||||||
}
|
}
|
||||||
|
|
||||||
ENTRY(CONFIG_KERNEL_ENTRY)
|
ENTRY(CONFIG_KERNEL_ENTRY)
|
||||||
|
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
|
|
||||||
#include <linker/rel-sections.ld>
|
#include <linker/rel-sections.ld>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -241,14 +222,6 @@ SECTIONS
|
||||||
|
|
||||||
GROUP_END(ROMABLE_REGION)
|
GROUP_END(ROMABLE_REGION)
|
||||||
|
|
||||||
/* Some TI SoCs have a special configuration footer, at the end of flash. */
|
|
||||||
#ifdef CONFIG_HAS_TI_CCFG
|
|
||||||
SECTION_PROLOGUE(.ti_ccfg,,)
|
|
||||||
{
|
|
||||||
KEEP(*(TI_CCFG))
|
|
||||||
} > FLASH_CCFG
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These are here according to 'arm-zephyr-elf-ld --verbose',
|
* These are here according to 'arm-zephyr-elf-ld --verbose',
|
||||||
* before data section.
|
* before data section.
|
||||||
|
@ -270,16 +243,6 @@ SECTIONS
|
||||||
. = ALIGN(_region_min_align);
|
. = ALIGN(_region_min_align);
|
||||||
_image_ram_start = .;
|
_image_ram_start = .;
|
||||||
|
|
||||||
#if defined(CONFIG_SOC_SERIES_STM32F0X) && !defined(CONFIG_IS_BOOTLOADER)
|
|
||||||
/* Must be first in ramable region */
|
|
||||||
SECTION_PROLOGUE(.st_stm32f0x_vt,(NOLOAD),)
|
|
||||||
{
|
|
||||||
_ram_vector_start = .;
|
|
||||||
. += _vector_end - _vector_start;
|
|
||||||
_ram_vector_end = .;
|
|
||||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Located in generated directory. This file is populated by the
|
/* Located in generated directory. This file is populated by the
|
||||||
* zephyr_linker_sources() Cmake function.
|
* zephyr_linker_sources() Cmake function.
|
||||||
*/
|
*/
|
||||||
|
@ -408,13 +371,13 @@ SECTIONS
|
||||||
KEEP(*(.gnu.attributes))
|
KEEP(*(.gnu.attributes))
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Must be last in romable region */
|
/* Must be last in romable region */
|
||||||
SECTION_PROLOGUE(.last_section,(NOLOAD),)
|
SECTION_PROLOGUE(.last_section,(NOLOAD),)
|
||||||
{
|
{
|
||||||
} GROUP_LINK_IN(ROMABLE_REGION)
|
} GROUP_LINK_IN(ROMABLE_REGION)
|
||||||
|
|
||||||
/* To provide the image size as a const expression,
|
/* To provide the image size as a const expression,
|
||||||
* calculate this value here. */
|
* calculate this value here. */
|
||||||
_flash_used = LOADADDR(.last_section) - _image_rom_start;
|
_flash_used = LOADADDR(.last_section) - _image_rom_start;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue