Let's say that I have a C++ program, which when compiled, produces an executable binary many megabytes in size. How do I find out where this size came from? Is there a tool that can show that X% of the size came from file or class Y, etc?
Ideally, I'm looking for a tool similar to Disk Usage Analyzer that can break down what makes up an executable into some kind of pie chart or other graph. If not, at least having the information available would allow creating charts.
The final goal would be to identify parts of the program that I can exclude from the executable to shrink it down and optimize for size, starting from the largest pieces of unnecessary code.
./bloaty filenamehere -n 0 -d compileunits --csv > output.csv. If you post this as an answer I will accept it.