我使用的硬件为Micro2440开发板
内核 Linux 2.6.32.2 for mini2440/micro2440
工具连 ARM-Linux GCC 4.3.2
编译内核时已打开对eabi 的支持
但是在运行带除法的程序时出现错误提示Illegal instruction
程序如下
#include <stdio.h>
#include <math.h>
int main(void)
{ int i=25,j=4,k;
char h=6;
printf("welcome to my rootfs step a! \n");
k=i /j;
printf("welcome to my rootfs step b! k=%d \n",k);
return 0;
}
运行结果如下
welcome to my rootfs step a!
Illegal instruction
但是使用ARM-Linux GCC 3.3.4 编译运用程序时为
welcome to my rootfs step a!
welcome to my rootfs step b! k=8
看汇编指令时发现如下不同
ARM-Linux GCC 4.3.2 下除法为
bl __aeabi_idiv
ARM-Linux GCC 3.3.4 下除法为
bl __divsi3
请问是什么问题?