]> sourceware.org Git - glibc.git/commitdiff
Make llseek a compat symbol (bug 18471).
authorJoseph Myers <joseph@codesourcery.com>
Tue, 22 May 2018 15:44:01 +0000 (15:44 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 22 May 2018 15:44:01 +0000 (15:44 +0000)
The llseek function name is an obsolete, Linux-specific, unprototyped
name for lseek64 with a link-time warning.  This patch completes the
obsoletion of this function name by making it into a compat symbol,
not available for newly linked programs and not included in the ABI
for new ports.

When a compat symbol is defined in syscalls.list, the code for that
function is not built at all for static linking unless some non-compat
symbol for that function is also defined with an explicit symbol
version, so an explicit symbol version for lseek64 is added to the
MIPS n32 syscalls.list.  The case in make-syscalls.sh that handles
such explicit non-compat symbol versions then needs to be changed to
use weak_alias instead of strong_alias when the syscall is built
outside of libc, to avoid linknamespace failures from a strong lseek64
symbol in static libpthread.

The x32 llseek.S was as far as I could tell already unused (nothing
builds an llseek.* source file, at least since the lseek / lseek64 /
llseek consolidation), so is removed in this patch as well.

Tested for x86_64 and x86, and with build-many-glibcs.py.

[BZ #18471]
* sysdeps/unix/make-syscalls.sh (emit_weak_aliases): Use weak
aliases for non-libc case of versioned symbols.
* sysdeps/unix/sysv/linux/lseek64.c: Include <shlib-compat.h>.
(llseek): Define as compat symbol if
[SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_28)], not as weak alias
with link warning.
* sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list (llseek):
Make into a compat symbol, disabled for minimum symbol version
GLIBC_2.28 and later.
* sysdeps/unix/sysv/linux/x86_64/x32/llseek.S: Remove file.

ChangeLog
NEWS
sysdeps/unix/make-syscalls.sh
sysdeps/unix/sysv/linux/lseek64.c
sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
sysdeps/unix/sysv/linux/x86_64/x32/llseek.S [deleted file]

index 22785e1e02437b5d81d732b566f29598852f3033..6c9331b89431f46aef77cbd84ed59c009c05f16a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2018-05-22  Joseph Myers  <joseph@codesourcery.com>
+
+       [BZ #18471]
+       * sysdeps/unix/make-syscalls.sh (emit_weak_aliases): Use weak
+       aliases for non-libc case of versioned symbols.
+       * sysdeps/unix/sysv/linux/lseek64.c: Include <shlib-compat.h>.
+       (llseek): Define as compat symbol if
+       [SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_28)], not as weak alias
+       with link warning.
+       * sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list (llseek):
+       Make into a compat symbol, disabled for minimum symbol version
+       GLIBC_2.28 and later.
+       * sysdeps/unix/sysv/linux/x86_64/x32/llseek.S: Remove file.
+
 2018-05-22  Florian Weimer  <fweimer@redhat.com>
 
        * sysdeps/i386/Makefile [$(subdir) == math] (sysdep-CFLAGS): Do
diff --git a/NEWS b/NEWS
index bade9e4765f7af1b41bcac19aa4e477c05111f89..7838f79ab279d900c0ca1f215b229533c3c7edd3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -74,6 +74,11 @@ Deprecated and removed features, and other changes affecting compatibility:
   and could not usefully be used with the GNU C Library on systems with
   version 3.1 or later of the Linux kernel.
 
+* The obsolete function name llseek is no longer available to newly linked
+  binaries.  This function was specific to systems using the Linux kernel
+  and was not declared in a header.  Programs should use the lseek64 name
+  for this function instead.
+
 Changes to build and runtime requirements:
 
   [Add changes to build and runtime requirements here]
index 874ad691cd34f7489bef0c8b602b18871a71ee15..e39b2d6d5214ace6545e9c79621a90728e5beb37 100644 (file)
@@ -103,7 +103,7 @@ emit_weak_aliases()
        fi
        echo "   echo 'versioned_symbol (libc, $source, $base, $ver)'; \\"
        echo "   echo '#else'; \\"
-       echo "   echo 'strong_alias ($strong, $base)'; \\"
+       echo "   echo 'weak_alias ($strong, $base)'; \\"
        echo "   echo '#endif'; \\"
        ;;
       *@*)
index 504d0087824f8d2c9286d7b25bdb25dbaad1431e..2ad6a610c8ec7b0f96edbbe86badfb7812c56a5b 100644 (file)
@@ -21,6 +21,7 @@
 #include <sys/types.h>
 #include <sysdep.h>
 #include <errno.h>
+#include <shlib-compat.h>
 
 off64_t
 __lseek64 (int fd, off64_t offset, int whence)
@@ -46,9 +47,7 @@ libc_hidden_def (__lseek)
 strong_alias (__lseek64, __libc_lseek64)
 weak_alias (__lseek64, lseek64)
 
-/* llseek doesn't have a prototype.  Since the second parameter is a
-   64bit type, this results in wrong behaviour if no prototype is
-   provided.  */
-weak_alias (__lseek64, llseek)
-link_warning (llseek, "\
-the `llseek' function may be dangerous; use `lseek64' instead.")
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_28)
+strong_alias (__lseek64, __compat_llseek)
+compat_symbol (libc, __compat_llseek, llseek, GLIBC_2_0);
+#endif
index 33d968fe0ac6d600ba2adc36b2d30f35b79edbd1..9e6a584685627d0d85b6531f869b7e799a6b71d4 100644 (file)
@@ -2,7 +2,7 @@
 
 # C syscall macros cannot be used because this syscall has a 64-bit
 # return value.
-lseek64                -       lseek           i:iii   __lseek64       __libc_lseek64 lseek64 llseek
+lseek64                -       lseek           i:iii   __lseek64       __libc_lseek64 lseek64@@GLIBC_2.2 llseek@GLIBC_2.0:GLIBC_2.28
 
 prlimit64      EXTRA   prlimit64       i:iipp  prlimit64
 
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/llseek.S b/sysdeps/unix/sysv/linux/x86_64/x32/llseek.S
deleted file mode 100644 (file)
index 5084d0e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/* No llseek for x32.  */
This page took 0.091718 seconds and 5 git commands to generate.