4

This is the output I get from dumpbin AchievementsTable.obj /HEADERS

Microsoft (R) COFF/PE Dumper Version 8.00.50727.762
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file AchievementsTable.obj

File Type: ANONYMOUS OBJECT

ANON OBJECT HEADER VALUES
               1 version
             14C machine (x86)
        4C51334D time date stamp Thu Jul 29 08:52:45 2010
                 ClassID: {0CB3FE38-D9A5-4DAB-AC9B-D6B6222653C2}
            945F size
               0 flags

ALL my source does this. I am using VisualStudio 2005. I know for a fact that there are lots of COMDATs being exported, as the .exe subsequently links and executes correctly: are there compiler switches I should be avoiding? Here are the ones I am using:

/O1
/Ob2
/Oi
/GT
/GL
/I "..\dxsdk\include" <lots of include paths>
/D "WIN32" <lots of #defines>
/GF
/FD
/MT
/GS-
/Gy
/arch:SSE2
/fp:fast
/GR-
/Fo <directory specified>
/Fd <pdb filename specified>
/FR <directory specified>
/W4
/c
/Zi
/TP .\Source\databases\AchievementsTable.cpp

I'm open to commentary on my selection in general, but DumpBin use is the focus of this question: take it away, boys and girls...

jww
  • 97,681
  • 90
  • 411
  • 885
hatcat
  • 1,876
  • 1
  • 18
  • 37
  • Surely if you want to see symbols, you need to run `dumpbin AchievementsTable.obj /SYMBOLS`? – Tim Robinson Jul 29 '10 at 08:11
  • Nope, I'm using /GL so only the /HEADERS option is available. I'm using SymbolSort (see http://gameangst.com/?p=46 for more info) which requires the output from dumpbin /HEADERS – hatcat Jul 29 '10 at 08:17
  • Sorry, I haven't been clear here, I mean COMDATs rather than symbols. I will amend the question. – hatcat Jul 29 '10 at 08:19

1 Answers1

9

After a day of elimination, I discovered that the DUMPBIN documentation is a little ambiguous.

Switching on function level linking (/Gy) is needed to get the COMDAT output. Switching on cross module optimisations (/GL) delays code generation to link time. Therefore, although it is true that header information is available to code compiled with /GL, it is very limited. That's why it's the only option available to DUMPBIN - all the other options require more information, the generation of which is delayed by /GL.

hatcat
  • 1,876
  • 1
  • 18
  • 37
  • *"I discovered that the DUMPBIN documentation is a little ambiguous..."* - if its any consolation, I think Microsoft eventually changed it. The documentation for [dumpbin /SYMBOLS](https://msdn.microsoft.com/en-us/library/b842y285.aspx) now states: *"Only the /HEADERS DUMPBIN option is available for use on files produced with the /GL compiler option."* it looks like the change occurred sometime around VS2005. – jww Feb 06 '16 at 05:29