summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithpac@amazon.com>2023-03-02 12:48:50 -0800
committerPaul Bartell <paul.bartell@gmail.com>2023-03-30 12:32:55 -0700
commit68ef270215b0b27598111f3ef0158bd2d9fe0dd9 (patch)
treed70cd8dd98b5bdb6ba546488bfa48f67d7bcbed4
parent89ccc1da5084b4f25ee0218b1dee2ca50d3436ae (diff)
downloadfreertos-git-68ef270215b0b27598111f3ef0158bd2d9fe0dd9.tar.gz
Demo/CORTEX_M3_MPS2_QEMU_GCC: Prepare startup.c for use with --gc-sections
Ensure that the handler2_address_const location will be correctly aligned when compiled to a separate section. Add the 'used' attribute to isr_vector to ensure it will not be elided from the output. Signed-off-by: Keith Packard <keithpac@amazon.com>
-rw-r--r--FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/init/startup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/init/startup.c b/FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/init/startup.c
index 8f21c1b86..0004f6baa 100644
--- a/FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/init/startup.c
+++ b/FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/init/startup.c
@@ -135,6 +135,7 @@ void Default_Handler2( void )
" ldr r1, [r0, #24] \n"
" ldr r2, handler2_address_const \n"
" bx r2 \n"
+ " nop \n"
" handler2_address_const: .word prvGetRegistersFromStack \n"
);
}
@@ -167,7 +168,7 @@ void Default_Handler6( void )
}
}
-const uint32_t * isr_vector[] __attribute__( ( section( ".isr_vector" ) ) ) =
+const uint32_t * isr_vector[] __attribute__( ( section( ".isr_vector" ) , used ) ) =
{
( uint32_t * ) &_estack,
( uint32_t * ) &Reset_Handler, /* Reset -15 */