Effort to reduce the number of exported symbols

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@122057 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/buildit b/lib/buildit
index db22942..e296f02 100755
--- a/lib/buildit
+++ b/lib/buildit
@@ -41,6 +41,7 @@
 			-compatibility_version 1 \
 			-install_name /usr/lib/libc++.dylib \
 			-Wl,-reexport_library,/usr/lib/libc++abi.dylib \
+			-Wl,-unexported_symbols_list,libc++unexp.exp  \
 			/usr/lib/libSystem.B.dylib"
 	else
 		LDSHARED_FLAGS="-o libc++.1.dylib \
@@ -49,6 +50,7 @@
 			-install_name /usr/lib/libc++.dylib \
 			${SDKROOT}/usr/lib/libc++abi.dylib \
 			-lSystem  \
+			-Wl,-unexported_symbols_list,libc++unexp.exp  \
 			-Wl,-reexported_symbols_list,libc++abi.exp \
 			-Wl,-force_symbols_not_weak_list,notweak.exp"
 	fi
diff --git a/lib/libc++unexp.exp b/lib/libc++unexp.exp
new file mode 100644
index 0000000..9507fc5
--- /dev/null
+++ b/lib/libc++unexp.exp
@@ -0,0 +1,19 @@
+# all guard variables
+__ZGVNSt3__*
+# all vtables
+# __ZTV*
+# all VTT
+# __ZTT*
+# all non-virtual thunks
+# __ZTh*
+# all virtual thunks
+# __ZTv*
+# typeinfo for std::__1::__types
+#    There are no std::__types
+# __ZTINSt3__1[0-9][0-9]*__*
+# typeinfo name for std::__1::__types
+__ZTSNSt3__1[0-9][0-9]*__*
+# anything using __hidden_allocator
+*__hidden_allocator*
+# anything using __sso_allocator
+*__sso_allocator*