Link Script
1.程序入口
1)命令行"-e"参数指定的入口
2)ENTRY(symbol)
3)定义的start符号地址
4).text正文的第一个字节
5)地址 0.
2.SECTIONS command
SECTIONS
{
sections-command
sections-command
...
}
Each sections-command may be one of the following:
* an ENTRY command
* a symbol assignment
* an output section description
* an overlay description
3. Output sections description
section [address] [(type)] : [AT(lma)]
{
output-section-command
output-section-command
...
} [>region] [AT>lma_region] [:phdr :phdr ...] [=fillexp]
Each output-section-command may be one of the following:
* a symbol assignment
* an input section description
* data value to include directly
* a special output section keyword
4. Output section type
* NOLOAD The section should be marked as not loadable, so that it will not be loaded into memory when
the program is run.
* DSECT
* COPY
* INFO
* OVERLAY Rarely used.
5. Output section LMA
The linker will normall set the LMA equal to the VMA.
Use AT keyword to change that.
The expression lma that follows the AT keyword specifies the load address for the section's load address.
Alternatively "AT>lma_region" specify a memory region for the section's load address.
This feature is designed to make it easy to build a ROM image.
6. Output section region
Use ">region" to assign a section to a previously defined region of memory.
7. Ouput section phdr
":phdr" is used to assign a section to a previously defined program segment.
阅读(1005) | 评论(0) | 转发(0) |