Listing Code and Data Size with GNU nm in Eclipse

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:

Symbol Viewer in MCUXpresso IDE

Symbol Viewer in MCUXpresso IDE

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

View Symbols

View Symbols

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:

Symbols of object file

Symbols of object file

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

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

nm command line output

nm command line output

💡 Alternatively, have a look at the ‘Map File Browser’: http://www.sikorskiy.net/prj/amap/

Happy Sizing 🙂

Links

 

Advertisements

7 thoughts on “Listing Code and Data Size with GNU nm in Eclipse

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.