如果没有编译过 uboot 的话链接脚本为 arch/arm/cpu/u-boot.lds。但是这个不是最终使用的链接脚本,最终的链接脚本是在这个链接脚本的基础上生成的。编译一下 uboot,编译完成以后就会在 uboot 根目录下生成 u-boot.lds文件
1 OUTPUT_FORMAT( ("elf32-littlearm", , "elf32-littlearm", , "elf32-littlearm") ) 2 OUTPUT_ARCH(arm) 3 ENTRY(_start) 4 SECTIONS 5 { 6 . = 0x00000000; 7 . = ALIGN(4); 8 .text : 9 { 10 *(.__image_copy_start) 11 *(.vectors) 12 arch/arm/cpu/armv7/start.o (.text*) 13 *(.text*) 14 } 15 . = ALIGN(4); 16 .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } 17 . = ALIGN(4); 18 .data : { 19 *(.data*) 20 } 21 . = ALIGN(4); 22 . = .; 23 . = ALIGN(4); 24 .u_boot_list : { 25 KEEP(*(SORT(.u_boot_list*))); 26 } 27 . = ALIGN(4); 28 .image_copy_end : 29 { 30 *(.__image_copy_end) 31 } 32 .rel_dyn_start : 33 { 34 *(.__rel_dyn_start) 35 } 36 .rel.dyn : { 37 *(.rel*) 38 } 39 .rel_dyn_end : 40 { 41 *(.__rel_dyn_end) 42 }