为什么DumpBin告诉我二进制文件中没有COMDAT? [英] Why is DumpBin telling me there are no COMDATs in my binaries?

查看:171
本文介绍了为什么DumpBin告诉我二进制文件中没有COMDAT?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我从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

所有我的消息来源都这样做.我使用的是VisualStudio2005.我知道一个事实,就是导出了许多COMDAT,因为.exe随后会链接并正确执行:我应该避免使用编译器开关吗?这是我正在使用的:

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

我一般都会对我的选择发表评论,但是使用DumpBin是这个问题的重点:男孩和女孩,把它拿走...

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...

推荐答案

经过一天的消除,我发现DUMPBIN文档有点含糊.

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

需要打开功能级别链接(/Gy)以获取COMDAT输出.启用跨模块优化(/GL)会延迟代码生成到链接时间.因此,尽管确实可以将头信息提供给使用/GL编译的代码,但这是非常有限的.这就是为什么它是DUMPBIN可用的唯一选项的原因-其他所有选项都需要更多信息,/GL会延迟其生成.

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.

这篇关于为什么DumpBin告诉我二进制文件中没有COMDAT?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆