From patchwork Sat Jul 28 14:27:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 950498 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-94902-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="nWOlkD+h"; 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 41d7VN012bz9rxx for ; Sun, 29 Jul 2018 00:28:27 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=tIWOOfXEcSSKRQkmI+uf9XOiyQR3Eq+ xiiT3otGWY2f3/y8kpAbv6zsSOnGwCTOGcbiL7/uJLf2ZvKT5eIuUlSOlixnukdE /6LkJOgpXHfF+CLqxQruiQWRZfE5HH3CwZ20sT0gG5/EW/8cq9c0hcAFJJdPHyUD N7hO6rDLv798= 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:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=STNmkk1t7z1OF/KlhuNPxRT5ZAM=; b=nWOlk D+hIHQBpeGDLpRJf6klnUHqkA71HRrewU0A1ZFjMJkV825DpUarcSdKd26hysTr4 SBWGG+jDgQMXIM+gceqPhe8S/nj2YvKpY1sPYlBdr0m0tqg4a7s7/bvevUFrVX+Y GHEUpt5xMWgnvUU1DJdN3fYz3qqWmqQn1RIHUc= Received: (qmail 65160 invoked by alias); 28 Jul 2018 14:28:08 -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 65019 invoked by uid 89); 28 Jul 2018 14:28:07 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NEUTRAL autolearn=ham version=3.3.2 spammy= X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault Subject: [PATCH 2/2] hurd: Fix some ld.so symbol override from libc Date: Sat, 28 Jul 2018 16:27:58 +0200 Message-Id: <20180728142758.32338-3-samuel.thibault@ens-lyon.org> In-Reply-To: <20180728142758.32338-1-samuel.thibault@ens-lyon.org> References: <20180728142758.32338-1-samuel.thibault@ens-lyon.org> ld.so symbols to be overriden by libc need to be extern to really get overriden. * include/unistd.h (__getcwd): Set libc_hidden_proto instead of attribute_hidden. * io/getcwd.c (__getcwd): Set libc_hidden_def. * sysdeps/mach/hurd/getcwd.c (__getcwd): Likewise. * sysdeps/posix/getcwd.c (__getcwd): Likewise. * sysdeps/unix/sysv/linux/getcwd.c (__getcwd): Likewise. * sysdeps/mach/hurd/i386/libc.abilist: Update accordingly. * sysdeps/mach/hurd/i386/ld.abilist: Update accordingly. * sysdeps/mach/hurd/i386/localplt.data: Update accordingly. --- ChangeLog | 8 ++++++-- include/unistd.h | 3 ++- io/getcwd.c | 1 + sysdeps/mach/hurd/getcwd.c | 1 + sysdeps/mach/hurd/i386/ld.abilist | 1 + sysdeps/mach/hurd/i386/libc.abilist | 1 + sysdeps/mach/hurd/i386/localplt.data | 2 +- sysdeps/posix/getcwd.c | 1 + sysdeps/unix/sysv/linux/getcwd.c | 1 + 9 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index dfe30c416c..1e3e319501 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,11 +3,15 @@ * sysdeps/mach/hurd/dl-unistd.h (__access, __brk, __lseek, __read, __sbrk): Do not set attribute_hidden. * sysdeps/mach/hurd/not-errno.h: New file. - * include/unistd.h (__access): Set libc_hidden_proto instead of - attribute_hidden. + * include/unistd.h (__access, __getcwd): Set libc_hidden_proto instead + of attribute_hidden. * io/access.c (__access): Set libc_hidden_def. + * io/getcwd.c (__getcwd): Set libc_hidden_def. * sysdeps/mach/hurd/access.c (__access): Likewise. + * sysdeps/mach/hurd/getcwd.c (__getcwd): Likewise. + * sysdeps/posix/getcwd.c (__getcwd): Likewise. * sysdeps/unix/sysv/linux/access.c (__access): Likewise. + * sysdeps/unix/sysv/linux/getcwd.c (__getcwd): Likewise. * sysdeps/mach/hurd/i386/libc.abilist: Update accordingly. * sysdeps/mach/hurd/i386/ld.abilist: Update accordingly. * sysdeps/mach/hurd/i386/localplt.data: Update accordingly. diff --git a/include/unistd.h b/include/unistd.h index f1bdabebb2..42426a17b2 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -74,7 +74,8 @@ extern int __lchown (const char *__file, __uid_t __owner, __gid_t __group); extern int __chdir (const char *__path) attribute_hidden; extern int __fchdir (int __fd) attribute_hidden; -extern char *__getcwd (char *__buf, size_t __size) attribute_hidden; +extern char *__getcwd (char *__buf, size_t __size); +libc_hidden_proto (__getcwd) extern int __rmdir (const char *__path) attribute_hidden; extern int __execvpe (const char *file, char *const argv[], char *const envp[]) attribute_hidden; diff --git a/io/getcwd.c b/io/getcwd.c index e6b8b6e6e5..4e5572059c 100644 --- a/io/getcwd.c +++ b/io/getcwd.c @@ -32,6 +32,7 @@ __getcwd (char *buf, size_t size) __set_errno (ENOSYS); return NULL; } +libc_hidden_def (__getcwd) weak_alias (__getcwd, getcwd) stub_warning (__getcwd) diff --git a/sysdeps/mach/hurd/getcwd.c b/sysdeps/mach/hurd/getcwd.c index c30b7c507b..9a1b7efaf4 100644 --- a/sysdeps/mach/hurd/getcwd.c +++ b/sysdeps/mach/hurd/getcwd.c @@ -318,4 +318,5 @@ __getcwd (char *buf, size_t size) } return cwd; } +libc_hidden_def (__getcwd) weak_alias (__getcwd, getcwd) diff --git a/sysdeps/mach/hurd/i386/ld.abilist b/sysdeps/mach/hurd/i386/ld.abilist index 8b7be44dde..f5d8eebe6b 100644 --- a/sysdeps/mach/hurd/i386/ld.abilist +++ b/sysdeps/mach/hurd/i386/ld.abilist @@ -2,6 +2,7 @@ GLIBC_2.2.6 __access F GLIBC_2.2.6 __close F GLIBC_2.2.6 __errno_location F GLIBC_2.2.6 __fxstat64 F +GLIBC_2.2.6 __getcwd F GLIBC_2.2.6 __getpid F GLIBC_2.2.6 __libc_stack_end D 0x4 GLIBC_2.2.6 __mmap F diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 6e26654d85..9f5bb2734f 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -269,6 +269,7 @@ GLIBC_2.2.6 __fwritable F GLIBC_2.2.6 __fwriting F GLIBC_2.2.6 __fxstat F GLIBC_2.2.6 __fxstat64 F +GLIBC_2.2.6 __getcwd F GLIBC_2.2.6 __getdelim F GLIBC_2.2.6 __getpagesize F GLIBC_2.2.6 __getpgid F diff --git a/sysdeps/mach/hurd/i386/localplt.data b/sysdeps/mach/hurd/i386/localplt.data index 1c54993ac7..c1725d140f 100644 --- a/sysdeps/mach/hurd/i386/localplt.data +++ b/sysdeps/mach/hurd/i386/localplt.data @@ -35,7 +35,7 @@ ld.so: __xstat64 ld.so: __access ld.so: __access_noerrno ld.so: __getpid -#ld.so: __getcwd +ld.so: __getcwd ld.so: __sbrk ld.so: __strtoul_internal #ld.so: _exit diff --git a/sysdeps/posix/getcwd.c b/sysdeps/posix/getcwd.c index b53433a2dc..16da60efb8 100644 --- a/sysdeps/posix/getcwd.c +++ b/sysdeps/posix/getcwd.c @@ -531,5 +531,6 @@ __getcwd (char *buf, size_t size) } #if defined _LIBC && !defined __getcwd +libc_hidden_def (__getcwd) weak_alias (__getcwd, getcwd) #endif diff --git a/sysdeps/unix/sysv/linux/getcwd.c b/sysdeps/unix/sysv/linux/getcwd.c index 866b9d26d5..c642c70a32 100644 --- a/sysdeps/unix/sysv/linux/getcwd.c +++ b/sysdeps/unix/sysv/linux/getcwd.c @@ -127,6 +127,7 @@ __getcwd (char *buf, size_t size) return NULL; } +libc_hidden_def (__getcwd) weak_alias (__getcwd, getcwd) /* Get the code for the generic version. */