本文介绍了不能在Mac OS X c ++应用程序上去除所有不需要的符号吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试删除所有不需要的符号的macos x应用程序.如果我在Linux应用程序上使用"--strip-unneeded"来执行此操作,则应用程序上的符号表为空,不返回任何内容.

I'm trying to strip my mac os x application of all unneeded symbols. If I do this on my linux app using "--strip-unneeded" the symbol table on my application is empty and returns nothing.

在Mac OS X上,我看到与类的typeinfo和vtable条目相关的符号以及某些功能.据我所知,这是在标头中定义并标记为内联的函数上发生的.nm输出中存在来自外部库的未定义函数,但标记为"U".

On Mac OS X, I am seeing symbols related to the typeinfo and vtable entries for my classes, as well as some function. As best as I can tell, this is happening on the functions defined in headers and marked inline. Undefined functions coming from external libraries are present in the nm output, but marked with "U".

strip -u -r myapp似乎并没有将它们删除.

strip -u -r myappdoes not seem to remove them.

尝试将它们放入删除文件中并执行以下操作:条-u -r -R remove_file.txt myapp

Trying to put them in a remove file and doing:strip -u -r -R remove_file.txt myapp

也不起作用.这是一个整体二进制文件,其唯一的共享库依赖项取决于corefoundation和veclib框架.

doesn't work either. This is a monolithic binary whose only shared library dependencies are on corefoundation and the veclib frameworks.

有什么建议吗?

推荐答案

没有确定的解决方案(我仍在学习C ++(和Objective C ++)并亲自学习处理这些问题)您可以查看:

Don't have a definite solution (I'm still in the process of learning C++ (and Objective C++) and learning to deal with this stuff myself) but you could look over:

内联函数的可见性

技术说明TN2185:Mac OS X的C ++技巧和窍门

隐藏的内联方法"的当前设置是什么?(在组和文件"列中双击目标,切换到构建"选项卡,向下滚动到代码生成",或者使用以下设置:

What's the current setting for "Inline Methods Hidden"? (Double-click on the target in the Groups & Files column, switch to Build tab, scroll down to Code Generation, or it's this setting:

[GCC_INLINES_ARE_PRIVATE_EXTERN,-fvisibility-inlines-hidden]启用后,将内联方法的脱机副本声明为'private extern'".)

[GCC_INLINES_ARE_PRIVATE_EXTERN, -fvisibility-inlines-hidden] "When enabled, out-of-line copies of inline methods are declared 'private extern'". )

这篇关于不能在Mac OS X c ++应用程序上去除所有不需要的符号吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 16:04