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

 

用法:

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

 

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

 posted on 2019-08-30 11:18  PoloKey  阅读(2453)  评论(0)    收藏  举报