This node.js package can parse a mapfile generated by GCC and create a structured JSON object from it with all linked sections and symbols.
This can be useful in embedded software development when you want to see what memory is occupied by what code.
Creating a mapfile is an option of the GCC linker.
Set the following arguments to your linker flags to generate filename.map
in your build directory:
-Wl,--cref,-Map=filename.map
npm i -g gcc-mapfile-tool
create a JSON file:
gcc-mapfile-tool filename.map --output=mapfile.json
create a JSON file with sorted elements:
gcc-mapfile-tool filename.map --output=mapfile.json --sortby=length --order=desc
create a dynamic HTML document based on datatables.net:
gcc-mapfile-tool filename.map --output=mapfile.html --format=html