代码:
#include <stdio.h>
#include <string.h>
int main()
{
printf("helloworld\n");
}
编译:
arm-none-linux-gnueabi-gcc helloworld.c -o helloworld
这样编译的输出的是默认动态链接的helloworld,可以在mini2440的linux.2.6.29环境运行
arm-none-linux-gnueabi-gcc -static helloworld.c -o helloworld
这样编译的输出的是默认静态链接的helloworld,在mini2440的linux.2.6.29环境运行时,会提示“非法指令‘
说明:
编译kernel和kernel是同一个便要求,kernel编译选择了eabi。文件系统采用mini2440默认的。
求助各位:
具体是什么原因导致的这个问题?我再网上搜了很久都没有什么结果,有人有相似的问题,说是sh的问题。是吗?