會用到這個部份是在uboot中,有個特別section(.u_boot_cmd),從Makefile trace到code中,看到神奇的一行code
#define U_BOOT_CMD(name,maxargs,rep,cmd,usage,help) cmd_tbl_t __u_boot_cmd_##name Struct_Section = {#name, maxargs, rep, cmd, usage}
將所以有的cmd fuction都定義成這樣的模式並且在Struct_Section中為
#define Struct_Section __attribute__ ((unused,section (".u_boot_cmd")))
所以在compile的時候,他就會把__u_boot_cmd_XXX的object code放到.u_boot_cmd的section中。
星期三, 1月 30, 2008
__attribute__ 用法 - 續
張貼者:
小明王
於
4:05 下午
標籤:
技術
相關文章:
- sed(string editor) - 2008-01-30
- __attribute__ 用法 - 2008-01-29
- Linux TimeZone - 2009-06-10
- Fon改 DD-WRT - 2009-01-04
- PS Eye on PC - 2008-12-17
訂閱:
張貼留言 (Atom)
0 意見:
張貼留言