uboot链接脚本

uboot\board\samsung\x210\u-boot.lds

OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
/*OUTPUT_FORMAT("elf32-arm", "elf32-arm", "elf32-arm")*/
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
	. = 0x00000000;
 
	. = ALIGN(4);
	.text      :
	{
	  cpu/s5pc11x/start.o	(.text)
	  cpu/s5pc11x/s5pc110/cpu_init.o	(.text)
	  board/samsung/x210/lowlevel_init.o	(.text)
          cpu/s5pc11x/onenand_cp.o      (.text)                 
          cpu/s5pc11x/nand_cp.o (.text)                     
          cpu/s5pc11x/movi.o (.text) 
          common/secure_boot.o (.text) 
	  common/ace_sha1.o (.text)
	  cpu/s5pc11x/pmic.o (.text)
	  *(.text)
	}
 
	. = ALIGN(4);
	.rodata : { *(.rodata) }
 
	. = ALIGN(4);
	.data : { *(.data) }
 
	. = ALIGN(4);
	.got : { *(.got) }
 
	__u_boot_cmd_start = .;
	.u_boot_cmd : { *(.u_boot_cmd) }
	__u_boot_cmd_end = .;
 
	. = ALIGN(4);
	.mmudata : { *(.mmudata) }
 
	. = ALIGN(4);
	__bss_start = .;
	.bss : { *(.bss) }
	_end = .;
}

这个链接地址,获取方式有两种,

一种是裸机中-Ttext 0x0,

一种是链接脚本中.=0x00000000,

而具体到我们这个链接地址的由来,

往上追得话就是这里,主makefile中TEXT_BASE,

x210_sd_config :	unconfig
	@$(MKCONFIG) $(@:_config=) arm s5pc11x x210 samsung s5pc110
	@echo "TEXT_BASE = 0xc3e00000" > $(obj)board/samsung/x210/config.mk

一定要注意uboot的TEXT段内顺序安排,部分初始化代码注意不要超过前16kb。

猜你喜欢

转载自blog.csdn.net/lushoumin/article/details/82844681
今日推荐