我有一个嵌入式ARM系统,它运行Linux内核2.6.20.7。内核是用gcc 4.0.2编译的,我想为这个系统编译程序。我已经尝试了几个工具链(代码源等),但没有运气。我可以编译程序但是只要我在嵌入式系统上运行它就会出现“非法指令”错误。现在我想创建自己的gcc工具链。首先,我想找出ABI以及我必须构建gcc工具链的目标。
我从嵌入式系统下载了一个程序并运行'readelf -h':
ELF Header:
Magic: 7f 45 4c 46 01 01 01 61 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: ARM
ABI Version: 0
Type: EXEC (Executable file)
Machine: ARM
Version: 0x1
Entry point address: 0x8520
Start of program headers: 52 (bytes into file)
Start of section headers: 3772 (bytes into file)
Flags: 0x602, has entry point, GNU EABI, software FP, VFP
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 6
Size of section headers: 40 (bytes)
Number of section headers: 25
Section header string table index: 24
有人知道如何将这些信息转换为--target =参数来构建gcc工具链吗?它是一个ARM系统,它运行Linux,所以它必须是--target = arm-linux -...,对吗?但接下来会发生什么?