views:

760

answers:

3

I am looking for a tool to simplify analysing a linker map file for a large C++ project (VC6).

During maintenance, the binaries grow steadily and I want to figure out where it comes from. I suspect some overzealeous template expansion in a library shared between different DLL's, but jsut browsign the map file doesn't give good clues.

Any suggestions?

+1  A: 

No suggestion for a tool, but a guess as to a possible cause: do you have incremental linking enabled? This can cause expansion during subsequent builds...

The linker will strip unused symbols if you're compiling with /opt:ref, so if you're using that and not using incremental linking, I would expect expansion of the binaries to be only a result of actual new code being added. That's as far as I know... hope it helps a little.

Nick
/opt:ref is enabled, incremental linking disabled for the release build (which is affected.) But yeah, that are the first things to check
peterchen
+2  A: 

The map file should have the size of each section, you can write a quick tool to sort symbols by this size. There's also a command line tool that comes with MSVC (undname.exe) which you can use to demangle the symbols.

Once you have the symbols sorted by size, you can generate this weekly or daily as you like and compare how the size of each symbol has changed over time.

The map file alone from any single build may not tell much, but a historical report of compiled map files can tell you quite a bit.

Dan Olson
+2  A: 

Have you tried using dumpbin.exe on your .obj files?

Stuff to look for:

  • Using a lot of STL?
  • A lot of c++ classes with inline methods?
  • A lot of constants?

If anything of the above applies to you. Check if they have a wide visibility, i.e. if they are used/seen in large parts of your application.

Magnus Skog