cgccarmelfgnu-toolchain

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


I am trying to build a bare metal arm project. I tried the GNU toolchains arm-elf and arm-none-eabi. Executables generated by both toolchains, when converted to intel hex format, runs fine.

I am using the software Proteus for simulation. Proteus supports debugging executables in both elf and coff format.

In my case Proteus accepts the executable generated by arm-elf but its showing error when loading the executable generated by arm-none-eabi. The error message shown by Proteus is:

enter image description here

I just ran the file command in linux with the two executables as argument, one by one.

The results are shown below.

arm-none-eabi output

image: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped

arm-elf output

image: ELF 32-bit LSB executable, ARM, version 1, statically linked, not stripped

Is there any option to generate Proteus compatible elf file using arm-none-eabi toolchain?

Edit: Details of my tollchains' versions.

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'.

Thanks in advance.


Solution

  • I finally found out the solution for the issue. I noticed that, in Proteus, there is an option to configure the toolchain and build the source code from Proteus itself.

    I just did the following things in Proteus

    1. Selected GNU ARM toolchain from the list of supported compilers
    2. Configured the toolchain path to point to my arm-none-eabi toolchain.
    3. Created a new project with an empty main function.
    4. Built the project.

    The build was successful and more interestingly I could debug the generated executable.

    Proteus logs the build commands. When I analyzed the logs, I noticed that some extra options were being used by Proteus when invoking arm-none-eabi-gcc. I experimented with those extra options and finally found out that the option -gdwarf-2 plays the key role.

    I updated my makefile with this option and it worked fine.

    This option simply enables DWARF version 2 format, That's all that I understood from the web search. But why the arm-elf toolchain worked without this option is still a question in my mind. Maybe, this option is enabled in arm-elf by default.

    Anyway I am satisfied with this finding as I can proceed with my work now.

    Thanks to all those who spared their precious time to help me out. Hope this finding will help people experimenting with Proteus simulation using the GNU ARM toolchain.