Avoid dup3 PLT usage.
authorThomas Schwinge <thomas@codesourcery.com>
Sat, 12 May 2012 02:53:04 +0000 (10:53 +0800)
committerThomas Schwinge <thomas@codesourcery.com>
Sat, 12 May 2012 02:53:04 +0000 (10:53 +0800)
Fixes fallout from 5aa3a74a59916b489e9cf7c4dce9eb149e106c6c.

ChangeLog
io/dup3.c
libio/freopen.c
libio/freopen64.c
sysdeps/unix/syscalls.list

index 0c4a814..8a10d6a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-05-12  Thomas Schwinge  <thomas@codesourcery.com>
+
+       * io/dup3.c (dup3): Rename to __dup3, add weak alias for dup3.
+       * sysdeps/unix/syscalls.list (dup3): Likewise.
+       * libio/freopen.c (freopen): Invoke __dup3 instead of dup3.
+       * libio/freopen64.c (freopen64): Invoke __dup3 instead of dup3.
+
 2012-05-11  H.J. Lu  <hongjiu.lu@intel.com>
 
        * elf/stackguard-macros.h (STACK_CHK_GUARD) [__x86_64__]: Use
index 90a3d60..7e97bf7 100644 (file)
--- a/io/dup3.c
+++ b/io/dup3.c
@@ -24,7 +24,7 @@
    open the same file as FD is which setting flags according to
    FLAGS.  Return FD2 or -1.  */
 int
-dup3 (fd, fd2, flags)
+__dup3 (fd, fd2, flags)
      int fd;
      int fd2;
      int flags;
@@ -42,7 +42,8 @@ dup3 (fd, fd2, flags)
   __set_errno (ENOSYS);
   return -1;
 }
-libc_hidden_def (dup3)
+libc_hidden_def (__dup3)
+weak_alias (__dup3, dup3)
 stub_warning (dup3)
 
 #include <stub-tag.h>
index 025c55b..fa89c27 100644 (file)
@@ -89,9 +89,9 @@ freopen (filename, mode, fp)
          else
            newfd =
 # endif
-             dup3 (_IO_fileno (result), fd,
-                   (result->_flags2 & _IO_FLAGS2_CLOEXEC) != 0
-                   ? O_CLOEXEC : 0);
+             __dup3 (_IO_fileno (result), fd,
+                      (result->_flags2 & _IO_FLAGS2_CLOEXEC) != 0
+                      ? O_CLOEXEC : 0);
 #else
 # define newfd 1
 #endif
index 24d0360..c28a992 100644 (file)
@@ -73,9 +73,9 @@ freopen64 (filename, mode, fp)
          else
            newfd =
 # endif
-             dup3 (_IO_fileno (result), fd,
-                   (result->_flags2 & _IO_FLAGS2_CLOEXEC) != 0
-                   ? O_CLOEXEC : 0);
+             __dup3 (_IO_fileno (result), fd,
+                      (result->_flags2 & _IO_FLAGS2_CLOEXEC) != 0
+                      ? O_CLOEXEC : 0);
 #else
 # define newfd 1
 #endif
index 5c696b3..39c40ed 100644 (file)
@@ -10,7 +10,7 @@ chroot                -       chroot          i:s     chroot
 close          -       close           Ci:i    __libc_close    __close close
 dup            -       dup             i:i     __dup           dup
 dup2           -       dup2            i:ii    __dup2          dup2
-dup3           -       dup3            i:iii   dup3
+dup3           -       dup3            i:iii   __dup3          dup3
 fchdir         -       fchdir          i:i     __fchdir        fchdir
 fchmod         -       fchmod          i:ii    __fchmod        fchmod
 fchown         -       fchown          i:iii   __fchown        fchown