Sre*_*esh 4 c gcc arm elf gnu-toolchain
我正在尝试构建一个裸机臂项目。我尝试了 GNU 工具链arm-elf和arm-none-eabi. 两个工具链生成的可执行文件在转换为英特尔十六进制格式时运行良好。
我正在使用 Proteus 软件进行模拟。Proteus 支持调试 elf 和 coff 格式的可执行文件。
在我的情况下,Proteus 接受由生成的可执行文件,arm-elf但在加载由arm-none-eabi. Proteus 显示的错误信息是:
我只是file在 linux 中运行命令,将两个可执行文件作为参数,一一运行。
结果如下所示。
图像: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'.
Run Code Online (Sandbox Code Playgroud)
提前致谢。
我终于找到了问题的解决方案。我注意到,在 Proteus 中,可以选择配置工具链并从 Proteus 本身构建源代码。
我只是做了以下事情
构建成功,更有趣的是我可以调试可执行文件。
Proteus 记录构建命令。当我分析日志时,我注意到 Proteus 在调用 arm-none-eabi-gcc 时使用了一些额外的选项。我尝试了这些额外的选项,最后发现选项-gdwarf-2起着关键作用。
我用这个选项更新了我的 makefile,它工作正常。
这个选项只是启用了 DWARF 版本 2 格式,这就是我从网络搜索中了解到的。但是为什么 arm-elf 工具链在没有这个选项的情况下工作仍然是我心中的一个问题。可能是,默认情况下在 arm-elf 中启用了此选项。
无论如何,我对这个发现很满意,因为我现在可以继续我的工作了。
感谢所有抽出宝贵时间帮助我的人。希望这一发现能帮助人们使用 GNU ARM 工具链进行 Proteus 模拟试验。
| 归档时间: |
|
| 查看次数: |
984 次 |
| 最近记录: |