1. Reference
arm-2011.03/share/doc/arm-arm-none-eabi/pdf/ld.pdf
2. An example
OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
/* Use OUTPUT_FORMAT with three arguments to use different formats based
on the ‘-EB’ and ‘-EL’ command line options. This permits the linker script to
set the output format based on the desired endianness.*/
MEMORY
{
rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00008000
ram (rwx) : ORIGIN = 0x10000000, LENGTH = 0x00002000
}
/* Program code and read-only data go into the ROM. Read-write data goes into
the RAM. An image of the initialized data is loaded into the ROM and will be
copied during system

本文介绍了如何使用ARM GCC的链接器脚本来定义内存布局和节区分配。重点讲解了OUTPUT_FORMAT选项根据endianness设置输出格式,以及如何将程序代码、只读数据放入ROM,读写数据放入RAM。此外,还涵盖了.isr_vector、.data、.bss等节区的处理,以及栈的配置。
最低0.47元/天 解锁文章
1157

被折叠的 条评论
为什么被折叠?



