From 0487ebed2278b20971af4cabf186fd3681adccf0 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Tue, 3 Dec 2019 20:32:49 +0000 Subject: nptl: Add more missing placeholder abi symbol from nanosleep move This patch adds the missing __libpthread_version_placeholder for GLIBC_2.2.6 version from the nanosleep implementation move from libpthread to libc (79a547b162). It also fixes the wrong compat symbol definitions added by changing back the version used on vfork check and remove the __libpthread_version_placeholder added on some ABI (4f4bb489e0dd). The __libpthread_version_placeholder is also refactored to make it simpler to add new compat_symbols by adding a new macro compat_symbol_unique which uses the compiler extension __COUNTER__ to generate unique strong alias to be used with compat_symbol. Checked with a updated-abi on the all affected abis of the nanosleep move. Change-Id: I347a4dbdc931bb42b359456932dd1e17aa4d4078 --- nptl/libpthread-compat.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'nptl') diff --git a/nptl/libpthread-compat.c b/nptl/libpthread-compat.c index 7398f5e..e2db3f2 100644 --- a/nptl/libpthread-compat.c +++ b/nptl/libpthread-compat.c @@ -16,8 +16,18 @@ License along with the GNU C Library; if not, see . */ +#include #include +#ifdef SHARED +static void +attribute_compat_text_section +__attribute_used__ +__libpthread_version_placeholder (void) +{ +} +#endif + /* This is an unused compatibility symbol definition, to prevent ld from creating a weak version definition for GLIBC_2.1.2. (__vfork used to be defined at that version, but it is now provided by libc, @@ -26,12 +36,12 @@ version or later, the placeholder symbol is not needed because there are plenty of other symbols which populate those later versions. */ -#if (SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_2_6)) -void -attribute_compat_text_section -__libpthread_version_placeholder (void) -{ -} -compat_symbol (libpthread, __libpthread_version_placeholder, - __libpthread_version_placeholder, GLIBC_2_1_2); +#if (SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_2)) +compat_symbol_unique (libpthread, + __libpthread_version_placeholder, GLIBC_2_1_2); +#endif + +#if (SHLIB_COMPAT (libpthread, GLIBC_2_2_6, GLIBC_2_3)) +compat_symbol_unique (libpthread, + __libpthread_version_placeholder, GLIBC_2_2_6); #endif -- cgit v1.1