arm

I am trying to compile a Hello World for ARM-1136J-S processor. When I compile the C source using CodeSourcery arm-none-linux-gnueabi-gcc (2008q3 edition), it executes successfully on the ARM, but when I compile same code using arm-linux-gnueabi-gcc (installed through apt-get in Ubuntu 12.01) it gives the following error:

./helloworld: line 1: syntax error: unexpected word (expecting ")")

readelf of both the executables show that the binary compiled using Ubuntu toolchain has following extra attributes:

Tag_CPU_unaligned_access: v6
Tag_DIV_use: Not allowed

How can I make it run using Ubuntu toolchain? Can anyone give some hint on that? Thanks


./helloworld: line 1: syntax error: unexpected word (expecting ")")

This doesn't look like a native code error at all - it looks like a script error. Are you sure "helloworld" is actually your compiled binary. Running compiled C code binaries does not give syntax errors ...


Check that your kernel has support for THUMB binaries: zcat /proc/config.gz |grep THUMB

Try running 'readelf' on your executable. If the entry point address is an odd number (indicating THUMB or mixed ARM/Thumb) and your kernel lacks THUMB executable support, your binary will be rejected by the kernel, and will be attempted to be run as a shell script.

链接地址: http://www.djcxy.com/p/86940.html

上一篇: 交叉编译ARM板?

下一篇: