Let me paraphrasemy question.
When people use 'nm' command on certain library, call it library.a.
And let's say library.a is referencing library.b, and I want to expose only a few methods and classes from library.b.
I will be following these steps
- Eliminate any internal symbols required between modules by performing a single-object prelink. Set the Xcode build setting named "Perform Single-Object Prelink" to Yes (GENERATE_MASTER_OBJECT_FILE=YES). This causes ld to be run with the "-r" flag.
- Make sure that the setting "Strip Style" is set to "Non-global symbols" (STRIP_STYLE=non-global), this passes "-x" to ld.
- Stripping is only actually performed on static libraries if post-processing is enabled (and this is not the default). Set Xcode build setting "Deployment Postprocessing" to yes. (DEPLOYMENT_POSTPROCESSING=YES). Also make sure that "Use separate strip" is set to Yes (not always the default) (SEPARATE_STRIP=YES).
- If, in addition to local symbols, if you need to remove some of the global symbols you can supply additional options to the strip command, under the Xcode build setting "Additional strip flags". E.g. I commonly use the strip "-R somefile" option to provide a file with an additional list of symbols which I want removed from the global symbol table.
provided in http://stackoverflow.com/questions/3276474/symbol-hiding-in-static-libraries-built-with-xcode-gcc
However, I don't want to change xCode build configuration instead I want to achieve symbol hiding from the source level.
Where developer can actually control his/her source's methods and classes(let's say these are from library.b) visibility.
So when other people use 'nm' command on his library.a, they can't access the classes and methods that are hidden by the developer.
Thank you.