summaryrefslogtreecommitdiff
path: root/sysdeps/unix/make-syscalls.sh
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2015-12-14 22:52:15 +0000
committerJoseph Myers <joseph@codesourcery.com>2015-12-14 22:52:15 +0000
commiteed3e1eb79bcfa9b52609fd875fa2d522e2d6bce (patch)
treefd0bb92148058126d9d088d3996da8072c03b6f5 /sysdeps/unix/make-syscalls.sh
parent5db0877750f1e2a1983e1f5e43bd0cc68058f684 (diff)
downloadglibc-eed3e1eb79bcfa9b52609fd875fa2d522e2d6bce.tar.gz
Make obsolete syscall wrappers into compat symbols (bug 18472).
Various Linux kernel syscalls have become obsolete over time. Specifically, the following are obsolete in all kernel versions supported by glibc, are not present for architectures more recently added to the kernel, and as such, the wrapper functions for them should be compat symbols, not in static libc and not available for new links with shared libc. * bdflush: in Linux 2.6, does nothing if present. * create_module get_kernel_syms query_module: Linux 2.4 module interface, syscalls not present in Linux 2.6. * uselib: part of the mechanism for loading a.out shared libraries, irrelevant with ELF. This patch adds support for syscalls.list to list syscall aliases of the form NAME@VERSION:OBSOLETED, with SHLIB_COMPAT conditionals being generated for such aliases. Those five syscalls are then made into compat symbols (obsoleted in glibc 2.23, so future ports won't have these symbols at all), with the header <sys/kdaemon.h> declaring bdflush being removed. When we move to 3.2 as minimum kernel version, the same can be done for nfsservctl (removed in Linux 3.1) as well. Tested for x86_64 and x86 (testsuite, as well as checking that the symbols in question indeed become compat symbols, that they are indeed omitted from static libc, and that the generated SHLIB_COMPAT conditionals look right). [BZ #18472] * sysdeps/unix/Makefile ($(objpfx)stub-syscalls.c): Handle entries for the form NAME@VERSION:OBSOLETED and generate SHLIB_COMPAT conditionals for them. * sysdeps/unix/make-syscalls.sh (emit_weak_aliases): Likewise. * sysdeps/unix/sysv/linux/sys/kdaemon.h: Remove file. * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Remove sys/kdaemon.h. * sysdeps/unix/sysv/linux/syscalls.list (bdflush): Make into compat-only syscall, obsoleted in glibc 2.23. (create_module): Likewise. (get_kernel_syms): Likewise. (query_module): Likewise. (uselib): Likewise. * manual/sysinfo.texi (System Parameters): Do not mention bdflush.
Diffstat (limited to 'sysdeps/unix/make-syscalls.sh')
-rw-r--r--sysdeps/unix/make-syscalls.sh21
1 files changed, 14 insertions, 7 deletions
diff --git a/sysdeps/unix/make-syscalls.sh b/sysdeps/unix/make-syscalls.sh
index fbf96605e0..bbef3eb360 100644
--- a/sysdeps/unix/make-syscalls.sh
+++ b/sysdeps/unix/make-syscalls.sh
@@ -81,12 +81,9 @@ emit_weak_aliases()
# We use the <shlib-compat.h> macros to generate the versioned aliases
# so that the version sets can be mapped to the configuration's
- # minimum version set as per shlib-versions DEFAULT lines. But note
- # we don't generate any "#if SHLIB_COMPAT (...)" conditionals. To do
- # that we'd need to change the syscalls.list format so that it can
- # list the "obsoleted" version set too. If it ever arises that we
- # have a syscall entry point that is obsoleted by a newer version set,
- # we'll have to revamp all this.
+ # minimum version set as per shlib-versions DEFAULT lines. If an
+ # entry point is specified in the form NAME@VERSION:OBSOLETED, a
+ # SHLIB_COMPAT conditional is generated.
if [ $any_versioned = t ]; then
echo " echo '#include <shlib-compat.h>'; \\"
fi
@@ -113,7 +110,17 @@ emit_weak_aliases()
*@*)
base=`echo $name | sed 's/@.*//'`
ver=`echo $name | sed 's/.*@//;s/\./_/g'`
- echo " echo '#if defined SHARED && IS_IN (libc)'; \\"
+ case $ver in
+ *:*)
+ compat_ver=${ver#*:}
+ ver=${ver%%:*}
+ compat_cond=" && SHLIB_COMPAT (libc, $ver, $compat_ver)"
+ ;;
+ *)
+ compat_cond=
+ ;;
+ esac
+ echo " echo '#if defined SHARED && IS_IN (libc)$compat_cond'; \\"
if test -z "$vcount" ; then
source=$strong
vcount=1