about summary refs log tree commit diff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-10-01 15:53:52 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-10-01 15:54:10 -0700
commitd6daff12617290d4dfb499ed8425d33a48d844ba (patch)
tree8cc815db5ac1558ecd139ec7c9cece391865b48c
parentb68f8620561d7658b475eb512978d3c33d8a4547 (diff)
downloadglibc-d6daff12617290d4dfb499ed8425d33a48d844ba.tar.gz
glibc-d6daff12617290d4dfb499ed8425d33a48d844ba.tar.xz
glibc-d6daff12617290d4dfb499ed8425d33a48d844ba.zip
Hide __readv and __writev [BZ #18822]
Hide internal __readv and __writev functions to allow direct access
within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/sys/uio.h (__readv): Add libc_hidden_proto.
	(__writev): Likewise.
	* misc/readv.c (__readv): Add libc_hidden_def.
	* misc/writev.c (__writev): Likewise.
	* sysdeps/posix/readv.c (__readv): Likewise.
	* sysdeps/posix/writev.c (__writev): Likewise.
	* sysdeps/unix/sysv/linux/readv.c: Include <sys/uio.h>.
	(__readv): Likewise.
	* sysdeps/unix/sysv/linux/writev.c: Include <sys/uio.h>.
	(__writev): Likewise.
-rw-r--r--ChangeLog14
-rw-r--r--include/sys/uio.h2
-rw-r--r--misc/readv.c1
-rw-r--r--misc/writev.c1
-rw-r--r--sysdeps/posix/readv.c1
-rw-r--r--sysdeps/posix/writev.c1
-rw-r--r--sysdeps/unix/sysv/linux/readv.c2
-rw-r--r--sysdeps/unix/sysv/linux/writev.c2
8 files changed, 24 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 3726fac199..56b44eafc5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,20 @@
 2017-10-01  H.J. Lu  <hongjiu.lu@intel.com>
 
 	[BZ #18822]
+	* include/sys/uio.h (__readv): Add libc_hidden_proto.
+	(__writev): Likewise.
+	* misc/readv.c (__readv): Add libc_hidden_def.
+	* misc/writev.c (__writev): Likewise.
+	* sysdeps/posix/readv.c (__readv): Likewise.
+	* sysdeps/posix/writev.c (__writev): Likewise.
+	* sysdeps/unix/sysv/linux/readv.c: Include <sys/uio.h>.
+	(__readv): Likewise.
+	* sysdeps/unix/sysv/linux/writev.c: Include <sys/uio.h>.
+	(__writev): Likewise.
+
+2017-10-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #18822]
 	* include/regex.h (__re_compile_fastmap): Add attribute_hidden.
 	(__regcomp): Add libc_hidden_proto.
 	(__regexec): Likewise.
diff --git a/include/sys/uio.h b/include/sys/uio.h
index 20860bfd82..204c4b906d 100644
--- a/include/sys/uio.h
+++ b/include/sys/uio.h
@@ -5,8 +5,10 @@
 /* Now define the internal interfaces.  */
 extern ssize_t __readv (int __fd, const struct iovec *__iovec,
 			int __count);
+libc_hidden_proto (__readv)
 extern ssize_t __writev (int __fd, const struct iovec *__iovec,
 			 int __count);
+libc_hidden_proto (__writev)
 
 /* Used for p{read,write}{v64}v2 implementation.  */
 libc_hidden_proto (preadv)
diff --git a/misc/readv.c b/misc/readv.c
index 064f88523c..9ad94d370a 100644
--- a/misc/readv.c
+++ b/misc/readv.c
@@ -30,6 +30,7 @@ __readv (int fd, const struct iovec *vector, int count)
   __set_errno (ENOSYS);
   return -1;
 }
+libc_hidden_def (__readv)
 weak_alias (__readv, readv)
 
 stub_warning (readv)
diff --git a/misc/writev.c b/misc/writev.c
index c8d222e04f..8bd2eddf1a 100644
--- a/misc/writev.c
+++ b/misc/writev.c
@@ -30,6 +30,7 @@ __writev (int fd, const struct iovec *vector, int count)
   __set_errno (ENOSYS);
   return -1;
 }
+libc_hidden_def (__writev)
 weak_alias (__writev, writev)
 
 stub_warning (writev)
diff --git a/sysdeps/posix/readv.c b/sysdeps/posix/readv.c
index 5b0c124e89..2875c76daf 100644
--- a/sysdeps/posix/readv.c
+++ b/sysdeps/posix/readv.c
@@ -88,4 +88,5 @@ __readv (int fd, const struct iovec *vector, int count)
 
   return bytes_read;
 }
+libc_hidden_def (__readv)
 weak_alias (__readv, readv)
diff --git a/sysdeps/posix/writev.c b/sysdeps/posix/writev.c
index 7ce1deb80f..89d463033a 100644
--- a/sysdeps/posix/writev.c
+++ b/sysdeps/posix/writev.c
@@ -88,4 +88,5 @@ __writev (int fd, const struct iovec *vector, int count)
 
   return bytes_written;
 }
+libc_hidden_def (__writev)
 weak_alias (__writev, writev)
diff --git a/sysdeps/unix/sysv/linux/readv.c b/sysdeps/unix/sysv/linux/readv.c
index 142a0a92a7..e4713008f1 100644
--- a/sysdeps/unix/sysv/linux/readv.c
+++ b/sysdeps/unix/sysv/linux/readv.c
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <unistd.h>
+#include <sys/uio.h>
 #include <sysdep-cancel.h>
 
 ssize_t
@@ -24,4 +25,5 @@ __readv (int fd, const struct iovec *iov, int iovcnt)
 {
   return SYSCALL_CANCEL (readv, fd, iov, iovcnt);
 }
+libc_hidden_def (__readv)
 weak_alias (__readv, readv)
diff --git a/sysdeps/unix/sysv/linux/writev.c b/sysdeps/unix/sysv/linux/writev.c
index 1b56cbb709..2495fd938a 100644
--- a/sysdeps/unix/sysv/linux/writev.c
+++ b/sysdeps/unix/sysv/linux/writev.c
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <unistd.h>
+#include <sys/uio.h>
 #include <sysdep-cancel.h>
 
 ssize_t
@@ -24,4 +25,5 @@ __writev (int fd, const struct iovec *iov, int iovcnt)
 {
   return SYSCALL_CANCEL (writev, fd, iov, iovcnt);
 }
+libc_hidden_def (__writev)
 weak_alias (__writev, writev)