Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Utility for analysing symbols in a library file

I'm having some problems with a large static library (.lib) file, and am suspecting code bloat from indiscriminate use of template classes. I want to analyse the symbols in the library to confirm which are making up the bulk of the file size.

When I link my executable against this library, the resulting output is much more sensible, size-wise (about 20Mb), so the linker is obviously stripping out lots of redundant symbols. I want to find out what its removing..

I know I can use dumpbin to generate the symbols and headers, but, with the library in question being pretty large (900Mb), this dump is pretty much unusable without a utility for parsing and reporting on it.

Obviously I could write this myself, but was wondering if anyone can recommend any freeware already available for this?

like image 223
StevieG Avatar asked Jun 15 '11 12:06

StevieG


2 Answers

Is this your own library? If so you can generate a link map that describes the layout of the code in the library, which would give you the info you need here in a more friendly form.

If you don't have source code access to do this, you could use Perl or other open-source scripting tools to crack the dumpbin output.

EDIT: you could also give LibDump a spin, it's downloadable from here. I have not used this myself.

like image 151
Steve Townsend Avatar answered Oct 04 '22 18:10

Steve Townsend


I found one (SymbolSort) that works really well, gives me exactly what I need:

like image 31
StevieG Avatar answered Oct 04 '22 17:10

StevieG