Illegal instruction
问题跟踪1.
# ./hello
-/bin/sh: ./hello: not found
原因是没有静态库
编译的时候:
arm-linux-gcc -static -o hello hello.c
但是问题依然没有完全的解决,出现
# ./hello
Illegal instruction
这个问题
wind@Thinkpad-T60:~/Work/TQ$ file hello1
hello1: ELF 32-bit LSB executable, ARM, version 1, statically linked, for GNU/Linux 2.0.0, not stripped
这是用gcc编译出来的a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped
思考:
是不是内核版本的问题??
为什么arm-linux-gcc 编译出来的文件是2.0.0版本的呢??
没看明白是什么意思。你确定不是x86的程序在ARM上跑或者是反过来? 回复 2# tempname2
哈哈,没有。。
问题解决了。EABI问题。。
前辈们解决了好多遍的问题。。
到处是资料。
驱动程序:
#include <linux/***.h> 是在linux-2.6.29/include/linux下面寻找源文件。
#include <asm/***.h> 是在linux-2.6.29/arch/arm/include/asm下面寻找源文件。
#include <mach/***.h> 是在linux-2.6.29/arch/arm/mach-s3c2410/include/mach下面寻找源文件。
#include <linux/module.h>//最基本的文件,支持动态添加和卸载模块。Hello World驱动要这一个文件就可以了
#include <linux/fs.h>//包含了文件操作相关struct的定义,例如大名鼎鼎的struct file_operations
#include <linux/errno.h>//包含了对返回值的宏定义,这样用户程序可以用perror输出错误信息。
#include <linux/types.h>//对一些特殊类型的定义,例如dev_t, off_t, pid_t.其实这些类型大部分都是unsigned int型通过一连串的typedef变过来的,只是为了方便阅读。
#include <linux/cdev.h>//对字符设备结构cdev以及一系列的操作函数的定义。
#include <linux/wait.h>//等代队列相关头文件
应用程序:
#include <fcntl.h> //包含了open()函数的flags,mode参数的宏定义。 驱动程序的头文件。。 怎么解决的没有看明白 回复 1# xfortune
编译时,指定新的头文件? 回复 3# xfortune
具体怎么解决的啊。 回复 8# cliffordl
我当时是,编译环境的问题,交叉编译没有安装好 回复 9# xfortune
能不能具体点啊。谢谢了。
页:
[1]
2