From 98ac7b7c85429913c94a9bd9fbe74bb5a333d224 Mon Sep 17 00:00:00 2001 From: Stefan Liebler Date: Fri, 7 Oct 2016 09:56:47 +0200 Subject: Use libc_ifunc macro for clock_* symbols in librt. This patch uses the libc_ifunc macro to create already existing ifunc functions clock_getres, clock_gettime, clock_settime, clock_getcpuclockid and clock_nanosleep. If HAVE_IFUNC is defined, the macro COMPAT_REDIRECT uses the libc_ifunc macro. Furthermore some whitespace damage is cleaned. ChangeLog: * rt/clock-compat.c (COMPAT_REDIRECT): Use libc_ifunc macro. --- ChangeLog | 4 ++++ rt/clock-compat.c | 34 +++++++++++++++------------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4cf2234..44c1ef2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2016-10-07 Stefan Liebler + * rt/clock-compat.c (COMPAT_REDIRECT): Use libc_ifunc macro. + +2016-10-07 Stefan Liebler + * sysdeps/unix/sysv/linux/powerpc/gettimeofday.c (__gettimeofday): Use libc_ifunc_hidden and libc_hidden_def macro. Redirect ifunced function in header for using it as type for ifunc function because __GI_* symbols diff --git a/rt/clock-compat.c b/rt/clock-compat.c index dc69e4a..b47781c 100644 --- a/rt/clock-compat.c +++ b/rt/clock-compat.c @@ -28,13 +28,9 @@ #include #if HAVE_IFUNC -# define COMPAT_REDIRECT(name, proto, arglist) \ - __typeof (name) *name##_ifunc (void) asm (#name); \ - __typeof (name) *name##_ifunc (void) \ - { \ - return &__##name; \ - } \ - asm (".type " #name ", %gnu_indirect_function"); +# undef INIT_ARCH +# define INIT_ARCH() +# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name) #else # define COMPAT_REDIRECT(name, proto, arglist) \ int \ @@ -45,21 +41,21 @@ #endif COMPAT_REDIRECT (clock_getres, - (clockid_t clock_id, struct timespec *res), - (clock_id, res)) + (clockid_t clock_id, struct timespec *res), + (clock_id, res)) COMPAT_REDIRECT (clock_gettime, - (clockid_t clock_id, struct timespec *tp), - (clock_id, tp)) + (clockid_t clock_id, struct timespec *tp), + (clock_id, tp)) COMPAT_REDIRECT (clock_settime, - (clockid_t clock_id, const struct timespec *tp), - (clock_id, tp)) + (clockid_t clock_id, const struct timespec *tp), + (clock_id, tp)) COMPAT_REDIRECT (clock_getcpuclockid, - (pid_t pid, clockid_t *clock_id), - (pid, clock_id)) + (pid_t pid, clockid_t *clock_id), + (pid, clock_id)) COMPAT_REDIRECT (clock_nanosleep, - (clockid_t clock_id, int flags, - const struct timespec *req, - struct timespec *rem), - (clock_id, flags, req, rem)) + (clockid_t clock_id, int flags, + const struct timespec *req, + struct timespec *rem), + (clock_id, flags, req, rem)) #endif -- cgit v1.1