开发者

Can't strip all unneeded symbols on a Mac OS X c++ application?

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.

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 does not seem to remove them.

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

doesn't work either. This is a monolithic binary whose only shared library dependencies are on corefoundation and the veclib开发者_Go百科 frameworks.

Any suggestions please?


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:

Visibility of Inline Functions

and

Technical Note TN2185: C++ Tips and Tricks for Mac OS X

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] "When enabled, out-of-line copies of inline methods are declared 'private extern'". )

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜