arm-elf 和 arm-none-eabi 工具链生成的可执行文件格式有区别吗?

Is there any difference in the format of executable file generated by arm-elf and arm-none-eabi toolchains?

我正在尝试构建一个裸机 arm 项目。我尝试了 GNU 工具链 arm-elfarm-none-eabi。两个工具链生成的可执行文件在转换为 intel hex 格式时运行良好。

我正在使用Proteus软件进行仿真。 Proteus 支持调试 elf 和 coff 格式的可执行文件。

在我的例子中,Proteus 接受由 arm-elf 生成的可执行文件,但在加载由 arm-none-eabi 生成的可执行文件时显示错误。 Proteus 显示的错误信息是:

我只是 运行 linux 中的 file 命令,将两个可执行文件作为参数,一个接一个。

结果如下图

arm-none-eabi输出

图像:ELF 32 位 LSB 可执行文件,ARM,EABI5 版本 1 (SYSV),静态链接,未剥离

手臂精灵输出

图像:ELF 32 位 LSB 可执行文件,ARM,版本 1,静态链接,未剥离

是否有任何选项可以使用 arm-none-eabi 工具链生成 Proteus 兼容的 elf 文件?

编辑: 我的收费链版本的详细信息。

C:\SysGCC\arm-elf\bin>arm-elf-gcc.exe --version
arm-elf-gcc.exe (GCC) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

C:\SysGCC\arm-elf\bin>arm-elf-as.exe --version
GNU assembler (GNU Binutils) 2.22
Copyright 2011 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `arm-elf'.

sreeyesh@ITP-PTLX118:~$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (15:4.9.3+svn227297-1) 4.9.3 20150529 (prerelease)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

sreeyesh@ITP-PTLX118:~$ arm-none-eabi-as --version
GNU assembler (2.25-10ubuntu1+5build1) 2.25
Copyright (C) 2014 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `arm-none-eabi'.

提前致谢。

我终于找到了问题的解决方案。我注意到,在 Proteus 中,有一个选项可以配置工具链并从 Proteus 本身构建源代码。

我刚刚在 Proteus 中做了以下事情

  1. 从支持的编译器列表中选择了 GNU ARM 工具链
  2. 将工具链路径配置为指向我的 arm-none-eabi 工具链。
  3. 创建了一个主函数为空的新项目。
  4. 构建项目。

构建成功,更有趣的是我可以调试生成的可执行文件。

Proteus 记录构建命令。当我分析日志时,我注意到 Proteus 在调用 arm-none-eabi-gcc 时使用了一些额外的选项。我尝试了这些额外的选项,最后发现选项 -gdwarf-2 起着关键作用。

我用这个选项更新了我的 makefile,它工作正常。

这个选项只是启用DWARF version 2格式,这就是我从网络搜索中了解到的全部内容。但是为什么 arm-elf 工具链在没有这个选项的情况下工作仍然是我心中的一个问题。也许,这个选项在 arm-elf 中默认启用。

无论如何,我对这个发现很满意,因为我现在可以继续我的工作了。

感谢所有抽出宝贵时间帮助我的人。希望这一发现能帮助人们使用 GNU ARM 工具链试验 Proteus 模拟。