FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [December 2014 Threads]
I am working from the V8.1.2 GCC/ARMCM3 port. I have successfully built myself a demo in Eclipse(Kepler), my arm gcc is 48_2014q3, my hardware is an STM32F103RE processor based board. I'm also using gnuarmeclipse plugins.
When first building, I received the following link error. I've fixed it, but I suspect something else is wrong and I'm just masking my real problem with my "fix". Just putting this out there to see what folks think.
Here is the link error (-flto is being used in the compile/link process):
'C:UsersmrichmonAppDataLocalTempccq0f0ed.ltrans0.ltrans.o'
vTaskSwitchContext' referenced in section
.text.PendSVHandler.4125' of C:UsersmrichmonAppDataLocalTempccq0f0ed.ltrans0.ltrans.o: defined in discarded section .text' of ./FreeRTOS_Source/source/tasks.o (symbol from plugin)
pxCurrentTCB' referenced in section .text.PendSV_Handler.4125' of C:\Users\mrichmon\AppData\Local\Temp\ccq0f0ed.ltrans0.ltrans.o: defined in discarded section
.text' of ./FreeRTOSSource/source/tasks.o (symbol from plugin)
pxCurrentTCB' referenced in section
.text.SVCHandler.4140' of C:UsersmrichmonAppDataLocalTempccq0f0ed.ltrans0.ltrans.o: defined in discarded section `.text' of ./FreeRTOSSource/source/tasks.o (symbol from plugin)
collect2.exe: error: ld returned 1 exit status
I tracked down the two resources being unceremoniously "discarded" during the the linking process:
vTaskSwitchContext()
pxCurrentTCBG
I fixed the problem by adding the attribute "used" to both resources (yes, I modified source code ---icky right?).
Defined in FreeRTOSConfig.h with a big juicy note:
#define KEEP_ME __attribute__((used))
Modified in tasks.c
void KEEP_ME vTaskSwitchContext( void )
{ . . . }
PRIVILEGED_DATA TCB_t * volatile pxCurrentTCB KEEP_ME = NULL;
So maybe -flto is the problem -- but maybe I'll want to use it for my app. Are my only two options to avoid -flto or use the "used" attribute? Does either choice represent a good practice?
Thanks!!
mjr
I have only ever come across this problem once, and it was not on an ARM architecture, and not using GCC - but then I have never used -flto - so I guess that is the cause.
On the occasion I did have such a problem it was, if I recall correctly, because a symbol was only used in an assembly file.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.