#define sec(x) __attribute__((section(#x),used))

#define sec(x)             __attribute__((section(#x),used))

关键字attribute可用于为函数或数据声明属性值,这样可以让编译程序优化处理。比如内核里面经常能看见的section:

#define __exception     __attribute__((section(".exception.text")))
1
具有该属性的函数,汇编代码将会放置到.exception.text段中,而不是.text段中。

发布了188 篇原创文章 · 获赞 35 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/dop102/article/details/103254719