]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Support and use mixed compat/non-compat aliases in syscalls.list.
authorJoseph Myers <joseph@codesourcery.com>
Mon, 6 Oct 2014 22:58:59 +0000 (22:58 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Mon, 6 Oct 2014 22:58:59 +0000 (22:58 +0000)
This patch enables syscalls.list entries to specify both compat and
non-compat symbol versions for the same syscall definition, making use
of this for setrlimit / chown / lchown where the inability to specify
such aliases showed up in the course of work on bug 14138.

The change to make-syscalls.sh is minimal: adding a SHARED conditional
on the compat_symbol calls.  It remains the case that if a compat
symbol version is specified, the syscall is only built for the shared
library at all if an explicit symbol version is given for a non-compat
symbol (so it's necessary to specify "lchown@@GLIBC_2.0
chown@GLIBC_2.0" rather than just "lchown chown@GLIBC_2.0").  It also
remains the case, as already commented in make-syscalls.sh, that no
SHLIB_COMPAT conditionals are generated, so there would be problems if
the same syscalls.list file, with compat symbols, were used for both
configurations that should have those symbols and configurations for
which they should be conditioned out with SHLIB_COMPAT.

Tested for x86.

* sysdeps/unix/make-syscalls.sh (emit_weak_aliases): Condition
compat_symbol calls on [SHARED].
* sysdeps/unix/sysv/linux/powerpc/lchown.S: Remove file.
* sysdeps/unix/sysv/linux/i386/syscalls.list (oldsetrlimit):
Remove.
(setrlimit): Add setrlimit@GLIBC_2.0 alias.
* sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list
(oldsetrlimit): Remove.
(setrlimit): Add setrlimit@GLIBC_2.0 alias.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list
(lchown): New syscall entry.
(oldsetrlimit): Remove.
(setrlimit): Add setrlimit@GLIBC_2.0 alias.
* sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list
(oldsetrlimit): Remove.
(setrlimit): Add setrlimit@GLIBC_2.0 alias.

ChangeLog
sysdeps/unix/make-syscalls.sh
sysdeps/unix/sysv/linux/i386/syscalls.list
sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list
sysdeps/unix/sysv/linux/powerpc/lchown.S [deleted file]
sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list
sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list

index 5a89797b45f36744a892ca551522cfce2e6a60d9..29c5883ca6c15a0c3dc78c3e4de507a2108244d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
 2014-10-06  Joseph Myers  <joseph@codesourcery.com>
 
+       * sysdeps/unix/make-syscalls.sh (emit_weak_aliases): Condition
+       compat_symbol calls on [SHARED].
+       * sysdeps/unix/sysv/linux/powerpc/lchown.S: Remove file.
+       * sysdeps/unix/sysv/linux/i386/syscalls.list (oldsetrlimit):
+       Remove.
+       (setrlimit): Add setrlimit@GLIBC_2.0 alias.
+       * sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list
+       (oldsetrlimit): Remove.
+       (setrlimit): Add setrlimit@GLIBC_2.0 alias.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list
+       (lchown): New syscall entry.
+       (oldsetrlimit): Remove.
+       (setrlimit): Add setrlimit@GLIBC_2.0 alias.
+       * sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list
+       (oldsetrlimit): Remove.
+       (setrlimit): Add setrlimit@GLIBC_2.0 alias.
+
        [BZ #14138]
        * sysdeps/unix/sysv/linux/arm/fchown.c: Remove file.
        * sysdeps/unix/sysv/linux/arm/lchown.c: Likewise.
index 6eba62c9461e3e14fb1ae39ba29f3d25061fc6f7..fd6ebb4dbcc19a9f7f085dea11ff38ace2833e09 100644 (file)
@@ -113,7 +113,7 @@ emit_weak_aliases()
       *@*)
        base=`echo $name | sed 's/@.*//'`
        ver=`echo $name | sed 's/.*@//;s/\./_/g'`
-       echo "   echo '#ifndef NOT_IN_libc'; \\"
+       echo "   echo '#if defined SHARED && !defined NOT_IN_libc'; \\"
        if test -z "$vcount" ; then
          source=$strong
          vcount=1
index 8d94828cb4941df6a3689f5cc4a7c15f504946f0..0d3eabee64d436280aa841bd8ec7b5482b617a1b 100644 (file)
@@ -4,8 +4,7 @@ modify_ldt      EXTRA   modify_ldt      i:ipi   __modify_ldt    modify_ldt
 vm86old                EXTRA   vm86old         i:p     __vm86old       vm86@GLIBC_2.0
 vm86           -       vm86            i:ip    __vm86          vm86@@GLIBC_2.3.4
 oldgetrlimit   EXTRA   getrlimit       i:ip    __old_getrlimit getrlimit@GLIBC_2.0
-oldsetrlimit   EXTRA   setrlimit       i:ip    __old_setrlimit setrlimit@GLIBC_2.0
-setrlimit      -       setrlimit       i:ip    __setrlimit     setrlimit@@GLIBC_2.2
+setrlimit      -       setrlimit       i:ip    __setrlimit     setrlimit@GLIBC_2.0 setrlimit@@GLIBC_2.2
 waitpid                -       waitpid         Ci:ipi  __waitpid       waitpid __libc_waitpid
 
 prlimit64      EXTRA   prlimit64       i:iipp  prlimit64
index 6f1053618dc65a6bc2618f1d3387c10d117a36db..b0ad68936dece6cf5c07fb692dfb9f000d5159ba 100644 (file)
@@ -1,5 +1,4 @@
 # File name    Caller  Syscall name    Args    Strong name     Weak names
 
 oldgetrlimit   EXTRA   getrlimit       i:ip    __old_getrlimit getrlimit@GLIBC_2.0
-oldsetrlimit   EXTRA   setrlimit       i:ip    __old_setrlimit setrlimit@GLIBC_2.0
-setrlimit      -       setrlimit       i:ip    __setrlimit     setrlimit@@GLIBC_2.2
+setrlimit      -       setrlimit       i:ip    __setrlimit     setrlimit@GLIBC_2.0 setrlimit@@GLIBC_2.2
diff --git a/sysdeps/unix/sysv/linux/powerpc/lchown.S b/sysdeps/unix/sysv/linux/powerpc/lchown.S
deleted file mode 100644 (file)
index 1785748..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/* lchown system call.
-   Copyright (C) 1998-2014 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-/* Some old kernel headers call lchown() 'chown'.  The number is
-   the same.  */
-
-#include <sysdep.h>
-
-#ifdef __NR_lchown
-       PSEUDO (__lchown, lchown, 3)
-#else
-       PSEUDO (__lchown, chown, 3)
-#endif
-       ret
-       PSEUDO_END(__lchown)
-       weak_alias (__lchown, lchown)
-
-#ifdef SHARED
-#include <shlib-compat.h>
-# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
-compat_symbol (libc, __lchown, chown, GLIBC_2_0)
-# endif
-#endif
index 25487cc3e0db88c15a1b2d4743f2b80f165dd1e7..451d50884bb891552cef84cdd76ee20a57ceefdb 100644 (file)
@@ -1,11 +1,11 @@
 # File name    Caller  Syscall name    # args  Strong name     Weak names
 
 chown          -       chown           i:sii   __chown         chown@@GLIBC_2.1
+lchown         -       lchown          i:sii   __lchown        lchown@@GLIBC_2.0 chown@GLIBC_2.0
 
 # System calls with wrappers.
 oldgetrlimit   EXTRA   getrlimit       i:ip    __old_getrlimit getrlimit@GLIBC_2.0
-oldsetrlimit   EXTRA   setrlimit       i:ip    __old_setrlimit setrlimit@GLIBC_2.0
-setrlimit      -       setrlimit       i:ip    __setrlimit     setrlimit@@GLIBC_2.2
+setrlimit      -       setrlimit       i:ip    __setrlimit     setrlimit@GLIBC_2.0 setrlimit@@GLIBC_2.2
 
 # Due to 64bit alignment there is a dummy second parameter
 readahead      -       readahead       i:iiiii __readahead     readahead
index 523bd2c9f768ca2cf2fc483d70c84983aa0684ed..902491c6dd60dfd0137d71b49f29b7b9e59060f8 100644 (file)
@@ -1,8 +1,7 @@
 # File name    Caller  Syscall name    Args    Strong name     Weak names
 
 oldgetrlimit   EXTRA   getrlimit       i:ip    __old_getrlimit getrlimit@GLIBC_2.0
-oldsetrlimit   EXTRA   setrlimit       i:ip    __old_setrlimit setrlimit@GLIBC_2.0
-setrlimit      -       setrlimit       i:ip    __setrlimit     setrlimit@@GLIBC_2.2
+setrlimit      -       setrlimit       i:ip    __setrlimit     setrlimit@GLIBC_2.0 setrlimit@@GLIBC_2.2
 
 prlimit64      EXTRA   prlimit64       i:iipp  prlimit64
 fanotify_mark  EXTRA   fanotify_mark   i:iiiiis        fanotify_mark