简体   繁体   English

如何检查 DYLIB 内容的大小?

[英]How can I inspect DYLIB contents in terms of size?

After moving from a manually created Xcode project to a CMake-generated Xcode C++ project, my compiled binary DYLIB size has grown significantly: from about 35 MB to about 53 MB.从手动创建的 Xcode 项目转移到 CMake 生成的 Xcode C++ 项目后,我编译的二进制DYLIB大小显着增长:从大约 35 MB 到大约 53 MB。

All the compilation and linking settings I could compare in Xcode projects look pretty much the same (including vs. not including debug symbols, optimization levels, etc.).我可以在 Xcode 项目中比较的所有编译和链接设置看起来都差不多(包括与不包括调试符号、优化级别等)。 I wonder if there are any tools to inspect DYLIB contents - what occupies size in the first place.我想知道是否有任何工具可以检查 DYLIB 内容——首先是什么占据了大小。

I would personally go with nm tool.我个人会使用nm工具。 You can inspect any DYLIB file iteratively, section-by-section or just print everything:您可以逐节迭代地检查任何 DYLIB 文件,或者只打印所有内容:

nm -a /path/to/my/lib.dylib

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM