From patchwork Wed Dec 4 14:32:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Adhemerval Zanella (Code Review)" X-Patchwork-Id: 1204207 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-107717-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gnutoolchain-gerrit.osci.io Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="yvBAUwhM"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47ShBx4jy1z9sR1 for ; Thu, 5 Dec 2019 01:32:25 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; q=dns; s=default; b=FOLosiN7SyZkJN1mcTvO0SN5PFBqmgu 3pg5S5euiwT04j+huJWtAwzO0Shw/UbhJIm+zYe6Pt3pFnmeQCYdJK7mO+3piubR 1nNixYWTP5+0m+7HSVYIktJZbghYLt05fS5rccTF54Eho/gk2GuzpxAPwJflvDuN BtsAIILuU/64= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; s=default; bh=bIipk9kLCeZIEU1LhVqzM8DDleQ=; b=yvBAU whMJXFO4O/MlyOXjg8i+l3v20sIDUvD9FATqfdmWxWRT5UB28HSoW2QvQn69cuYT g+zBHIv3LTPnNk//yB8+zZuDNIBzZOYwG6asZP4tWwCFG5sSVy9G7x8YkUsD44WV ghvrLrXAe6t0NNZ2KfmBxaxrj6Yhe2RkOkV+Ro= Received: (qmail 28778 invoked by alias); 4 Dec 2019 14:32:19 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 28766 invoked by uid 89); 4 Dec 2019 14:32:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT autolearn=ham version=3.3.1 spammy= X-HELO: mx1.osci.io X-Gerrit-PatchSet: 2 Date: Wed, 4 Dec 2019 09:32:05 -0500 From: "Adhemerval Zanella (Code Review)" To: Carlos O'Donell , libc-alpha@sourceware.org Auto-Submitted: auto-generated X-Gerrit-MessageType: newpatchset Subject: [review v2] nptl: Add more missing placeholder abi symbol from nanosleep move X-Gerrit-Change-Id: I347a4dbdc931bb42b359456932dd1e17aa4d4078 X-Gerrit-Change-Number: 524 X-Gerrit-ChangeURL: X-Gerrit-Commit: ddbb7b3152e49bc7160a65b2f6a46a4c99bdb838 In-Reply-To: References: Reply-To: adhemerval.zanella@linaro.org, libc-alpha@sourceware.org, carlos@redhat.com MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Message-Id: <20191204143211.40F892816F@gnutoolchain-gerrit.osci.io> Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/524 ...................................................................... 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 unrequired __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 nanosleep move. Change-Id: I347a4dbdc931bb42b359456932dd1e17aa4d4078 --- M include/shlib-compat.h M nptl/libpthread-compat.c M sysdeps/unix/sysv/linux/alpha/libpthread.abilist M sysdeps/unix/sysv/linux/hppa/libpthread.abilist M sysdeps/unix/sysv/linux/i386/libpthread.abilist M sysdeps/unix/sysv/linux/ia64/libpthread.abilist M sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist M sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist M sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist M sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist M sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist M sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist M sysdeps/unix/sysv/linux/sh/be/libpthread.abilist M sysdeps/unix/sysv/linux/sh/le/libpthread.abilist M sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist M sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist M sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist 17 files changed, 60 insertions(+), 17 deletions(-) diff --git a/include/shlib-compat.h b/include/shlib-compat.h index f1c2fd8..3e529d0 100644 --- a/include/shlib-compat.h +++ b/include/shlib-compat.h @@ -64,6 +64,32 @@ # 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 incur in 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 an unique strong alias to the input symbol and + issue compat_symbol on the alias. */ +# 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 (libm, 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. */ @@ -75,6 +101,7 @@ /* This should not appear outside `#if SHLIB_COMPAT (...)'. */ # define compat_symbol(lib, local, symbol, version) ... +# define compat_symbol_unique(lib, name, version) ... #endif 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 diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist index f42bcff..da5e997 100644 --- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist @@ -192,6 +192,7 @@ 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 diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist index d87fadf..15b72c4 100644 --- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist @@ -18,7 +18,6 @@ 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 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 diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist index 5d1bf0f..68fd150 100644 --- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist @@ -192,6 +192,7 @@ 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 diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist index c065ddb..4c844da 100644 --- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist @@ -18,7 +18,6 @@ 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 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 diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist index 5d1bf0f..68fd150 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist @@ -192,6 +192,7 @@ 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 diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist index 1b5fd5e..aefbfa4 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist @@ -117,7 +117,6 @@ 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_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 diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist index 1b5fd5e..aefbfa4 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist @@ -117,7 +117,6 @@ 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_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 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist index 0245103..88d6d73 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist @@ -192,6 +192,7 @@ 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 diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist index 429d8b6..bfa1d5e 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist @@ -194,6 +194,7 @@ 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 diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist index d42e1fc..8cf9afe 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist @@ -20,7 +20,6 @@ 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 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 diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist index d87fadf..15b72c4 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist @@ -18,7 +18,6 @@ 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 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 diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist index d87fadf..15b72c4 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist @@ -18,7 +18,6 @@ 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 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 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist index f42bcff..da5e997 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist @@ -192,6 +192,7 @@ 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 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist index c065ddb..4c844da 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist @@ -18,7 +18,6 @@ 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 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 diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist index 610562b..a46fcc6 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist @@ -18,7 +18,6 @@ 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 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