]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
posix: Fix internal p{read,write} plt usage
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 26 Apr 2017 21:34:47 +0000 (18:34 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 2 May 2017 17:57:40 +0000 (14:57 -0300)
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
include/unistd.h
sysdeps/unix/sysv/linux/microblaze/localplt.data
sysdeps/unix/sysv/linux/pread.c
sysdeps/unix/sysv/linux/pread64.c
sysdeps/unix/sysv/linux/pwrite.c

index fb1ffc9ed7e1cd9122ecbf40ac1be2ecd61e66e3..29a6592373d092d462a318011d2e3a7e0fb3afd5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2017-05-02  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+       * 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.
+
 2017-05-02  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
 
        * sysdeps/powerpc/fpu/libm-test-ulps: Update.
index 16a88153a0821ac109401e221d01ff314d2e567f..f36759b24d7ad9dc421322f06d0b3f20571471c3 100644 (file)
@@ -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,
index 418783229b844e34dc4fe8805bd221a0b1f25e5f..a61b94dfb8ca70fd981ec5f02e7d50c1eefd2d17 100644 (file)
@@ -1,5 +1,4 @@
 libc.so: __errno_location
-libc.so: __pread64
 libc.so: calloc
 libc.so: free
 libc.so: malloc
index b4f1b87d646cf2e0a889f174108e71fc8277e6b9..96df99747a3adf4ca455d170614e109f2d49cea9 100644 (file)
@@ -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
index c7f9cb16ad5bb13a5a4d0a8c5e51f3e08f48a363..0c2c80e9e2f00f3038c2925a975812efa3d0bddd 100644 (file)
@@ -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
index ef1bb01170e46b5a77d252a39b14a979b97133cc..ef11d8f8a194635a1ccb75bb1caadd5d8e335f78 100644 (file)
@@ -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