From beb44597841805a85d31326b375669b6a1251c02 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Fri, 19 Jan 2024 10:49:58 +0200 Subject: [PATCH] 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 --- ports/mimxrt/boards/common.ld | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/mimxrt/boards/common.ld b/ports/mimxrt/boards/common.ld index c2aa369f66..6c78fea319 100644 --- a/ports/mimxrt/boards/common.ld +++ b/ports/mimxrt/boards/common.ld @@ -83,13 +83,14 @@ SECTIONS /* The startup code goes first into internal RAM */ .interrupts : { - __VECTOR_TABLE = .; + __Vectors = .; + __vector_table = .; . = ALIGN(4); KEEP(*(.isr_vector)) /* Startup code */ . = ALIGN(4); } > m_interrupts - __VECTOR_RAM = __VECTOR_TABLE; + __VECTOR_RAM = __Vectors; __RAM_VECTOR_TABLE_SIZE_BYTES = 0x0; /* The program code and other data goes into internal RAM */