25

I am new to arm architecture, I work on embedded software and was trying to learn about the .axf file which is present in my project binary's debug folder.

Discovered that it is an arm executable format file generated by linker while the build process and it is used in debugging the crashes. So it is obvious that it contains some debugging information but its not clear what kind of information that is? And also there exists one .map file in the debug folder, so what could be the difference between these two files?

Pravi
  • 599
  • 3
  • 6
  • 10
  • 1
    I've googled it for you. , hope it helps a little. – lulyon Jul 20 '13 at 12:02
  • 1
    Thanks, I have already read that link. But I would like to know what type of information it contains. Also what is the difference between .axf and .map files? – Pravi Jul 20 '13 at 12:09
  • 6
    axf is the binary file, has the machine code (and other things), as the google answer above states it is a wrapper around an elf or aif. generally map files just have a map, a list of addresses, where things ended up after the linking process. – old_timer Jul 20 '13 at 13:01
  • As of time of writing the ARM forum link no longer works, so I'm grateful this resource is available! Thanks for asking @Pravi. – Eric Canton Aug 03 '23 at 21:36

1 Answers1

34

The AXF file is an object file format generated by ARM's RealView compiler (also part of Keil's ARM-MDK) and contains both object code and debug information. In the debugger, while just the object code is loaded on the target itself, both the code and the debug information are loaded in the development host's memory.

When debugging (of any kind - not just crashes) via JTAG, SWD or other connection the code needs to be available on the host along with the debug information that associates that code with the original source code. Over the debug connection, only minimal data such as register values are transferred, so for example the debugger will take the program counter value and be able to display the assembler and source code which is available on the host using the debug data in the AXF.

The MAP file contains some of the same information, but it is intended for human readability and consumption rather than machine use, and does not contain the source code line to object code association data needed by source level debugger.

Mostly you can ignore it - the compiler generates it, the debugger loads it. Your toolchain probably also generates a .hex file which is what you'd use for production programming and contains just the machine code and constant data and initialisers.

Clifford
  • 88,407
  • 13
  • 85
  • 165