ARM_CM0 Relocation Error in portasm.c

When linking FreeRTOS v202406.01-LTS on GCC I am getting the following error in the NXP McuExpresso (11.10)/GCC (10.3) environment on an NXP LPC824. The linker script (.ld) being used is the stock NXP one for this processor.

FreeRTOS-LTS/FreeRTOS/FreeRTOS-Kernel/portable/GCC/ARM_CM0/portasm.c:499:(.text.SVC_Handler+0xc): relocation truncated to fit: R_ARM_THM_JUMP11 against symbol `vPortSVCHandler_C' defined in .text.vPortSVCHandler_C section in ./FreeRTOS-LTS/FreeRTOS/FreeRTOS-Kernel/portable/GCC/ARM_CM0/port.o

I understand what this error means, and have been able to “hack” a solution in place by including the following in the linker (.ld) file. This results in entries being close enough to branch with the available label bits by locating all the “SVC” functions at the start of .text.

*(.text*SVC*)
*(.text*)

Is this the best solution here, or is this a symptom of my having missed something in my configuration? With this in place and some minor config changes from the stock template I am able to run my example on the LPC 824.

Kernel PR 1131 recently resolved this issue. You can use the fix from that PR or keep using your own fix in the linker file. The issue is not a symptom of your configuration.

1 Like

@scruffmeister Let us know if the PR @jefftenney mentioned, fixes your issue. Thanks.

@jefftenney @aggarg thank you both, I can confirm that PR1131 resolves this issue when I apply it as a patch over the LTS2024 codebase.

Great - thanks for reporting back and for the clarity.