]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nptl: Add more missing placeholder abi symbol from nanosleep move
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 3 Dec 2019 20:32:49 +0000 (20:32 +0000)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 9 Dec 2019 18:04:56 +0000 (15:04 -0300)
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

17 files changed:
include/shlib-compat.h
nptl/libpthread-compat.c
sysdeps/unix/sysv/linux/alpha/libpthread.abilist
sysdeps/unix/sysv/linux/hppa/libpthread.abilist
sysdeps/unix/sysv/linux/i386/libpthread.abilist
sysdeps/unix/sysv/linux/ia64/libpthread.abilist
sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist

index f1c2fd8ed99b601aedc590b490bb9f50c473106c..fafb5268a6a42eb6d2522910241c9ccc903a05ca 100644 (file)
 # define compat_symbol(lib, local, symbol, version) \
   compat_symbol_reference (lib, local, symbol, version)
 
+/* This is similar to compat_symbol, but allows versioning the same symbol
+   to multiple version without having multiple symbol definitions.  For
+   instance:
+
+   #if (SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_2))
+   compat_symbol_unique (libc, old_foo, GLIBC_2_1_2)
+   #endif
+
+   #if (SHLIB_COMPAT (libpthread, GLIBC_2_2_6, GLIBC_2_3))
+   compat_symbol_unique (libc, old_foo, GLIBC_2_2_6)
+   #endif
+
+   Internally it creates a unique strong alias to the input symbol and
+   creates one compat_symbol on the alias.  Using the above example,
+   it is similar to:
+
+   #if (SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_2))
+   strong_alias (old_foo, old_foo__COUNTER__)
+   compat_symbol (libc, old_foo__COUNTER__, foo, GLIBC_2_2)
+   #endif.
+
+   With __COUNTER__ being a monotonic number generated by the compiler.  */
+
+# define __compat_symbol_unique_concat(x, y) x ## y
+# define _compat_symbol_unique_concat(x, y) \
+  __compat_symbol_unique_concat (x, y)
+# define _compat_symbol_unique_alias(name) \
+  _compat_symbol_unique_concat (name, __COUNTER__)
+# define _compat_symbol_unique(lib, orig_name, name, version) \
+  strong_alias (orig_name, name) \
+  compat_symbol (lib, name, orig_name, version)
+# define compat_symbol_unique(lib, name, version) \
+  _compat_symbol_unique (lib, name, _compat_symbol_unique_alias (name), \
+                         version)
+
 #else
 
 /* Not compiling ELF shared libraries at all, so never any old versions.  */
 
 /* This should not appear outside `#if SHLIB_COMPAT (...)'.  */
 # define compat_symbol(lib, local, symbol, version) ...
+# define compat_symbol_unique(lib, name, version) ...
 
 #endif
 
index 7398f5e92da01ee374bb2575b4736e378cd1f103..e2db3f2a42785f4b8c788dc4ff6c9963718c9494 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#include <sys/cdefs.h>
 #include <shlib-compat.h>
 
+#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,
    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
index f42bcffd1e48b3a0058e158eab66f990cb4cbd54..da5e9979a8b5cf3f160787c20d76bba2eeb215d5 100644 (file)
@@ -192,6 +192,7 @@ GLIBC_2.2 pwrite F
 GLIBC_2.2 pwrite64 F
 GLIBC_2.2 sem_timedwait F
 GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
 GLIBC_2.28 cnd_destroy F
index d87fadf3d8d901eb94bdea0612f12fc91ce3d4c4..15b72c42641f06da4d192f854fded0999602d85e 100644 (file)
@@ -18,7 +18,6 @@ GLIBC_2.2 __h_errno_location F
 GLIBC_2.2 __libc_allocate_rtsig F
 GLIBC_2.2 __libc_current_sigrtmax F
 GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __libpthread_version_placeholder F
 GLIBC_2.2 __lseek F
 GLIBC_2.2 __open F
 GLIBC_2.2 __open64 F
@@ -185,6 +184,7 @@ GLIBC_2.2 wait F
 GLIBC_2.2 waitpid F
 GLIBC_2.2 write F
 GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
 GLIBC_2.28 cnd_destroy F
index 5d1bf0f5ab71a9cae00a2232b88b3b8d2d66166e..68fd15047cf8efc333e1a091875af407a30a9d4f 100644 (file)
@@ -192,6 +192,7 @@ GLIBC_2.2 pwrite F
 GLIBC_2.2 pwrite64 F
 GLIBC_2.2 sem_timedwait F
 GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
 GLIBC_2.28 cnd_destroy F
index c065ddbf67bca69c4caa58b02bed542ab772ee30..4c844da957383278bea2e33cf78209c9db57798f 100644 (file)
@@ -18,7 +18,6 @@ GLIBC_2.2 __h_errno_location F
 GLIBC_2.2 __libc_allocate_rtsig F
 GLIBC_2.2 __libc_current_sigrtmax F
 GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __libpthread_version_placeholder F
 GLIBC_2.2 __lseek F
 GLIBC_2.2 __open F
 GLIBC_2.2 __open64 F
@@ -185,6 +184,7 @@ GLIBC_2.2 wait F
 GLIBC_2.2 waitpid F
 GLIBC_2.2 write F
 GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
 GLIBC_2.28 cnd_destroy F
index 5d1bf0f5ab71a9cae00a2232b88b3b8d2d66166e..68fd15047cf8efc333e1a091875af407a30a9d4f 100644 (file)
@@ -192,6 +192,7 @@ GLIBC_2.2 pwrite F
 GLIBC_2.2 pwrite64 F
 GLIBC_2.2 sem_timedwait F
 GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
 GLIBC_2.28 cnd_destroy F
index 1b5fd5e75161c7aee9b25a26fde050ee05000eeb..aefbfa44ae3b8029c64cedb9b2a715c17caaa4a5 100644 (file)
@@ -117,7 +117,6 @@ GLIBC_2.18 pthread_setattr_default_np F
 GLIBC_2.2 __libc_allocate_rtsig F
 GLIBC_2.2 __libc_current_sigrtmax F
 GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __libpthread_version_placeholder F
 GLIBC_2.2 __open64 F
 GLIBC_2.2 __pread64 F
 GLIBC_2.2 __pthread_rwlock_destroy F
@@ -192,6 +191,7 @@ GLIBC_2.2 sem_trywait F
 GLIBC_2.2 sem_unlink F
 GLIBC_2.2 sem_wait F
 GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
 GLIBC_2.28 cnd_destroy F
index 1b5fd5e75161c7aee9b25a26fde050ee05000eeb..aefbfa44ae3b8029c64cedb9b2a715c17caaa4a5 100644 (file)
@@ -117,7 +117,6 @@ GLIBC_2.18 pthread_setattr_default_np F
 GLIBC_2.2 __libc_allocate_rtsig F
 GLIBC_2.2 __libc_current_sigrtmax F
 GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __libpthread_version_placeholder F
 GLIBC_2.2 __open64 F
 GLIBC_2.2 __pread64 F
 GLIBC_2.2 __pthread_rwlock_destroy F
@@ -192,6 +191,7 @@ GLIBC_2.2 sem_trywait F
 GLIBC_2.2 sem_unlink F
 GLIBC_2.2 sem_wait F
 GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
 GLIBC_2.28 cnd_destroy F
index 0245103a0bac0554fcef0402297f3ccf6699e3b8..88d6d732a7836f1bb28f18fc536b712ed25d40c9 100644 (file)
@@ -192,6 +192,7 @@ GLIBC_2.2 pwrite F
 GLIBC_2.2 pwrite64 F
 GLIBC_2.2 sem_timedwait F
 GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
 GLIBC_2.28 cnd_destroy F
index 429d8b62248f3428a1958d499d038452048b2006..bfa1d5e8798fc8a0f7dff183c4e9326246b37e4a 100644 (file)
@@ -194,6 +194,7 @@ GLIBC_2.2 pwrite F
 GLIBC_2.2 pwrite64 F
 GLIBC_2.2 sem_timedwait F
 GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
 GLIBC_2.28 cnd_destroy F
index d42e1fc4b05e1edbbda935ff4f9b2acf52ddc3ac..8cf9afe5117cede46c200da48e524ecb09ece654 100644 (file)
@@ -20,7 +20,6 @@ GLIBC_2.2 __h_errno_location F
 GLIBC_2.2 __libc_allocate_rtsig F
 GLIBC_2.2 __libc_current_sigrtmax F
 GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __libpthread_version_placeholder F
 GLIBC_2.2 __lseek F
 GLIBC_2.2 __open F
 GLIBC_2.2 __open64 F
@@ -187,6 +186,7 @@ GLIBC_2.2 wait F
 GLIBC_2.2 waitpid F
 GLIBC_2.2 write F
 GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
 GLIBC_2.28 cnd_destroy F
index d87fadf3d8d901eb94bdea0612f12fc91ce3d4c4..15b72c42641f06da4d192f854fded0999602d85e 100644 (file)
@@ -18,7 +18,6 @@ GLIBC_2.2 __h_errno_location F
 GLIBC_2.2 __libc_allocate_rtsig F
 GLIBC_2.2 __libc_current_sigrtmax F
 GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __libpthread_version_placeholder F
 GLIBC_2.2 __lseek F
 GLIBC_2.2 __open F
 GLIBC_2.2 __open64 F
@@ -185,6 +184,7 @@ GLIBC_2.2 wait F
 GLIBC_2.2 waitpid F
 GLIBC_2.2 write F
 GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
 GLIBC_2.28 cnd_destroy F
index d87fadf3d8d901eb94bdea0612f12fc91ce3d4c4..15b72c42641f06da4d192f854fded0999602d85e 100644 (file)
@@ -18,7 +18,6 @@ GLIBC_2.2 __h_errno_location F
 GLIBC_2.2 __libc_allocate_rtsig F
 GLIBC_2.2 __libc_current_sigrtmax F
 GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __libpthread_version_placeholder F
 GLIBC_2.2 __lseek F
 GLIBC_2.2 __open F
 GLIBC_2.2 __open64 F
@@ -185,6 +184,7 @@ GLIBC_2.2 wait F
 GLIBC_2.2 waitpid F
 GLIBC_2.2 write F
 GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
 GLIBC_2.28 cnd_destroy F
index f42bcffd1e48b3a0058e158eab66f990cb4cbd54..da5e9979a8b5cf3f160787c20d76bba2eeb215d5 100644 (file)
@@ -192,6 +192,7 @@ GLIBC_2.2 pwrite F
 GLIBC_2.2 pwrite64 F
 GLIBC_2.2 sem_timedwait F
 GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
 GLIBC_2.28 cnd_destroy F
index c065ddbf67bca69c4caa58b02bed542ab772ee30..4c844da957383278bea2e33cf78209c9db57798f 100644 (file)
@@ -18,7 +18,6 @@ GLIBC_2.2 __h_errno_location F
 GLIBC_2.2 __libc_allocate_rtsig F
 GLIBC_2.2 __libc_current_sigrtmax F
 GLIBC_2.2 __libc_current_sigrtmin F
-GLIBC_2.2 __libpthread_version_placeholder F
 GLIBC_2.2 __lseek F
 GLIBC_2.2 __open F
 GLIBC_2.2 __open64 F
@@ -185,6 +184,7 @@ GLIBC_2.2 wait F
 GLIBC_2.2 waitpid F
 GLIBC_2.2 write F
 GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
 GLIBC_2.28 cnd_destroy F
index 610562bd402eebaf4cbffa063010d4308514a497..a46fcc6f6e8e1868fad7d5ed441876ef1b32c94f 100644 (file)
@@ -18,7 +18,6 @@ GLIBC_2.2.5 __h_errno_location F
 GLIBC_2.2.5 __libc_allocate_rtsig F
 GLIBC_2.2.5 __libc_current_sigrtmax F
 GLIBC_2.2.5 __libc_current_sigrtmin F
-GLIBC_2.2.5 __libpthread_version_placeholder F
 GLIBC_2.2.5 __lseek F
 GLIBC_2.2.5 __open F
 GLIBC_2.2.5 __open64 F
@@ -185,6 +184,7 @@ GLIBC_2.2.5 tcdrain F
 GLIBC_2.2.5 wait F
 GLIBC_2.2.5 waitpid F
 GLIBC_2.2.5 write F
+GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
 GLIBC_2.28 cnd_destroy F