ce426f
commit 89fb6835583088059b8d8987c86caac33e37e5ea
ce426f
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
ce426f
Date:   Tue Jun 11 11:11:11 2013 +0530
ce426f
ce426f
    Fix symbol definitions for __clock_* functions
ce426f
    
ce426f
    __clock_gettime and other __clock_* functions could result in an extra
ce426f
    PLT reference within libc.so if it actually gets used.  None of the
ce426f
    code currently uses them, which is why this probably went unnoticed.
ce426f
ce426f
Index: b/include/time.h
ce426f
===================================================================
ce426f
--- a/include/time.h
ce426f
+++ b/include/time.h
ce426f
@@ -21,6 +21,7 @@ libc_hidden_proto (strptime)
ce426f
 
ce426f
 extern __typeof (clock_getres) __clock_getres;
ce426f
 extern __typeof (clock_gettime) __clock_gettime;
ce426f
+libc_hidden_proto (__clock_gettime)
ce426f
 extern __typeof (clock_settime) __clock_settime;
ce426f
 extern __typeof (clock_nanosleep) __clock_nanosleep;
ce426f
 extern __typeof (clock_getcpuclockid) __clock_getcpuclockid;
ce426f
Index: b/rt/clock_getcpuclockid.c
ce426f
===================================================================
ce426f
--- a/rt/clock_getcpuclockid.c
ce426f
+++ b/rt/clock_getcpuclockid.c
ce426f
@@ -21,7 +21,7 @@
ce426f
 #include <unistd.h>
ce426f
 
ce426f
 int
ce426f
-clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
ce426f
+__clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
ce426f
 {
ce426f
   /* We don't allow any process ID but our own.  */
ce426f
   if (pid != 0 && pid != getpid ())
ce426f
@@ -37,4 +37,4 @@ clock_getcpuclockid (pid_t pid, clockid_
ce426f
   return ENOENT;
ce426f
 #endif
ce426f
 }
ce426f
-strong_alias (clock_getcpuclockid, __clock_getcpuclockid)
ce426f
+weak_alias (__clock_getcpuclockid, clock_getcpuclockid)
ce426f
Index: b/rt/clock_getres.c
ce426f
===================================================================
ce426f
--- a/rt/clock_getres.c
ce426f
+++ b/rt/clock_getres.c
ce426f
@@ -21,10 +21,10 @@
ce426f
 
ce426f
 /* Get resolution of clock.  */
ce426f
 int
ce426f
-clock_getres (clockid_t clock_id, struct timespec *res)
ce426f
+__clock_getres (clockid_t clock_id, struct timespec *res)
ce426f
 {
ce426f
   __set_errno (ENOSYS);
ce426f
   return -1;
ce426f
 }
ce426f
-strong_alias (clock_getres, __clock_getres)
ce426f
+weak_alias (__clock_getres, clock_getres)
ce426f
 stub_warning (clock_getres)
ce426f
Index: b/rt/clock_gettime.c
ce426f
===================================================================
ce426f
--- a/rt/clock_gettime.c
ce426f
+++ b/rt/clock_gettime.c
ce426f
@@ -21,10 +21,11 @@
ce426f
 
ce426f
 /* Get current value of CLOCK and store it in TP.  */
ce426f
 int
ce426f
-clock_gettime (clockid_t clock_id, struct timespec *tp)
ce426f
+__clock_gettime (clockid_t clock_id, struct timespec *tp)
ce426f
 {
ce426f
   __set_errno (ENOSYS);
ce426f
   return -1;
ce426f
 }
ce426f
-strong_alias (clock_gettime, __clock_gettime)
ce426f
+weak_alias (__clock_gettime, clock_gettime)
ce426f
+libc_hidden_def (__clock_gettime)
ce426f
 stub_warning (clock_gettime)
ce426f
Index: b/rt/clock_nanosleep.c
ce426f
===================================================================
ce426f
--- a/rt/clock_nanosleep.c
ce426f
+++ b/rt/clock_nanosleep.c
ce426f
@@ -20,8 +20,8 @@
ce426f
 #include <time.h>
ce426f
 
ce426f
 int
ce426f
-clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
ce426f
-		 struct timespec *rem)
ce426f
+__clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
ce426f
+		   struct timespec *rem)
ce426f
 {
ce426f
   if (__builtin_expect (req->tv_nsec, 0) < 0
ce426f
       || __builtin_expect (req->tv_nsec, 0) >= 1000000000)
ce426f
@@ -33,5 +33,5 @@ clock_nanosleep (clockid_t clock_id, int
ce426f
   /* Not implemented.  */
ce426f
   return ENOSYS;
ce426f
 }
ce426f
-strong_alias (clock_nanosleep, __clock_nanosleep)
ce426f
+weak_alias (__clock_nanosleep, clock_nanosleep)
ce426f
 stub_warning (clock_nanosleep)
ce426f
Index: b/rt/clock_settime.c
ce426f
===================================================================
ce426f
--- a/rt/clock_settime.c
ce426f
+++ b/rt/clock_settime.c
ce426f
@@ -21,10 +21,10 @@
ce426f
 
ce426f
 /* Set CLOCK to value TP.  */
ce426f
 int
ce426f
-clock_settime (clockid_t clock_id, const struct timespec *tp)
ce426f
+__clock_settime (clockid_t clock_id, const struct timespec *tp)
ce426f
 {
ce426f
   __set_errno (ENOSYS);
ce426f
   return -1;
ce426f
 }
ce426f
-strong_alias (clock_settime, __clock_settime)
ce426f
+weak_alias (__clock_settime, clock_settime)
ce426f
 stub_warning (clock_settime)
ce426f
Index: b/sysdeps/posix/clock_getres.c
ce426f
===================================================================
ce426f
--- a/sysdeps/posix/clock_getres.c
ce426f
+++ b/sysdeps/posix/clock_getres.c
ce426f
@@ -76,7 +76,7 @@ realtime_getres (struct timespec *res)
ce426f
 
ce426f
 /* Get resolution of clock.  */
ce426f
 int
ce426f
-clock_getres (clockid_t clock_id, struct timespec *res)
ce426f
+__clock_getres (clockid_t clock_id, struct timespec *res)
ce426f
 {
ce426f
   int retval = -1;
ce426f
 
ce426f
@@ -115,4 +115,4 @@ clock_getres (clockid_t clock_id, struct
ce426f
 
ce426f
   return retval;
ce426f
 }
ce426f
-strong_alias (clock_getres, __clock_getres)
ce426f
+weak_alias (__clock_getres, clock_getres)
ce426f
Index: b/sysdeps/unix/clock_gettime.c
ce426f
===================================================================
ce426f
--- a/sysdeps/unix/clock_gettime.c
ce426f
+++ b/sysdeps/unix/clock_gettime.c
ce426f
@@ -89,7 +89,7 @@ realtime_gettime (struct timespec *tp)
ce426f
 
ce426f
 /* Get current value of CLOCK and store it in TP.  */
ce426f
 int
ce426f
-clock_gettime (clockid_t clock_id, struct timespec *tp)
ce426f
+__clock_gettime (clockid_t clock_id, struct timespec *tp)
ce426f
 {
ce426f
   int retval = -1;
ce426f
 
ce426f
@@ -132,4 +132,5 @@ clock_gettime (clockid_t clock_id, struc
ce426f
 
ce426f
   return retval;
ce426f
 }
ce426f
-strong_alias (clock_gettime, __clock_gettime)
ce426f
+weak_alias (__clock_gettime, clock_gettime)
ce426f
+libc_hidden_def (__clock_gettime)
ce426f
Index: b/sysdeps/unix/clock_nanosleep.c
ce426f
===================================================================
ce426f
--- a/sysdeps/unix/clock_nanosleep.c
ce426f
+++ b/sysdeps/unix/clock_nanosleep.c
ce426f
@@ -39,8 +39,8 @@
ce426f
 /* This implementation assumes that these is only a `nanosleep' system
ce426f
    call.  So we have to remap all other activities.  */
ce426f
 int
ce426f
-clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
ce426f
-		 struct timespec *rem)
ce426f
+__clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
ce426f
+		   struct timespec *rem)
ce426f
 {
ce426f
   struct timespec now;
ce426f
 
ce426f
@@ -98,4 +98,4 @@ clock_nanosleep (clockid_t clock_id, int
ce426f
 
ce426f
   return __builtin_expect (nanosleep (req, rem), 0) ? errno : 0;
ce426f
 }
ce426f
-strong_alias (clock_nanosleep, __clock_nanosleep)
ce426f
+weak_alias (__clock_nanosleep, clock_nanosleep)
ce426f
Index: b/sysdeps/unix/clock_settime.c
ce426f
===================================================================
ce426f
--- a/sysdeps/unix/clock_settime.c
ce426f
+++ b/sysdeps/unix/clock_settime.c
ce426f
@@ -72,7 +72,7 @@ hp_timing_settime (clockid_t clock_id, c
ce426f
 
ce426f
 /* Set CLOCK to value TP.  */
ce426f
 int
ce426f
-clock_settime (clockid_t clock_id, const struct timespec *tp)
ce426f
+__clock_settime (clockid_t clock_id, const struct timespec *tp)
ce426f
 {
ce426f
   int retval;
ce426f
 
ce426f
@@ -124,4 +124,4 @@ clock_settime (clockid_t clock_id, const
ce426f
 
ce426f
   return retval;
ce426f
 }
ce426f
-strong_alias (clock_settime, __clock_settime)
ce426f
+weak_alias (__clock_settime, clock_settime)
ce426f
Index: b/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
ce426f
===================================================================
ce426f
--- a/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
ce426f
+++ b/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
ce426f
@@ -23,7 +23,7 @@
ce426f
 #include "kernel-posix-cpu-timers.h"
ce426f
 
ce426f
 int
ce426f
-clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
ce426f
+__clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
ce426f
 {
ce426f
   /* The clockid_t value is a simple computation from the PID.
ce426f
      But we do a clock_getres call to validate it.  */
ce426f
@@ -46,4 +46,4 @@ clock_getcpuclockid (pid_t pid, clockid_
ce426f
   else
ce426f
     return INTERNAL_SYSCALL_ERRNO (r, err);
ce426f
 }
ce426f
-strong_alias (clock_getcpuclockid, __clock_getcpuclockid)
ce426f
+weak_alias (__clock_getcpuclockid, clock_getcpuclockid)
ce426f
Index: b/sysdeps/unix/sysv/linux/clock_nanosleep.c
ce426f
===================================================================
ce426f
--- a/sysdeps/unix/sysv/linux/clock_nanosleep.c
ce426f
+++ b/sysdeps/unix/sysv/linux/clock_nanosleep.c
ce426f
@@ -26,8 +26,8 @@
ce426f
 /* We can simply use the syscall.  The CPU clocks are not supported
ce426f
    with this function.  */
ce426f
 int
ce426f
-clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
ce426f
-		 struct timespec *rem)
ce426f
+__clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
ce426f
+		   struct timespec *rem)
ce426f
 {
ce426f
   INTERNAL_SYSCALL_DECL (err);
ce426f
   int r;
ce426f
@@ -52,4 +52,4 @@ clock_nanosleep (clockid_t clock_id, int
ce426f
   return (INTERNAL_SYSCALL_ERROR_P (r, err)
ce426f
 	  ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
ce426f
 }
ce426f
-strong_alias (clock_nanosleep, __clock_nanosleep)
ce426f
+weak_alias (__clock_nanosleep, clock_nanosleep)