Through investigating bug 680973 , I learned about:
nm --size-sort --reverse-sort --demangle --synthetic --line-numbers lib.unstripped/libchrome.so | perl -p -e 's/constprop.*?\]/constprop]/g'
This lists symbols by size.
It would be great if there were some post-processing done on the output though. Mainly, the "merged" options that are doable by this windows tool:
https://github.com/adrianstone55/SymbolSort/blob/master/SymbolSort.txt
(Note that the tool can actually be used on nm output, but is written in C#, so a python script might be more friendly).
The three most useful aggregations (imo) are:
1. Merged Duplicate Symbols - shows when statics in headers are an issue
2. Merged Template Symbols - shows when templates lead to code bloat (merge with <>s removed)
3. Merged Overloaded Symbols - shows when overloads are excessive (merge with function params removed) (not actually sure this is that useful...)
Clustering by path is not as useful with nm output, since many symbols are lacking path information. Tools such as:
https://cs.chromium.org/chromium/src/tools/binary_size/
https://github.com/google/bloaty
Attempt to retrieve better path information by looking more into debugging information. However, I haven't found them to work terribly well either :/.
Comment 1 by agrieve@chromium.org
, Jan 17 2017