OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start) //指定程序的入口点,在start.s中的_start。
SECTIONS
{
. = 0x00000000;
. = ALIGN(4); //4个字节对齐
.text : //文本段
{
cpu/arm920t/start.o (.text)
*(.text)
}
. = ALIGN(4);
.rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } //数据只读段
. = ALIGN(4);
.data : { *(.data) } //数据段
. = ALIGN(4);
.got : { *(.got) }
. = .; //存放uboot中的命令
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
//BSS段,block by start symbol
. = ALIGN(4);
__bss_start = .;
.bss (NOLOAD) : { *(.bss) . = ALIGN(4); }
_end = .;
}
由u-boot.lds的内容可以看出,start.o在链接时被安排到最开始的位置。将编译生成的.o和.a文件按照board/samsung/config.mk文件的代码段起始地址即TEXT_BASE = 0x33F80和uboot.lds链接脚本进行连接。
因此可得到elf格式的uboot。
ELF:Linux操作系统下的可执行映像文件。
AXF:ARM的调试文件,ADS常试用。
BIN:真正的可执行文件,可写到Flash或RAM中运行。Uboot之u-boot.lds的链接脚本,布布扣,bubuko.com
原文:http://blog.csdn.net/yuesichiu/article/details/21075047