2

In https://opensource.apple.com/source/cctools/cctools-836/RelNotes/CompilerTools.html

The static linker has an option to do dead code stripping The static link editor now can do dead code stripping. The new ld(1) option to do this is -dead_strip. There is also an additional option -no_dead_strip_inits_and_terms that can be used when -dead_strip is specified to cause all constructors and destructors to never be dead code stripped. The load map printed with the ld(1) option -M notes what was dead stripped from the input files.

However, due to dynamic runtime property of Objective-C, dead_strip does not work well on Objective-C. So in my understanding, it does not work on the level of functions. Can it work on the level of classes, i.e. if one class is not used, can it be removed effectively?

userhua
  • 21
  • 1

0 Answers0