makefile: test.bin: test arm-2440-linux-gnueabi-objcopy -I elf32-littlearm test -O binary test.bin cp test.bin ../../ test : test.o arm-2440-linux-gnueabi-ld -Ttext=0x30000000 test.o -o test test.o : test.S arm-2440-linux-gnueabi-as test.S -o test.o clean: rm -f test.o test test.bin ../../test.bin test.S: mov ip, sp stmfd sp!, {fp, ip, lr, pc} sub fp, ip, #4 ldr r0, =str mov lr, pc ldr pc, show sub sp, fp, #12 ldmfd sp, {fp, sp, pc} show: .word 0x33f9303c str: .asciz "1111111" 删除线chrome下竟然不能用 只能用框框了 下一个框框是上次错误的分析: 这段程序编译链接格式化后 不管下载到sdram的哪个位置都能打印出hello 为什么? 我们明明指定了text段的地址为30000000 而我们不管下载到30000000 或者 40000000 程序都打印出了相同的结果 这段程序编译链接格式化后 下载到40000000 运行出错 下载到30000000运行正确原因是我们指定了text段地址为30000000 我们接着看一下: [leftover-crazy@leftover-crazy 7nd]$ arm-2440-linux-gnueabi-objdump -d test.o -h test.o: file format elf32-littlearm Sections: Idx Name Size VMA LMA File off Algn 0 .text 00000030 00000000 00000000 00000034 2**2 CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE 1 .data 00000000 00000000 00000000 00000064 2**0 CONTENTS, ALLOC, LOAD, DATA 2 .bss 00000000 00000000 00000000 00000064 2**0 ALLOC 3 .ARM.attributes 00