很怪异的问题,应该是gcc没有正确产生大尾的目标工具。
做了以下的测试:
- clfs@debian:~$ echo "int main() {}" > test.c
- clfs@debian:~$ armeb-unknown-linux-gnu-gcc -c test.c
- clfs@debian:~$ file test.o
- test.o: ELF 32-bit MSB relocatable, ARM, version 1 (ARM), not stripped
复制代码- clfs@debian:~$ armeb-unknown-linux-gnu-gcc -e main test.o
- /home/armeb-root/cross-tools/lib/gcc/armeb-unknown-linux-gnu/4.2.1/../../../../armeb-unknown-linux-gnu/bin/ld: unrecognised emulation mode: armelf_linux
- Supported emulations: armelfb_linux armelfb
- collect2: ld returned 1 exit status
复制代码- clfs@debian:~$ armeb-unknown-linux-gnu-ld -e main test.o
- clfs@debian:~$ file a.out
- a.out: ELF 32-bit MSB executable, ARM, version 1 (ARM), statically linked, not stripped
复制代码- clfs@debian:~$ /home/armeb-root/cross-tools/lib/gcc/armeb-unknown-linux-gnu/4.2.1/../../../../armeb-unknown-linux-gnu/bin/ld -e main test.o
- clfs@debian:~$ file a.out
- a.out: ELF 32-bit MSB executable, ARM, version 1 (ARM), statically linked, not stripped
复制代码
上面的结果很怪异,当gcc间接调用ld时就会出错,直接敲ld命令则没有出错,不解!!
遇到了gcc的bug么? |