Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Listing Code and Data Size With GNU nm in Eclipse

DZone's Guide to

Listing Code and Data Size With GNU nm in Eclipse

Learn how to view the code running your IoT device and the data allocation it's using with this simple command for the Eclipse IDE.

· IoT Zone ·
Free Resource

The map file produced by the GNU linker includes lots of information, however, it is very cryptic to read. In "Listing Code and Data Size for each Source File with GNU and Eclipse" I showed how the GNU size utility can be used to report the code and data size for each object file. The Eclipse-based MCUXpresso IDE comes with another nice view which shows detailed information about code and data allocation:

Image title

One way to use that view is to use the context menu on the .elf/.axf file:

Image title

Using it on the linked binary shows all the variables (symbols) allocated in it, and I can sort the names/addresses/etc.

I can use it on an archive/library file or single object file too:

Image title

You can generate that kind of information using the 'nm' command, e.g.

arm-none-eabi-nm -S --size-sort -s MyBinary.axf 

Image title

Happy sizing!

Topics:
iot ,eclipse ,iot data ,eclipse ide

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}