google / bloaty

Bloaty: a size profiler for binaries
Apache License 2.0
4.71k stars 340 forks source link

How do bytes originating from code in headers get allocated when using -d compileunit? #303

Open travisdowns opened 2 years ago

travisdowns commented 2 years ago

This is a question, not a bug or feature request. Please let me know if that is not appropriate for a github issue.

When using -d compileunit each byte is assigned back to the originating compile unit, but how does it work for symbols that would appear in many .o files, with the linker selecting one? For example template code will generally appear in every compile unit using that template, but only one will appear in the final binary as the link selects one copy "arbitrarily". How does bloaty report it? Perhaps to the compile unit the linker selected the copy from?