From 620f462e88f6e7b59488a963b3c42d89035e4ba6 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 8 Oct 2014 23:19:32 +0000 Subject: [PATCH] Don't use INTUSE with __adjtimex (bug 14132). Bug 14132 is removal of the old INTDEF/INTUSE system of *_internal aliases as obsoleted by the hidden_proto / hidden_def system. Various cases were cleaned up in 2012, but some remain. This patch removes the use of this mechanism for __adjtimex. Tested for x86_64 that stripped installed shared libraries are unchanged by the patch. [BZ #14132] * sysdeps/unix/sysv/linux/include/sys/timex.h: New file. * sysdeps/unix/sysv/linux/adjtime.c [!ADJTIMEX] (ADJTIMEX): Do not use INTUSE. [!ADJTIMEX] (INTUSE(__adjtimex)): Remove declaration. * sysdeps/unix/sysv/linux/alpha/adjtime.c (__adjtimex_internal): Remove alias. (__adjtimex): Define using libc_hidden_ver. * sysdeps/unix/sysv/linux/ntp_gettime.c (INTUSE(__adjtimex)): Remove declaration. (ntp_gettime): Call __adjtimex directly. * sysdeps/unix/sysv/linux/ntp_gettimex.c (INTUSE(__adjtimex)): Remove declaration. (ntp_gettimex): Call __adjtimex directly. * sysdeps/unix/sysv/linux/syscalls.list (adjtimex): Remove __adjtimex_internal alias. --- ChangeLog | 19 +++++++++++++++ sysdeps/unix/sysv/linux/adjtime.c | 3 +-- sysdeps/unix/sysv/linux/alpha/adjtime.c | 2 +- sysdeps/unix/sysv/linux/include/sys/timex.h | 26 +++++++++++++++++++++ sysdeps/unix/sysv/linux/ntp_gettime.c | 5 +--- sysdeps/unix/sysv/linux/ntp_gettimex.c | 5 +--- sysdeps/unix/sysv/linux/syscalls.list | 2 +- 7 files changed, 50 insertions(+), 12 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/include/sys/timex.h diff --git a/ChangeLog b/ChangeLog index 3159fbeae8..a24865e06b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2014-10-08 Joseph Myers + + [BZ #14132] + * sysdeps/unix/sysv/linux/include/sys/timex.h: New file. + * sysdeps/unix/sysv/linux/adjtime.c [!ADJTIMEX] (ADJTIMEX): Do not + use INTUSE. + [!ADJTIMEX] (INTUSE(__adjtimex)): Remove declaration. + * sysdeps/unix/sysv/linux/alpha/adjtime.c (__adjtimex_internal): + Remove alias. + (__adjtimex): Define using libc_hidden_ver. + * sysdeps/unix/sysv/linux/ntp_gettime.c (INTUSE(__adjtimex)): + Remove declaration. + (ntp_gettime): Call __adjtimex directly. + * sysdeps/unix/sysv/linux/ntp_gettimex.c (INTUSE(__adjtimex)): + Remove declaration. + (ntp_gettimex): Call __adjtimex directly. + * sysdeps/unix/sysv/linux/syscalls.list (adjtimex): Remove + __adjtimex_internal alias. + 2014-10-08 Roland McGrath [BZ #17460] diff --git a/sysdeps/unix/sysv/linux/adjtime.c b/sysdeps/unix/sysv/linux/adjtime.c index 90300b5fbb..179f4cd6fa 100644 --- a/sysdeps/unix/sysv/linux/adjtime.c +++ b/sysdeps/unix/sysv/linux/adjtime.c @@ -41,8 +41,7 @@ #ifndef ADJTIMEX #define NO_LOCAL_ADJTIME -#define ADJTIMEX(x) INTUSE(__adjtimex) (x) -extern int INTUSE(__adjtimex) (struct timex *__ntx); +#define ADJTIMEX(x) __adjtimex (x) #endif #ifndef LINKAGE diff --git a/sysdeps/unix/sysv/linux/alpha/adjtime.c b/sysdeps/unix/sysv/linux/alpha/adjtime.c index a0cbba3d17..59a44029a6 100644 --- a/sysdeps/unix/sysv/linux/alpha/adjtime.c +++ b/sysdeps/unix/sysv/linux/alpha/adjtime.c @@ -86,7 +86,7 @@ compat_symbol (libc, __adjtime_tv32, adjtime, GLIBC_2_0); int __adjtimex_tv64 (struct timex *tx) { return ADJTIMEX (tx); } -strong_alias (__adjtimex_tv64, __adjtimex_internal); +libc_hidden_ver (__adjtimex_tv64, __adjtimex) strong_alias (__adjtimex_tv64, __adjtimex_tv64p); weak_alias (__adjtimex_tv64, ntp_adjtime); versioned_symbol (libc, __adjtimex_tv64, __adjtimex, GLIBC_2_1); diff --git a/sysdeps/unix/sysv/linux/include/sys/timex.h b/sysdeps/unix/sysv/linux/include/sys/timex.h new file mode 100644 index 0000000000..02bb59266e --- /dev/null +++ b/sysdeps/unix/sysv/linux/include/sys/timex.h @@ -0,0 +1,26 @@ +/* Internal declarations for sys/timex.h. + Copyright (C) 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 + . */ + +#ifndef _INCLUDE_SYS_TIMEX_H +#define _INCLUDE_SYS_TIMEX_H 1 + +#include_next + +libc_hidden_proto (__adjtimex) + +#endif /* sys/timex.h */ diff --git a/sysdeps/unix/sysv/linux/ntp_gettime.c b/sysdeps/unix/sysv/linux/ntp_gettime.c index 1b91292092..7e3cc3f742 100644 --- a/sysdeps/unix/sysv/linux/ntp_gettime.c +++ b/sysdeps/unix/sysv/linux/ntp_gettime.c @@ -26,9 +26,6 @@ #endif -extern int INTUSE(__adjtimex) (struct timex *__ntx); - - int ntp_gettime (struct ntptimeval *ntv) { @@ -36,7 +33,7 @@ ntp_gettime (struct ntptimeval *ntv) int result; tntx.modes = 0; - result = INTUSE(__adjtimex) (&tntx); + result = __adjtimex (&tntx); ntv->time = tntx.time; ntv->maxerror = tntx.maxerror; ntv->esterror = tntx.esterror; diff --git a/sysdeps/unix/sysv/linux/ntp_gettimex.c b/sysdeps/unix/sysv/linux/ntp_gettimex.c index bfb72b1ee4..a91b57c102 100644 --- a/sysdeps/unix/sysv/linux/ntp_gettimex.c +++ b/sysdeps/unix/sysv/linux/ntp_gettimex.c @@ -22,9 +22,6 @@ #endif -extern int INTUSE(__adjtimex) (struct timex *__ntx); - - int ntp_gettimex (struct ntptimeval *ntv) { @@ -32,7 +29,7 @@ ntp_gettimex (struct ntptimeval *ntv) int result; tntx.modes = 0; - result = INTUSE(__adjtimex) (&tntx); + result = __adjtimex (&tntx); ntv->time = tntx.time; ntv->maxerror = tntx.maxerror; ntv->esterror = tntx.esterror; diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list index ddec198279..a0b8de80a6 100644 --- a/sysdeps/unix/sysv/linux/syscalls.list +++ b/sysdeps/unix/sysv/linux/syscalls.list @@ -1,6 +1,6 @@ # File name Caller Syscall name Args Strong name Weak names -adjtimex adjtime adjtimex i:p __adjtimex adjtimex ntp_adjtime __adjtimex_internal +adjtimex adjtime adjtimex i:p __adjtimex adjtimex ntp_adjtime alarm - alarm i:i alarm bdflush EXTRA bdflush i:ii bdflush capget EXTRA capget i:pp capget