diff --git a/portable/GCC/ARM_CM3_MPU/port.c b/portable/GCC/ARM_CM3_MPU/port.c index f76a8511c..e7bec2ecc 100644 --- a/portable/GCC/ARM_CM3_MPU/port.c +++ b/portable/GCC/ARM_CM3_MPU/port.c @@ -369,6 +369,7 @@ static void prvRestoreContextOfFirstTask( void ) " ldr r14, =0xfffffffd \n"/* Load exec return code. */ " bx r14 \n" " \n" + " .ltorg \n"/* Assemble current literal pool to avoid offset-out-of-bound errors with lto. */ " .align 4 \n" "pxCurrentTCBConst2: .word pxCurrentTCB \n" ); @@ -579,6 +580,7 @@ void xPortPendSVHandler( void ) " msr psp, r0 \n" " bx r14 \n" " \n" + " .ltorg \n"/* Assemble current literal pool to avoid offset-out-of-bound errors with lto. */ " .align 4 \n" "pxCurrentTCBConst: .word pxCurrentTCB \n" ::"i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY ) diff --git a/portable/GCC/ARM_CM4_MPU/port.c b/portable/GCC/ARM_CM4_MPU/port.c index 9cf9c44e6..a10d9b97b 100644 --- a/portable/GCC/ARM_CM4_MPU/port.c +++ b/portable/GCC/ARM_CM4_MPU/port.c @@ -394,6 +394,7 @@ static void prvRestoreContextOfFirstTask( void ) " msr basepri, r0 \n" " bx r14 \n" " \n" + " .ltorg \n"/* Assemble current literal pool to avoid offset-out-of-bound errors with lto. */ " .align 4 \n" "pxCurrentTCBConst2: .word pxCurrentTCB \n" ); @@ -631,6 +632,7 @@ void xPortPendSVHandler( void ) " msr psp, r0 \n" " bx r14 \n" " \n" + " .ltorg \n"/* Assemble the current literal pool to avoid offset-out-of-bound errors with lto. */ " .align 4 \n" "pxCurrentTCBConst: .word pxCurrentTCB \n" ::"i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY )