#define sec(x) __attribute__((section(#x),used))
关键字attribute可用于为函数或数据声明属性值,这样可以让编译程序优化处理。比如内核里面经常能看见的section:
#define __exception __attribute__((section(".exception.text")))
1
具有该属性的函数,汇编代码将会放置到.exception.text段中,而不是.text段中。
#define sec(x) __attribute__((section(#x),used))
关键字attribute可用于为函数或数据声明属性值,这样可以让编译程序优化处理。比如内核里面经常能看见的section:
#define __exception __attribute__((section(".exception.text")))
1
具有该属性的函数,汇编代码将会放置到.exception.text段中,而不是.text段中。