I am using TI C2000 codegen tools 6.2.9 with GCC extensions enabled.
It seems that the __attribute__ ((used)) has no effect. When placing the following unused variable definition in my code, the linker will strip it out.
const unsigned char MyUnusedString[] __attribute__ ((used)) = "text";
One the other hand, if #pragma RETAIN is used, the unused variable will be retained by the linker.
#pragma RETAIN(MyUnusedString)
const unsigned char MyUnusedString[] = "text";
Is this expected behavior?