开发者

Finding static initializers and destructors in C++

I have a program with way too many static initializers and destructors. I want to get rid of a开发者_如何学Pythonll of them. So i need a way to find them.

Running nm on the executable gives something like this: 0004bfc0 t _Z41_static_initialization_and_destruction_0ii

Is there a good way to get a list of files from where static_initializers are being included?


you could run nm on an object file which is later linked into the final executable. or create a script to parse nm's output for you if you've a lot to go through.

depending on the definitions of the data, you may also find you have duplicates which could be reduced to one object.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜