Skip to content

Commit bdec3b6

Browse files
niniemannNils Niemann
and
Nils Niemann
authored
fix: add additional .ltorg directives to GCC CM3/CM4 mpu ports (#473)
Co-authored-by: Nils Niemann <[email protected]>
1 parent f18e432 commit bdec3b6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

portable/GCC/ARM_CM3_MPU/port.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ static void prvRestoreContextOfFirstTask( void )
369369
" ldr r14, =0xfffffffd \n"/* Load exec return code. */
370370
" bx r14 \n"
371371
" \n"
372+
" .ltorg \n"/* Assemble current literal pool to avoid offset-out-of-bound errors with lto. */
372373
" .align 4 \n"
373374
"pxCurrentTCBConst2: .word pxCurrentTCB \n"
374375
);
@@ -579,6 +580,7 @@ void xPortPendSVHandler( void )
579580
" msr psp, r0 \n"
580581
" bx r14 \n"
581582
" \n"
583+
" .ltorg \n"/* Assemble current literal pool to avoid offset-out-of-bound errors with lto. */
582584
" .align 4 \n"
583585
"pxCurrentTCBConst: .word pxCurrentTCB \n"
584586
::"i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY )

portable/GCC/ARM_CM4_MPU/port.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ static void prvRestoreContextOfFirstTask( void )
394394
" msr basepri, r0 \n"
395395
" bx r14 \n"
396396
" \n"
397+
" .ltorg \n"/* Assemble current literal pool to avoid offset-out-of-bound errors with lto. */
397398
" .align 4 \n"
398399
"pxCurrentTCBConst2: .word pxCurrentTCB \n"
399400
);
@@ -631,6 +632,7 @@ void xPortPendSVHandler( void )
631632
" msr psp, r0 \n"
632633
" bx r14 \n"
633634
" \n"
635+
" .ltorg \n"/* Assemble the current literal pool to avoid offset-out-of-bound errors with lto. */
634636
" .align 4 \n"
635637
"pxCurrentTCBConst: .word pxCurrentTCB \n"
636638
::"i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY )

0 commit comments

Comments
 (0)