arrfab / rpms / glibc

Forked from rpms/glibc 4 years ago
Clone

Blame SOURCES/glibc-rh1228114-1.patch

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