Linker Script
- Link script file
- Embedded Programming with the GNU Toolchain
- ld Documentation for binutils 2.25
- vmlinux.lds.S
- 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)
{
.....
}
- Embedded Programming with the GNU Toolchain - 10. C Startup
page revision: 22, last edited: 25 Feb 2016 09:55