mimxrt/boards: Fix __VECTOR_TABLE link issue with CMSIS 5.9.0.

In CMSIS 5.9.0, the compiler headers define `__VECTOR_TABLE`, which will be
substituted with its corresponding value (e.g., `__Vectors` for gcc).
However, the linker script in this port can't include compiler headers when
it's processed, so `__VECTOR_TABLE` is used as the literal variable name,
which results in an undefined linker error.

To fix this, the two possible values of `__VECTOR_TABLE` are both defined
in the linker script.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
This commit is contained in:
iabdalkader 2024-01-19 10:49:58 +02:00 committed by Damien George
parent e2fa0c6395
commit beb4459784

View File

@ -83,13 +83,14 @@ SECTIONS
/* The startup code goes first into internal RAM */ /* The startup code goes first into internal RAM */
.interrupts : .interrupts :
{ {
__VECTOR_TABLE = .; __Vectors = .;
__vector_table = .;
. = ALIGN(4); . = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */ KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(4); . = ALIGN(4);
} > m_interrupts } > m_interrupts
__VECTOR_RAM = __VECTOR_TABLE; __VECTOR_RAM = __Vectors;
__RAM_VECTOR_TABLE_SIZE_BYTES = 0x0; __RAM_VECTOR_TABLE_SIZE_BYTES = 0x0;
/* The program code and other data goes into internal RAM */ /* The program code and other data goes into internal RAM */