This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LS3137: tms570 CCS优化问题

Part Number: TMS570LS3137

在CCS中定义了如下的变量,这个变量程序里不会被显示引用,但是我是需要用到的。发现会被编译器优化调,如何指定属性让该变量不被优化调能顺利编译到exe中?

const struct soft_info_t softinfo __attribute__((used, section(".softinfo_head_section")))=
{
( unsigned int)app_entry, //app入口函数地址
( unsigned int)&dataLoadStart,
( unsigned int)&dataRunStart,
( unsigned int)&dataLoadSize
};