Given a dll/exe (with or without .pdb), can I see what .obj files contribute to its size and how much?
I compiled a dll file with a whole bunch o开发者_开发技巧f cpp files. I want to see how much each cpp contributes to the final size of the dll, in order to cut down its size (say by excluding some libraries). Is there any way to do that? Thank you!
This ranges from quite difficult (which object do you charge library functions against) to impossible (when whole program optimization is used to inline across compilation unit boundaries).
I also suggest that it's not very useful. You need to know which functions to target for slimming down, not just which files.
Generating a map file during the build (pass /MAP
to LINK.EXE
) is probably the best you can do. The documentation also mentions something about symbol groups, which you might be able to use to your advantage as well.
精彩评论