Tool/software: TI C/C++ Compiler
Hello,
I am trying to make the compiler & linker retain UNUSED sections/variables.
It works if i use the #pragma RETAIN in the source file:
#pragma DATA_SECTION (testVar,".sec1")
#pragma RETAIN(testVar)
unsigned int testVar;
But i am trying to make it work using the __attribute__ syntax in order for the sources to be more compatible with the gnu tools
__attribute__((section (".sec1"))) __attribute__((used)) unsigned int testVar;
and in the linker i add : --retain ('.sec1*')
the section attribute works but the used attribute + linker retain does not seem to be working and i still must used the #pargma RETAIN.
Is there a reason why attribute((used)) + linker retain is not working and the variable is still thrown out ? any way to achieve it without having to use the #pragma RETAIN?
Thanks
Guy