From 6cc8d47a1ff82224b35282197fa3194de213eb18 Mon Sep 17 00:00:00 2001 From: Dimitry Ivanov Date: Thu, 28 Jul 2016 13:52:17 -0700 Subject: [PATCH] Add symbol versions to libstdc++.so Bug: http://b/28987948 Change-Id: I3853528bd432ceab37e4867f2c4112d9ee0b40dc --- libc/Android.bp | 16 +++++++++++++++- libc/libstdc++.arm.map | 19 +++++++++++++++++++ libc/libstdc++.arm64.map | 19 +++++++++++++++++++ libc/libstdc++.map.txt | 22 ++++++++++++++++++++++ libc/libstdc++.mips.map | 19 +++++++++++++++++++ libc/libstdc++.mips64.map | 19 +++++++++++++++++++ libc/libstdc++.x86.map | 19 +++++++++++++++++++ libc/libstdc++.x86_64.map | 19 +++++++++++++++++++ libc/tools/genversion-scripts.py | 3 ++- 9 files changed, 153 insertions(+), 2 deletions(-) create mode 100644 libc/libstdc++.arm.map create mode 100644 libc/libstdc++.arm64.map create mode 100644 libc/libstdc++.map.txt create mode 100644 libc/libstdc++.mips.map create mode 100644 libc/libstdc++.mips64.map create mode 100644 libc/libstdc++.x86.map create mode 100644 libc/libstdc++.x86_64.map diff --git a/libc/Android.bp b/libc/Android.bp index b1d37b448..36dfbc837 100644 --- a/libc/Android.bp +++ b/libc/Android.bp @@ -1769,13 +1769,27 @@ cc_library { static_libs: ["libc_logging"], }, - //TODO: This is to work around b/24465209. Remove after root cause is fixed + //TODO (dimitry): This is to work around b/24465209. Remove after root cause is fixed arch: { arm: { ldflags: ["-Wl,--hash-style=both"], + version_script: "libstdc++.arm.map", + }, + arm64: { + version_script: "libstdc++.arm64.map", + }, + mips: { + version_script: "libstdc++.mips.map", + }, + mips64: { + version_script: "libstdc++.mips64.map", }, x86: { ldflags: ["-Wl,--hash-style=both"], + version_script: "libstdc++.x86.map", + }, + x86_64: { + version_script: "libstdc++.x86_64.map", }, }, } diff --git a/libc/libstdc++.arm.map b/libc/libstdc++.arm.map new file mode 100644 index 000000000..70df4e1e2 --- /dev/null +++ b/libc/libstdc++.arm.map @@ -0,0 +1,19 @@ +# Generated by genversion-scripts.py. Do not edit. +LIBC { + global: + _ZdaPv; + _ZdaPvRKSt9nothrow_t; + _ZdlPv; + _ZdlPvRKSt9nothrow_t; + _Znaj; # arm x86 mips + _ZnajRKSt9nothrow_t; # arm x86 mips + _Znwj; # arm x86 mips + _ZnwjRKSt9nothrow_t; # arm x86 mips + _ZSt7nothrow; + __cxa_guard_abort; + __cxa_guard_acquire; + __cxa_guard_release; + __cxa_pure_virtual; + local: + *; +}; diff --git a/libc/libstdc++.arm64.map b/libc/libstdc++.arm64.map new file mode 100644 index 000000000..55be046ca --- /dev/null +++ b/libc/libstdc++.arm64.map @@ -0,0 +1,19 @@ +# Generated by genversion-scripts.py. Do not edit. +LIBC { + global: + _ZdaPv; + _ZdaPvRKSt9nothrow_t; + _ZdlPv; + _ZdlPvRKSt9nothrow_t; + _Znam; # arm64 x86_64 mips64 + _ZnamRKSt9nothrow_t; # arm64 x86_64 mips64 + _Znwm; # arm64 x86_64 mips64 + _ZnwmRKSt9nothrow_t; # arm64 x86_64 mips64 + _ZSt7nothrow; + __cxa_guard_abort; + __cxa_guard_acquire; + __cxa_guard_release; + __cxa_pure_virtual; + local: + *; +}; diff --git a/libc/libstdc++.map.txt b/libc/libstdc++.map.txt new file mode 100644 index 000000000..d11d4c0cf --- /dev/null +++ b/libc/libstdc++.map.txt @@ -0,0 +1,22 @@ +LIBC { + global: + _ZdaPv; + _ZdaPvRKSt9nothrow_t; + _ZdlPv; + _ZdlPvRKSt9nothrow_t; + _Znam; # arm64 x86_64 mips64 + _ZnamRKSt9nothrow_t; # arm64 x86_64 mips64 + _Znwm; # arm64 x86_64 mips64 + _ZnwmRKSt9nothrow_t; # arm64 x86_64 mips64 + _Znaj; # arm x86 mips + _ZnajRKSt9nothrow_t; # arm x86 mips + _Znwj; # arm x86 mips + _ZnwjRKSt9nothrow_t; # arm x86 mips + _ZSt7nothrow; + __cxa_guard_abort; + __cxa_guard_acquire; + __cxa_guard_release; + __cxa_pure_virtual; + local: + *; +}; diff --git a/libc/libstdc++.mips.map b/libc/libstdc++.mips.map new file mode 100644 index 000000000..70df4e1e2 --- /dev/null +++ b/libc/libstdc++.mips.map @@ -0,0 +1,19 @@ +# Generated by genversion-scripts.py. Do not edit. +LIBC { + global: + _ZdaPv; + _ZdaPvRKSt9nothrow_t; + _ZdlPv; + _ZdlPvRKSt9nothrow_t; + _Znaj; # arm x86 mips + _ZnajRKSt9nothrow_t; # arm x86 mips + _Znwj; # arm x86 mips + _ZnwjRKSt9nothrow_t; # arm x86 mips + _ZSt7nothrow; + __cxa_guard_abort; + __cxa_guard_acquire; + __cxa_guard_release; + __cxa_pure_virtual; + local: + *; +}; diff --git a/libc/libstdc++.mips64.map b/libc/libstdc++.mips64.map new file mode 100644 index 000000000..55be046ca --- /dev/null +++ b/libc/libstdc++.mips64.map @@ -0,0 +1,19 @@ +# Generated by genversion-scripts.py. Do not edit. +LIBC { + global: + _ZdaPv; + _ZdaPvRKSt9nothrow_t; + _ZdlPv; + _ZdlPvRKSt9nothrow_t; + _Znam; # arm64 x86_64 mips64 + _ZnamRKSt9nothrow_t; # arm64 x86_64 mips64 + _Znwm; # arm64 x86_64 mips64 + _ZnwmRKSt9nothrow_t; # arm64 x86_64 mips64 + _ZSt7nothrow; + __cxa_guard_abort; + __cxa_guard_acquire; + __cxa_guard_release; + __cxa_pure_virtual; + local: + *; +}; diff --git a/libc/libstdc++.x86.map b/libc/libstdc++.x86.map new file mode 100644 index 000000000..70df4e1e2 --- /dev/null +++ b/libc/libstdc++.x86.map @@ -0,0 +1,19 @@ +# Generated by genversion-scripts.py. Do not edit. +LIBC { + global: + _ZdaPv; + _ZdaPvRKSt9nothrow_t; + _ZdlPv; + _ZdlPvRKSt9nothrow_t; + _Znaj; # arm x86 mips + _ZnajRKSt9nothrow_t; # arm x86 mips + _Znwj; # arm x86 mips + _ZnwjRKSt9nothrow_t; # arm x86 mips + _ZSt7nothrow; + __cxa_guard_abort; + __cxa_guard_acquire; + __cxa_guard_release; + __cxa_pure_virtual; + local: + *; +}; diff --git a/libc/libstdc++.x86_64.map b/libc/libstdc++.x86_64.map new file mode 100644 index 000000000..55be046ca --- /dev/null +++ b/libc/libstdc++.x86_64.map @@ -0,0 +1,19 @@ +# Generated by genversion-scripts.py. Do not edit. +LIBC { + global: + _ZdaPv; + _ZdaPvRKSt9nothrow_t; + _ZdlPv; + _ZdlPvRKSt9nothrow_t; + _Znam; # arm64 x86_64 mips64 + _ZnamRKSt9nothrow_t; # arm64 x86_64 mips64 + _Znwm; # arm64 x86_64 mips64 + _ZnwmRKSt9nothrow_t; # arm64 x86_64 mips64 + _ZSt7nothrow; + __cxa_guard_abort; + __cxa_guard_acquire; + __cxa_guard_release; + __cxa_pure_virtual; + local: + *; +}; diff --git a/libc/tools/genversion-scripts.py b/libc/tools/genversion-scripts.py index 4f117f669..e6c8053f5 100755 --- a/libc/tools/genversion-scripts.py +++ b/libc/tools/genversion-scripts.py @@ -17,6 +17,7 @@ bionic_libdl_root = os.path.join(os.environ["ANDROID_BUILD_TOP"], "bionic/libdl" libc_script = os.path.join(bionic_libc_root, "libc.map.txt") libm_script = os.path.join(bionic_libm_root, "libm.map.txt") libdl_script = os.path.join(bionic_libdl_root, "libdl.map.txt") +libstdcxx_script = os.path.join(bionic_libc_root, "libstdc++.map.txt") script_name = os.path.basename(sys.argv[0]) @@ -35,7 +36,7 @@ warning = "Generated by %s. Do not edit." % script_name class VersionScriptGenerator(object): def run(self): - for script in [libc_script, libm_script, libdl_script]: + for script in [libc_script, libstdcxx_script, libm_script, libdl_script]: basename = os.path.basename(script) dirname = os.path.dirname(script) for arch in all_arches: