]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Use libc_ifunc macro for clock_* symbols in librt.
authorStefan Liebler <stli@linux.vnet.ibm.com>
Fri, 7 Oct 2016 07:56:47 +0000 (09:56 +0200)
committerStefan Liebler <stli@linux.vnet.ibm.com>
Fri, 7 Oct 2016 08:12:47 +0000 (10:12 +0200)
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
rt/clock-compat.c

index 4cf22340f9881bf165ba38b57547e0c3c5521039..44c1ef2ec8367c3fb8b30bfe682cb7dce41ba592 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-10-07  Stefan Liebler  <stli@linux.vnet.ibm.com>
+
+       * rt/clock-compat.c (COMPAT_REDIRECT): Use libc_ifunc macro.
+
 2016-10-07  Stefan Liebler  <stli@linux.vnet.ibm.com>
 
        * sysdeps/unix/sysv/linux/powerpc/gettimeofday.c (__gettimeofday):
index dc69e4a161f387e73967c32a6d9ff066927a2434..b47781cb2eacbc0e250c525da892f28dfa27f5b1 100644 (file)
 #include <time.h>
 
 #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                                                                        \
 #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