ELF map - mhightower83/Arduino-ESP8266-misc GitHub Wiki

Generate .MAP File

Add this line to platform.local.txt to have a map file created in the build directory, when you run Verify/Compile:

compiler.c.elf.extra_flags=-Wl,-Map,{build.path}/{build.project_name}.map

.ELF File Summary

This is obsolete with ESP8266 Core 2.6. It has a nice python script included that generates a summary.

To get a summary report of some interesting sections of the .elf file, such as .text (iram), .irom0.text, .data, .bss, and .rodata. You need to add a few lines to the file platform.local.txt in the Arduino IDE hardware platform folder. To find this folder see Finding Platform Folder

Add these lines to platform.local.txt:

tools.elfsum.cmd=xtensa-lx106-elf-objdump
tools.elfsum.path.linux={runtime.tools.xtensa-lx106-elf-gcc.path}/bin/
tools.elfsum.path.windows={runtime.tools.xtensa-lx106-elf-gcc.path}\bin\
tools.elfsum.flags=-h -w --section=.text --section=.irom0.text --section=.data --section=.bss --section=.rodata
recipe.hooks.linking.postlink.01.pattern.linux="{tools.elfsum.path}{tools.elfsum.cmd}" {tools.elfsum.flags} {tools.elfsum.extra_flags} "{build.path}/{build.project_name}.elf"
recipe.hooks.linking.postlink.01.pattern.windows="{tools.elfsum.path}{tools.elfsum.cmd}" {tools.elfsum.flags} {tools.elfsum.extra_flags} "{build.path}\{build.project_name}.elf"

To use this, you have to have verbose output turned on. For this do the following:

  • Set preferences for a verbose compile,
    • From the Arduino IDE select Edit->File->Preferences.
    • Find the selection: "Show verbose output during: [] compilation [] upload"
    • Check the box for "compilation"
  • Open your sketch.
  • Run Verify, (Sketch->Verify/Compile).
  • The summary will appear near the end of the Verify/Compile output, in the message area.