arm: linker.ld: Port the vector table to zephyr_linker_sources()

Also port vector table relay.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
This commit is contained in:
Øyvind Rønningstad 2019-11-28 16:59:15 +01:00 committed by Anas Nashif
commit 321462b310
6 changed files with 36 additions and 36 deletions

View file

@ -33,3 +33,5 @@ add_subdirectory_ifdef(CONFIG_ARM_SECURE_FIRMWARE cortex_m/tz)
add_subdirectory_ifdef(CONFIG_ARM_NONSECURE_FIRMWARE cortex_m/tz) add_subdirectory_ifdef(CONFIG_ARM_NONSECURE_FIRMWARE cortex_m/tz)
add_subdirectory_ifdef(CONFIG_CPU_CORTEX_R cortex_r) add_subdirectory_ifdef(CONFIG_CPU_CORTEX_R cortex_r)
zephyr_linker_sources(TEXT_START SORT_KEY 0x0vectors vector_table.ld)

View file

@ -11,6 +11,12 @@ zephyr_library_sources(
thread_abort.c thread_abort.c
) )
zephyr_linker_sources_ifdef(CONFIG_SW_VECTOR_RELAY
TEXT_START
SORT_KEY 0x0relay_vectors
relay_vector_table.ld
)
zephyr_linker_sources_ifdef(CONFIG_SW_VECTOR_RELAY zephyr_linker_sources_ifdef(CONFIG_SW_VECTOR_RELAY
RAM_SECTIONS RAM_SECTIONS
vt_pointer_section.ld vt_pointer_section.ld

View file

@ -0,0 +1,10 @@
/*
* Copyright (c) 2019 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
KEEP(*(.vector_relay_table))
KEEP(*(".vector_relay_table.*"))
KEEP(*(.vector_relay_handler))
KEEP(*(".vector_relay_handler.*"))

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2019 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
_vector_start = .;
KEEP(*(.exc_vector_table))
KEEP(*(".exc_vector_table.*"))
KEEP(*(IRQ_VECTOR_TABLE))
KEEP(*(.vectors))
KEEP(*(.openocd_dbg))
KEEP(*(".openocd_dbg.*"))
_vector_end = .;

View file

@ -160,23 +160,6 @@ SECTIONS
* zephyr_linker_sources() Cmake function. * zephyr_linker_sources() Cmake function.
*/ */
#include <snippets-text-start.ld> #include <snippets-text-start.ld>
#if defined(CONFIG_SW_VECTOR_RELAY)
KEEP(*(.vector_relay_table))
KEEP(*(".vector_relay_table.*"))
KEEP(*(.vector_relay_handler))
KEEP(*(".vector_relay_handler.*"))
#endif
_vector_start = .;
KEEP(*(.exc_vector_table))
KEEP(*(".exc_vector_table.*"))
KEEP(*(IRQ_VECTOR_TABLE))
KEEP(*(.vectors))
KEEP(*(.openocd_dbg))
KEEP(*(".openocd_dbg.*"))
#ifdef CONFIG_KINETIS_FLASH_CONFIG #ifdef CONFIG_KINETIS_FLASH_CONFIG
. = CONFIG_KINETIS_FLASH_CONFIG_OFFSET; . = CONFIG_KINETIS_FLASH_CONFIG_OFFSET;
@ -184,7 +167,6 @@ SECTIONS
KEEP(*(".kinetis_flash_config.*")) KEEP(*(".kinetis_flash_config.*"))
#endif #endif
_vector_end = .;
} GROUP_LINK_IN(ROMABLE_REGION) } GROUP_LINK_IN(ROMABLE_REGION)
#ifdef CONFIG_CODE_DATA_RELOCATION #ifdef CONFIG_CODE_DATA_RELOCATION

View file

@ -157,30 +157,12 @@ SECTIONS
* zephyr_linker_sources() Cmake function. * zephyr_linker_sources() Cmake function.
*/ */
#include <snippets-text-start.ld> #include <snippets-text-start.ld>
#if defined(CONFIG_SW_VECTOR_RELAY)
KEEP(*(.vector_relay_table))
KEEP(*(".vector_relay_table.*"))
KEEP(*(.vector_relay_handler))
KEEP(*(".vector_relay_handler.*"))
#endif
_vector_start = .;
KEEP(*(.exc_vector_table))
KEEP(*(".exc_vector_table.*"))
KEEP(*(IRQ_VECTOR_TABLE))
KEEP(*(.vectors))
KEEP(*(.openocd_dbg))
KEEP(*(".openocd_dbg.*"))
/* Kinetis has to write 16 bytes at 0x400 */ /* Kinetis has to write 16 bytes at 0x400 */
SKIP_TO_KINETIS_FLASH_CONFIG SKIP_TO_KINETIS_FLASH_CONFIG
KEEP(*(.kinetis_flash_config)) KEEP(*(.kinetis_flash_config))
KEEP(*(".kinetis_flash_config.*")) KEEP(*(".kinetis_flash_config.*"))
_vector_end = .;
} GROUP_LINK_IN(ROMABLE_REGION) } GROUP_LINK_IN(ROMABLE_REGION)
#ifdef CONFIG_CODE_DATA_RELOCATION #ifdef CONFIG_CODE_DATA_RELOCATION