Question

In a static library project for iOS 6, some functions in a .c file is referenced by others, and therefore are considered global symbols, but should not be exposed to the user of this library.

How can I strip these function names out? Also, how can I hide those obj file names as well so that nobody could see the .o names in nm output?

I have tried to enable/set:

  • Deployment Postprocessing
  • Strip Debug Symbols During Copy
  • Strip Linked Product
  • Strip Stype: either 'Non-Global Symbols' or 'Debugging symbols'
  • Use Separate Strip

EDIT:

I see that there is another Build Setting item 'Additional Strip Flags'. By adding in it a flag -R /path/to/symbol_list_file, strip command would remove symbols indicated in the file, or -s /path/to/exported_symbol_list_file -u to indicate interfaces and leaving undefined symbols at the same time.

Was it helpful?

Solution

No, you can't. A static library is simply a collection of object files and the object files within the static library have no special privileges over those using the static library.

You can obviously strip the final binary.

If you must hide symbols then they need to be static, which forces you to use fewer implementations files to allow the symbol to be shared, which is inconvenient.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top