Map file interpretation tutorials for Embedded systems

c, c++, embedded

Solution

The map file is generated by the linker and the format of the file will be different for each linker. Your best bet is the documentation for the linker itself - there is unlikely to be a "general" tutorial. However for the most part a map file is simply a table of symbols, their location and their size. Usually there will be an overall summary of memory usage for static data and code space. I am not sure what there is to "teach" as such.

Some linkers can place other information in a map file, such as stack usage analysis for each function. The critical values being those for main() and any task/thread and ISR entry points.

Some may also generate cross-reference tables or call graphs, but for the most part a decent IDE or code navigation or documentation tool will generate more useful results.

Your best bet is perhaps to post questions about specific parts of the map file you are using that are causing you difficulty.

Problem

Context: I am writing C++ code for my micro-controller and would like to have an idea on how much each class/function/stl contributes to the code size. To see this information I searched in the .text section of the map file. Also I see some .objdump files. I am a little bit lost on where to start. Question: - Any tutorials/Examples for any micro-controller on how to interpret the map file, - Any generic example on how to understand the map file symbols, - Is their an universal file(like .map) that I can use for any controller/compiler that can be used to analyze the stack size, code size,etc... PS: I am also learning on the compilation process from links like this http://www.tenouk.com/ModuleW.html Thanks

Original source