make all
arm-linux-gcc -g -c start.S
start.S: Assembler messages:
start.S:13: Error: bad instruction `_undefined_interrupt .word undefined_interrupt'
start.S:14: Error: bad instruction `_software_interrupt .word software_interrupt'
start.S:15: Error: bad instruction `_prefetch_abort .word prefetch_abort'
start.S:16: Error: bad instruction `_data_abort .word data_abort'
start.S:17: Error: bad instruction `_not_used .word not_used'
start.S:18: Error: bad instruction `_irq .word irq'
start.S:19: Error: bad instruction `_fiq .word fiq'
make: *** [start.o] Error 1
解决办法:
在_undefined_interrupt后面加上:表示是一条伪指令。.word undefined_interrupt再只想双字节的地址。
_undefined_interrupt: .word undefined_interrupt
_software_interrupt: .word software_interrupt
_prefetch_abort: .word prefetch_abort
_data_abort: .word data_abort
_not_used: .word not_used
_irq: .word irq
_fiq: .word fiq
然后继续报错
make all
arm-linux-ld -Tgboot.lds -o gboot.elf start.o
arm-linux-ld:gboot.lds:6: syntax error
make: *** [all] Error 1
解决办法:
说明在gboot.lds的第六行出错了:
SECTION {
改成>>
SECTIONS {
然后继续报错:
make all
arm-linux-ld -Tgboot.lds -o gboot.elf start.o
arm-linux-objdump -O binary gboot.elf gboot.bin
arm-linux-objdump: invalid option -- 'O'
解决办法:
在把elf转成bin文件的时候,是使用arm-linux-objcopy命令。而不是objdump反汇编命令,真是服了,最后终于成功编译了。
阅读(1702) | 评论(0) | 转发(0) |