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>
pull/977/head
Keith Packard 2 years ago committed by Paul Bartell
parent 89ccc1da50
commit 68ef270215

@ -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 */

Loading…
Cancel
Save