uboot生产的文件的地址分布入下
- . = 0x00000000;
-
-
. = ALIGN(4);
-
.text :
-
{
-
cpu/arm920t/start.o (.text)
-
*(.text)
-
}
- ......
- ......
链接的起始地址是0x00000000,而且对start.o文件进行反汇编如下,此时没有链接
- ./cpu/arm920t/start.o: file format elf32-littlearm
- Disassembly of section .text:
- 00000000 <_start>:
- 0: ea000012 b 50
- 4: e59ff014 ldr pc, [pc, #20] ; 20 <_undefined_instruction>
- 8: e59ff014 ldr pc, [pc, #20] ; 24 <_software_interrupt>
- ......
- ......
- 00000050 :
- 50: e10f0000 mrs r0, CPSR
- 54: e3c0001f bic r0, r0, #31 ; 0x1f
- 58: e38000d3 orr r0, r0, #211 ; 0xd3
- 5c: e129f000 msr CPSR_fc, r0
- 60: e3a00453 mov r0, #1392508928 ; 0x53000000
- ......
- ......
对uboot进行反汇编
- .globl _start
-
_start: b reset
-
33f80000: ea000012 b 33f80050
-
ldr pc, _undefined_instruction
-
33f80004: e59ff014 ldr pc, [pc, #20] ; 33f80020 <_undefined_instruction>
-
ldr pc, _software_interrupt
-
33f80008: e59ff014 ldr pc, [pc, #20] ; 33f80024 <_software_interrupt>
链接完成后的地址并不是0x00000000,而是0x33f80000,当然机器码没有改变。
至于TEXT_BASE的定义是在board/***/config.mk文件里
uboot根目录下config.mk文件中
LDFLAGS += -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE)
将链接的地址改为0x33f80000
阅读(2597) | 评论(0) | 转发(0) |