当使用armv4目标时,binutils ld发出ARM BLX指令
|
我希望为运行Linux 2.6.32.2内核的Samsung S3C2440 SoC(基于ARM920T内核)编译C程序。我已经在ARM926EJS上运行了现有的Gentoo Linux安装。
我使用以下gcc选项编译S3C2440的C程序:
gcc -mcpu=arm920t -o hello hello.c
运行编译后的可执行文件(单个printf \“ hello world \”)后,我仅得到“非法指令”。我没有为目标编译GDB,并且dmesg没有报告错误指令的地址。
我看到在可执行文件上运行\“ objdump -d \”列出了一条BLX指令,显然,ARM920T内核不支持该指令。
# gcc -mcpu=arm920t -o hello hello.c && objdump -d hello|grep blx
83cc: e12fff33 blx r3
经过进一步的研究,似乎BLX用于GNU-EABI二进制文件的Thumb支持,并由\'ld \'生成。使用GCC的\'-c \'选项只是进行编译似乎可以确认这一点,因为在单独的目标文件的objdump -d输出中没有BLX指令。
BLX指令会是我遇到的问题吗?如果是,我如何告诉'ld \'在最终链接的可执行文件中不生成BLX指令?
软件版本:
# ld -V
GNU ld (GNU Binutils) 2.20.1.20100303
Supported emulations:
armelf_linux_eabi
armelfb_linux_eabi
# gcc -v
Using built-in specs.
Target: armv5tel-softfloat-linux-gnueabi
Configured with: /var/tmp/portage/sys-devel/gcc-4.4.5/work/gcc-4.4.5/configure --prefix=/usr --bindir=/usr/armv5tel-softfloat-linux-gnueabi/gcc-bin/4.4.5 --includedir=/usr/lib/gcc/armv5tel-softfloat-linux-gnueabi/4.4.5/include --datadir=/usr/share/gcc-data/armv5tel-softfloat-linux-gnueabi/4.4.5 --mandir=/usr/share/gcc-data/armv5tel-softfloat-linux-gnueabi/4.4.5/man --infodir=/usr/share/gcc-data/armv5tel-softfloat-linux-gnueabi/4.4.5/info --with-gxx-include-dir=/usr/lib/gcc/armv5tel-softfloat-linux-gnueabi/4.4.5/include/g++-v4 --host=armv5tel-softfloat-linux-gnueabi --build=armv5tel-softfloat-linux-gnueabi --disable-altivec --disable-fixed-point --without-ppl --without-cloog --with-float=soft --enable-nls --without-included-gettext --with-system-zlib --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --with-python-dir=/share/gcc-data/armv5tel-softfloat-linux-gnueabi/4.4.5/python --enable-checking=release --disable-libgcj --with-arch=armv5te --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion=\'Gentoo 4.4.5 p1.2, pie-0.4.5\'
Thread model: posix
gcc version 4.4.5 (Gentoo 4.4.5 p1.2, pie-0.4.5)
没有找到相关结果
已邀请:
1 个回复
久坡