From patchwork Thu Apr 27 21:30:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 98296 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp299155qgf; Thu, 27 Apr 2017 14:31:28 -0700 (PDT) X-Received: by 10.99.97.75 with SMTP id v72mr8160882pgb.76.1493328688508; Thu, 27 Apr 2017 14:31:28 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id o23si3619674pgd.138.2017.04.27.14.31.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Apr 2017 14:31:28 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-78920-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-78920-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-78920-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=oJsFUOIswnCl3KgXCoYZFnUg8KmZsdz wqd+LCInmBrYwZftrMpZUg3NEsmaKLxpeLFKolGwROBlKIdTkb92qAd8jx7yFeGq +KYDv/G4nkq/ogpReP88rOlIwWvNP2iaokyVb2HS0fdIaSZt1cuFKj+6dsPOCua+ nqnrzVd4t3gg= 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:subject:date:message-id:in-reply-to :references; s=default; bh=ELuADAo4Mi3BhTK24FaDYCyVxtw=; b=XQcUM xq3SCDeXfeRTqPuzV+qFf1qkKVoV/76PyyMVH8LOTKzpM+77x/U+edQWhfpAsYaK z8Cq6vYUReF4CzwV43v6bzQVV9ZIq7FH1bLpA3fClGCYcj9/G0ErLC58GbyqDN4a BNwqv2UzArtnqUTiqG3FfYYo864lizrX7Oz0iI= Received: (qmail 11779 invoked by alias); 27 Apr 2017 21:31:07 -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 11709 invoked by uid 89); 27 Apr 2017 21:31:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=H*p:D*org X-HELO: mail-qt0-f173.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=3NO5L3fWCvyYC8qy7sWFXVZa9IQN1cDd37jauH3vxe4=; b=PNcExJvSnItJnlpzXXGM7XcXsl3sIOLAoSWjCMODBxUDd8a3nJz99gBgNdOHDExMmm rGS5MQrrQIy3j0AwVkAUR8c4J1M3NAkHFkPgvB74jDoPgITfbRlZNnNU0GGXKOq/uBU1 aq8niGV9zDUovdc2L+w8bFELZBIbAb0k8TLeNUXZmp6SNTR4Cv8jiL7tM9HYIdhE6Z/G hLQCMHJoMvKXyU47dK0sfjukcU/K8fHOSq0b+MDDbCsUWxJhi8hvyk16XftU8n1yrY+1 KBzyRenV8d4M+J+QwJocsXw88lkFFrQnxA8J793KbzyIuogO51EZuUftWCl+E67pt5l0 hamg== X-Gm-Message-State: AN3rC/78FqV8hUcN7asaiykLHd/2mkaJpsPBkp0RTC4BFtOyhxVQ4yut FtnNVDgemm4xxFpx5q7aGg== X-Received: by 10.200.4.44 with SMTP id v44mr7906754qtg.135.1493328665054; Thu, 27 Apr 2017 14:31:05 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 3/4] posix: Fix internal p{read,write} plt usage Date: Thu, 27 Apr 2017 18:30:56 -0300 Message-Id: <1493328657-8172-3-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1493328657-8172-1-git-send-email-adhemerval.zanella@linaro.org> References: <1493328657-8172-1-git-send-email-adhemerval.zanella@linaro.org> This patch adds internal alias for __pread, __pread64, and __pwrite following the already in place one for __pwrite64. This is not used in any implementation but on microblaze on preadv/pwritev fallback (since it does not define __ASSUME_PREADV). In fact it was signaled by commit c35db50ff5 which update the expected localptl.data for the architecture based on resulted value. This patch updates the plt for microblaze now that p{read,write}{64} are correctly routed to use internal alias. Checked on x86_64-linux-gnu and a build for all supported architectures (no all variants although). * include/unistd.h (__pread): Add libc_hidden_proto. (__pread64): Likewise. (__pwrite): Likewise. * sysdeps/unix/sysv/linux/microblaze/localplt.data [libc.so] (__pread64): Remove. * sysdeps/unix/sysv/linux/pread.c (__pread64): Add libc_hidden_weak. * sysdeps/unix/sysv/linux/pread64.c (__pread64): Likewise. * sysdeps/unix/sysv/linux/pwrite.c (__pwrite): Likewise. --- ChangeLog | 9 +++++++++ include/unistd.h | 3 +++ sysdeps/unix/sysv/linux/microblaze/localplt.data | 1 - sysdeps/unix/sysv/linux/pread.c | 1 + sysdeps/unix/sysv/linux/pread64.c | 1 + sysdeps/unix/sysv/linux/pwrite.c | 1 + 6 files changed, 15 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/include/unistd.h b/include/unistd.h index 16a8815..f36759b 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -33,14 +33,17 @@ extern __off_t __libc_lseek (int __fd, __off_t __offset, int __whence); extern __off64_t __libc_lseek64 (int __fd, __off64_t __offset, int __whence); extern ssize_t __pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset); +libc_hidden_proto (__pread); extern ssize_t __libc_pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset); extern ssize_t __pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset); +libc_hidden_proto (__pread64); extern ssize_t __libc_pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset); extern ssize_t __pwrite (int __fd, const void *__buf, size_t __n, __off_t __offset); +libc_hidden_proto (__pwrite) extern ssize_t __libc_pwrite (int __fd, const void *__buf, size_t __n, __off_t __offset); extern ssize_t __pwrite64 (int __fd, const void *__buf, size_t __n, diff --git a/sysdeps/unix/sysv/linux/microblaze/localplt.data b/sysdeps/unix/sysv/linux/microblaze/localplt.data index 4187832..a61b94d 100644 --- a/sysdeps/unix/sysv/linux/microblaze/localplt.data +++ b/sysdeps/unix/sysv/linux/microblaze/localplt.data @@ -1,5 +1,4 @@ libc.so: __errno_location -libc.so: __pread64 libc.so: calloc libc.so: free libc.so: malloc diff --git a/sysdeps/unix/sysv/linux/pread.c b/sysdeps/unix/sysv/linux/pread.c index b4f1b87..96df997 100644 --- a/sysdeps/unix/sysv/linux/pread.c +++ b/sysdeps/unix/sysv/linux/pread.c @@ -32,5 +32,6 @@ __libc_pread (int fd, void *buf, size_t count, off_t offset) } strong_alias (__libc_pread, __pread) +libc_hidden_weak (__pread) weak_alias (__libc_pread, pread) #endif diff --git a/sysdeps/unix/sysv/linux/pread64.c b/sysdeps/unix/sysv/linux/pread64.c index c7f9cb1..0c2c80e 100644 --- a/sysdeps/unix/sysv/linux/pread64.c +++ b/sysdeps/unix/sysv/linux/pread64.c @@ -30,6 +30,7 @@ __libc_pread64 (int fd, void *buf, size_t count, off64_t offset) } weak_alias (__libc_pread64, __pread64) +libc_hidden_weak (__pread64) weak_alias (__libc_pread64, pread64) #ifdef __OFF_T_MATCHES_OFF64_T diff --git a/sysdeps/unix/sysv/linux/pwrite.c b/sysdeps/unix/sysv/linux/pwrite.c index ef1bb01..ef11d8f 100644 --- a/sysdeps/unix/sysv/linux/pwrite.c +++ b/sysdeps/unix/sysv/linux/pwrite.c @@ -32,5 +32,6 @@ __libc_pwrite (int fd, const void *buf, size_t count, off_t offset) } strong_alias (__libc_pwrite, __pwrite) +libc_hidden_weak (__pwrite) weak_alias (__libc_pwrite, pwrite) #endif