__attribute__((used,section...)) 把变量放入自定义section中


参考:http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Variable-Attributes.html

 

用法:

char *kTest __attribute((used, section("__DATA, Testdata"))) = "i/m test";

 

使用 used字段,即使没有任何引用,在Release下也不会被优化


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM