Linker Script
  • The expression ‘*(.text)’ means all ‘.text’ input sections in all input files.
*(.text)
  • 將作用的函數或資料擺入指定名為"section_name"匯入段。
__attribute__((section("section_name")))
# 變數var將被擺入名為.xdata的匯入段
int var __attribute__((section(".xdata"))) = 0;

# 使函數functionA被擺入名叫.xinit的匯入段
static int __attribute__((section(".xinit"))) functionA(void)
{
.....
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License