huchuan2025/20-Area/22-Work/222-ReadNote/armv8体系结构/LDS文件说明.md

35 lines
782 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

- 例子
`SECTIONS`
`{`
`. = 0x10000;`
`.text : { *(.text) }`
`. = 0x8000000;`
`.data : { *(.data) }`
`.bss : { *(.bss) }`
`}`
`section [address] [(type)] :`
`[AT(lma)]`
`[ALIGN(section_align)]`
`[constraint]`
`{`
`output-section-command`
`output-section-command`
`...`
`} [>region] [AT>lma_region] [:phdr :phdr ...] [=fillexp]`
- MEMORY字段用于定义内存区域Memory Region
- SECTIONS
- 告诉链接器如何把输入段映射到输出段。
- LOADADDR/ADDR
- LOADADDR 返回加载地址LMA
- ADDR 返回虚拟地址VA
- PROVIDE
- provide定义的值相当于一个弱符号 可以被后面的定义进行覆盖。
- KEEP
- SIZEOF
- 各种地址
- 加载地址
- 运行地址
- 链接地址 objdump看到的地址