测试如下,定义两个变量,程序中都没有被使用到。其中一个是数组。为了避免被优化,都使用了__attribute__((used))进行修饰。
编译之后,在.map文件中,搜索这两个变量分配到的存储空间,结果只找到MyVariable_1这个变量,定义的MyVariable_0[10]数组,没有找到,可见还是被编译器优化掉了。
请问这种问题有没有解决方法?
您好,
已经收到了您的案例,调查需要些时间,感谢您的耐心等待。
您好
https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1307136/tms320f280025-failed-to-allocate-section-to-specified-memory-by-using-__attribute__
请您参考一下这个帖子说明。