cctools' strip has the option "-T" which removes the symbols whose names begin with _$S' or _$s' only if it finds an __objc_image_info section containing a non-zero swift version (and the binary is either an executable or a dynamic library).
This diff implements this option in llvm-strip for MachO.
Test plan: make check-all
Can you also add a test for Swift symbols *not* being stripped when a Swift version isn't present? It would also be great to test _$S symbols in addition to _$s ones.