This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch hjl/pr17711 created. glibc-2.20-413-g80302c1


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/pr17711 has been created
        at  80302c1b6ff50ae7a73da5b9aece6ed65103fe46 (commit)

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=80302c1b6ff50ae7a73da5b9aece6ed65103fe46

commit 80302c1b6ff50ae7a73da5b9aece6ed65103fe46
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Dec 20 12:23:54 2014 -0800

    Add hidden __tls_get_addr/___tls_get_addr alias
    
    __tls_get_addr/___tls_get_addr is always defined in ld.so.  There is
    no need to call them via PLT inside ld.so.  This patch adds the hidden
    __tls_get_addr/___tls_get_addr aliases and calls them directly from
    _dl_tlsdesc_dynamic.  There is no need to set up the EBX register in
    i386 _dl_tlsdesc_dynamic when calling the hidden ___tls_get_addr.
    
    	* elf/dl-tls.c (__tls_get_addr): Provide the hidden definition
    	if not defined.
    	* sysdeps/i386/dl-tls.h (___tls_get_addr): Provide the hidden
    	definition.
    	* sysdeps/i386/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Call the
    	hidden ___tls_get_addr.
    	* sysdeps/x86_64/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Call the
    	hidden __tls_get_addr.
    	* sysdeps/generic/localplt.data (__tls_get_addr): Removed.
    	* sysdeps/unix/sysv/linux/i386/localplt.data (___tls_get_addr):
    	Likewise.

diff --git a/ChangeLog b/ChangeLog
index a1ccca1..4efe7e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2014-12-21  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* elf/dl-tls.c (__tls_get_addr): Provide the hidden definition
+	if not defined.
+	* sysdeps/i386/dl-tls.h (___tls_get_addr): Provide the hidden
+	definition.
+	* sysdeps/i386/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Call the
+	hidden ___tls_get_addr.
+	* sysdeps/x86_64/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Call the
+	hidden __tls_get_addr.
+	* sysdeps/generic/localplt.data (__tls_get_addr): Removed.
+	* sysdeps/unix/sysv/linux/i386/localplt.data (___tls_get_addr):
+	Likewise.
+
+2014-12-21  H.J. Lu  <hongjiu.lu@intel.com>
+
 	* sysdeps/i386/dl-machine.h (_dl_start_user): Remove @PLT
 	from "call _dl_init@PLT".
 	* sysdeps/x86_64/dl-machine.h (_dl_start_user): Likewise.
diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 76b8b36..cff213f 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -809,6 +809,11 @@ update_get_addr (GET_ADDR_ARGS)
   return (void *) p + GET_ADDR_OFFSET;
 }
 
+#ifndef __tls_get_addr
+extern void * __tls_get_addr (GET_ADDR_ARGS);
+rtld_hidden_proto (__tls_get_addr)
+rtld_hidden_def (__tls_get_addr)
+#endif
 
 /* The generic dynamic and local dynamic model cannot be used in
    statically linked applications.  */
diff --git a/sysdeps/generic/localplt.data b/sysdeps/generic/localplt.data
index d7d6734..1a40cf9 100644
--- a/sysdeps/generic/localplt.data
+++ b/sysdeps/generic/localplt.data
@@ -7,10 +7,9 @@ libc.so: malloc
 libc.so: memalign
 libc.so: realloc
 libm.so: matherr
-# The dynamic loader needs __tls_get_addr for TLS, and uses __libc_memalign
-# internally to allocate aligned TLS storage. The other malloc family of
-# functions are expected to allow user symbol interposition.
-ld.so: __tls_get_addr
+# The dynamic loader uses __libc_memalign internally to allocate aligned
+# TLS storage. The other malloc family of functions are expected to allow
+# user symbol interposition.
 ld.so: __libc_memalign
 ld.so: malloc
 ld.so: calloc
diff --git a/sysdeps/i386/dl-tls.h b/sysdeps/i386/dl-tls.h
index 48809a5..99b86f9 100644
--- a/sysdeps/i386/dl-tls.h
+++ b/sysdeps/i386/dl-tls.h
@@ -50,6 +50,8 @@ __tls_get_addr (tls_index *ti)
    version of this file.  */
 # define __tls_get_addr __attribute__ ((__regparm__ (1))) ___tls_get_addr
 strong_alias (___tls_get_addr, ___tls_get_addr_internal)
+rtld_hidden_proto (___tls_get_addr)
+rtld_hidden_def (___tls_get_addr)
 #else
 
 /* Users should get the better interface.  */
diff --git a/sysdeps/i386/dl-tlsdesc.S b/sysdeps/i386/dl-tlsdesc.S
index e6753e9..570b180 100644
--- a/sysdeps/i386/dl-tlsdesc.S
+++ b/sysdeps/i386/dl-tlsdesc.S
@@ -126,10 +126,7 @@ _dl_tlsdesc_dynamic:
 	.p2align 4,,7
 .Lslow:
 	cfi_adjust_cfa_offset (28)
-	movl	%ebx, 16(%esp)
-	LOAD_PIC_REG (bx)
-	call	___tls_get_addr@PLT
-	movl	16(%esp), %ebx
+	call	HIDDEN_JUMPTARGET (___tls_get_addr)
 	jmp	.Lret
 	cfi_endproc
 	.size	_dl_tlsdesc_dynamic, .-_dl_tlsdesc_dynamic
diff --git a/sysdeps/unix/sysv/linux/i386/localplt.data b/sysdeps/unix/sysv/linux/i386/localplt.data
index 009797b..b25abf8 100644
--- a/sysdeps/unix/sysv/linux/i386/localplt.data
+++ b/sysdeps/unix/sysv/linux/i386/localplt.data
@@ -5,12 +5,9 @@ libc.so: malloc
 libc.so: memalign
 libc.so: realloc
 libm.so: matherr
-# The dynamic loader needs ___tls_get_addr for TLS, and uses __libc_memalign
-# internally to allocate aligned TLS storage. The other malloc family of
-# functions are expected to allow user symbol interposition.
-# Note that it is triple underscore for ___tls_get_addr e.g. the alternate
-# ABI.
-ld.so: ___tls_get_addr
+# The dynamic loader uses __libc_memalign internally to allocate aligned
+# TLS storage. The other malloc family of functions are expected to allow
+# user symbol interposition.
 ld.so: __libc_memalign
 ld.so: malloc
 ld.so: calloc
diff --git a/sysdeps/x86_64/dl-tlsdesc.S b/sysdeps/x86_64/dl-tlsdesc.S
index 92e18a5..03f5ca4 100644
--- a/sysdeps/x86_64/dl-tlsdesc.S
+++ b/sysdeps/x86_64/dl-tlsdesc.S
@@ -128,7 +128,7 @@ _dl_tlsdesc_dynamic:
 	movq	%r10, 40(%rsp)
 	movq	%r11, 48(%rsp)
 	/* %rdi already points to the tlsinfo data structure.  */
-	call	__tls_get_addr@PLT
+	call	HIDDEN_JUMPTARGET (__tls_get_addr)
 	movq	8(%rsp), %rdx
 	movq	16(%rsp), %rcx
 	movq	24(%rsp), %r8

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7a64968f36ee91f1bcb53c8aa41d7dd4fd9a7498

commit 7a64968f36ee91f1bcb53c8aa41d7dd4fd9a7498
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Dec 19 14:05:35 2014 -0800

    Replace %ld with %jd and cast to intmax_t

diff --git a/ChangeLog b/ChangeLog
index 8c8b225..a1ccca1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -68,6 +68,7 @@
 	* sysdeps/pthread/tst-timer.c (main): Likewise.
 	* time/clocktest.c (main): Likewise.
 	* time/tst-posixtz.c (do_test): Likewise.
+	* timezone/tst-timezone.c (main): Likewise.
 
 2014-12-19  H.J. Lu  <hongjiu.lu@intel.com>
 
diff --git a/timezone/tst-timezone.c b/timezone/tst-timezone.c
index b5edfff..135a72f 100644
--- a/timezone/tst-timezone.c
+++ b/timezone/tst-timezone.c
@@ -126,8 +126,8 @@ main (int argc, char ** argv)
     strcpy (envstring, "TZ=Europe/London");
     putenv (envstring);
     t = mktime (&tmBuf);
-    snprintf (buf, sizeof (buf), "TZ=%s %ld %d %d %d %d %d %d %d %d %d",
-	      getenv ("TZ"), t,
+    snprintf (buf, sizeof (buf), "TZ=%s %jd %d %d %d %d %d %d %d %d %d",
+	      getenv ("TZ"), (intmax_t) t,
 	      tmBuf.tm_sec, tmBuf.tm_min, tmBuf.tm_hour,
 	      tmBuf.tm_mday, tmBuf.tm_mon, tmBuf.tm_year,
 	      tmBuf.tm_wday, tmBuf.tm_yday, tmBuf.tm_isdst);
@@ -149,8 +149,8 @@ main (int argc, char ** argv)
     strcpy (envstring, "TZ=GMT");
     /* No putenv call needed!  */
     t = mktime (&tmBuf);
-    snprintf (buf, sizeof (buf), "TZ=%s %ld %d %d %d %d %d %d %d %d %d",
-	      getenv ("TZ"), t,
+    snprintf (buf, sizeof (buf), "TZ=%s %jd %d %d %d %d %d %d %d %d %d",
+	      getenv ("TZ"), (intmax_t) t,
 	      tmBuf.tm_sec, tmBuf.tm_min, tmBuf.tm_hour,
 	      tmBuf.tm_mday, tmBuf.tm_mon, tmBuf.tm_year,
 	      tmBuf.tm_wday, tmBuf.tm_yday, tmBuf.tm_isdst);

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=cbf5ab5edb418bc5d01eb7ca3dc29bb9f6dca4f9

commit cbf5ab5edb418bc5d01eb7ca3dc29bb9f6dca4f9
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Dec 19 14:04:35 2014 -0800

    Replace %ld with %jd and cast to intmax_t

diff --git a/ChangeLog b/ChangeLog
index bb3c7fa..8c8b225 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -66,6 +66,8 @@
 	* stdio-common/tst-fmemopen2.c (do_test): Replace %ld with %jd
 	and cast to intmax_t.
 	* sysdeps/pthread/tst-timer.c (main): Likewise.
+	* time/clocktest.c (main): Likewise.
+	* time/tst-posixtz.c (do_test): Likewise.
 
 2014-12-19  H.J. Lu  <hongjiu.lu@intel.com>
 
diff --git a/time/clocktest.c b/time/clocktest.c
index f2b3ea7..2e6457d 100644
--- a/time/clocktest.c
+++ b/time/clocktest.c
@@ -28,8 +28,8 @@ main (int argc, char ** argv)
   while (!gotit);
   stop = clock ();
 
-  printf ("%ld clock ticks per second (start=%ld,stop=%ld)\n",
-	  stop - start, start, stop);
+  printf ("%jd clock ticks per second (start=%jd,stop=%jd)\n",
+	  (intmax_t) (stop - start), (intmax_t) start, (intmax_t) stop);
   printf ("CLOCKS_PER_SEC=%ld, sysconf(_SC_CLK_TCK)=%ld\n",
 	  CLOCKS_PER_SEC, sysconf(_SC_CLK_TCK));
   return 0;
diff --git a/time/tst-posixtz.c b/time/tst-posixtz.c
index c1ea267..16aa19d 100644
--- a/time/tst-posixtz.c
+++ b/time/tst-posixtz.c
@@ -39,7 +39,8 @@ do_test (void)
       char buf[100];
       struct tm *tmp;
 
-      printf ("TZ = \"%s\", time = %ld => ", tests[cnt].tz, tests[cnt].when);
+      printf ("TZ = \"%s\", time = %jd => ", tests[cnt].tz,
+	      (intmax_t) tests[cnt].when);
       fflush (stdout);
 
       setenv ("TZ", tests[cnt].tz, 1);

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5ef1abb9d07c34d225388d36a9427da640257ee4

commit 5ef1abb9d07c34d225388d36a9427da640257ee4
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Dec 19 14:02:58 2014 -0800

    Replace %ld with %jd and cast to intmax_t

diff --git a/ChangeLog b/ChangeLog
index 9fc7def..bb3c7fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -65,6 +65,7 @@
 	(do_test): Likewise.
 	* stdio-common/tst-fmemopen2.c (do_test): Replace %ld with %jd
 	and cast to intmax_t.
+	* sysdeps/pthread/tst-timer.c (main): Likewise.
 
 2014-12-19  H.J. Lu  <hongjiu.lu@intel.com>
 
diff --git a/sysdeps/pthread/tst-timer.c b/sysdeps/pthread/tst-timer.c
index 16adf3c..f310f6e 100644
--- a/sysdeps/pthread/tst-timer.c
+++ b/sysdeps/pthread/tst-timer.c
@@ -90,13 +90,13 @@ main (void)
 
   setvbuf (stdout, 0, _IOLBF, 0);
 
-  printf ("clock_gettime returned %d, timespec = { %ld, %ld }\n",
-	  retval, ts.tv_sec, ts.tv_nsec);
+  printf ("clock_gettime returned %d, timespec = { %jd, %jd }\n",
+	  retval, (intmax_t) ts.tv_sec, (intmax_t) ts.tv_nsec);
 
   retval = clock_getres (CLOCK_REALTIME, &ts);
 
-  printf ("clock_getres returned %d, timespec = { %ld, %ld }\n",
-	  retval, ts.tv_sec, ts.tv_nsec);
+  printf ("clock_getres returned %d, timespec = { %jd, %jd }\n",
+	  retval, (intmax_t) ts.tv_sec, (intmax_t) ts.tv_nsec);
 
   if (timer_create (CLOCK_REALTIME, &sigev1, &timer_sig) != 0)
     {

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=346641e40ce9cfd5d1e216cf50221b976039d7be

commit 346641e40ce9cfd5d1e216cf50221b976039d7be
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Dec 19 14:01:40 2014 -0800

    Replace %ld with %jd and cast to intmax_t

diff --git a/ChangeLog b/ChangeLog
index 027b9cb..9fc7def 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -63,6 +63,8 @@
 	* rt/tst-timer4.c: Include <stdint.h>.
 	(check_ts): Replace %ld with %jd and cast to intmax_t.
 	(do_test): Likewise.
+	* stdio-common/tst-fmemopen2.c (do_test): Replace %ld with %jd
+	and cast to intmax_t.
 
 2014-12-19  H.J. Lu  <hongjiu.lu@intel.com>
 
diff --git a/stdio-common/tst-fmemopen2.c b/stdio-common/tst-fmemopen2.c
index c2a4baa..e9d8b63 100644
--- a/stdio-common/tst-fmemopen2.c
+++ b/stdio-common/tst-fmemopen2.c
@@ -21,14 +21,15 @@ do_test (void)
   off_t o = ftello (fp);
   if (o != nstr)
     {
-      printf ("first ftello returned %ld, expected %zu\n", o, nstr);
+      printf ("first ftello returned %jd, expected %zu\n",
+	      (intmax_t) o, nstr);
       result = 1;
     }
   rewind (fp);
   o = ftello (fp);
   if (o != 0)
     {
-      printf ("second ftello returned %ld, expected 0\n", o);
+      printf ("second ftello returned %jd, expected 0\n", (intmax_t) o);
       result = 1;
     }
   if (fseeko (fp, 0, SEEK_END) != 0)
@@ -39,7 +40,8 @@ do_test (void)
   o = ftello (fp);
   if (o != nstr)
     {
-      printf ("third ftello returned %ld, expected %zu\n", o, nstr);
+      printf ("third ftello returned %jd, expected %zu\n",
+	      (intmax_t) o, nstr);
       result = 1;
     }
   rewind (fp);
@@ -50,7 +52,8 @@ do_test (void)
   o = ftello (fp);
   if (o != nstr2)
     {
-      printf ("fourth ftello returned %ld, expected %zu\n", o, nstr2);
+      printf ("fourth ftello returned %jd, expected %zu\n",
+	      (intmax_t) o, nstr2);
       result = 1;
     }
   fclose (fp);

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1316921bc5615d8c7062dd5c0bfe554225274e09

commit 1316921bc5615d8c7062dd5c0bfe554225274e09
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Dec 19 14:00:59 2014 -0800

    Replace %ld/%lu with %jd/%ju and cast to intmax_t/uintmax_t

diff --git a/ChangeLog b/ChangeLog
index 57fd89e..027b9cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -49,6 +49,20 @@
 	(do_test): Replace %ld with %jd and cast to intmax_t.
 	* posix/tst-regex.c (run_test): Likewise.
 	(run_test_backwards): Likewise.
+	* rt/tst-clock.c: Include <stdint.h>.
+	(clock_test): Replace %ld with %jd and cast to intmax_t.
+	* rt/tst-cpuclock1.c: Include <stdint.h>.
+	(do_test): Replace %lu with %ju and cast to uintmax_t.
+	* rt/tst-cpuclock2.c: Include <stdint.h>.
+	(do_test): Replace %lu with %ju and cast to uintmax_t.
+	* rt/tst-mqueue1.c: Include <stdint.h>.
+	(check_attrs): Replace %ld with %jd and cast to intmax_t.
+	* rt/tst-mqueue3.c (fct): Replace %ld with %jd and cast to
+	intmax_t.
+	* rt/tst-mqueue4.c (do_test): Likewise.
+	* rt/tst-timer4.c: Include <stdint.h>.
+	(check_ts): Replace %ld with %jd and cast to intmax_t.
+	(do_test): Likewise.
 
 2014-12-19  H.J. Lu  <hongjiu.lu@intel.com>
 
diff --git a/rt/tst-clock.c b/rt/tst-clock.c
index f6133f5..1cfdcfe 100644
--- a/rt/tst-clock.c
+++ b/rt/tst-clock.c
@@ -20,6 +20,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <time.h>
+#include <stdint.h>
 
 
 /* We want to see output immediately.  */
@@ -51,8 +52,8 @@ clock_test (clockid_t cl)
 	  result = 1;
 	}
       else
-	printf ("clock %d: resolution = %ld.%09ld secs\n",
-		cl, ts.tv_sec, ts.tv_nsec);
+	printf ("clock %d: resolution = %jd.%09jd secs\n",
+		cl, (intmax_t) ts.tv_sec, (intmax_t) ts.tv_nsec);
     }
   else
     {
@@ -76,8 +77,8 @@ clock_test (clockid_t cl)
 	    }
 	  else
 	    {
-	      printf ("clock %d: time = %ld.%09ld secs\n",
-		      cl, ts.tv_sec, ts.tv_nsec);
+	      printf ("clock %d: time = %jd.%09jd secs\n",
+		      cl, (intmax_t) ts.tv_sec, (intmax_t) ts.tv_nsec);
 
 	      if (memcmp (&ts, &old_ts, sizeof ts) == 0)
 		{
diff --git a/rt/tst-cpuclock1.c b/rt/tst-cpuclock1.c
index f503bc2..ef140fd 100644
--- a/rt/tst-cpuclock1.c
+++ b/rt/tst-cpuclock1.c
@@ -24,6 +24,7 @@
 #include <string.h>
 #include <errno.h>
 #include <signal.h>
+#include <stdint.h>
 #include <sys/wait.h>
 
 /* This function is intended to rack up both user and system time.  */
@@ -119,8 +120,9 @@ do_test (void)
       result = 1;
       goto done;
     }
-  printf ("live PID %d clock %lx resolution %lu.%.9lu\n",
-	  child, (unsigned long int) child_clock, res.tv_sec, res.tv_nsec);
+  printf ("live PID %d clock %lx resolution %ju.%.9ju\n",
+	  child, (unsigned long int) child_clock,
+	  (uintmax_t) res.tv_sec, (uintmax_t) res.tv_nsec);
 
   struct timespec before, after;
   if (clock_gettime (child_clock, &before) < 0)
@@ -131,8 +133,8 @@ do_test (void)
       goto done;
     }
   /* Should be close to 0.0.  */
-  printf ("live PID %d before sleep => %lu.%.9lu\n",
-	  child, before.tv_sec, before.tv_nsec);
+  printf ("live PID %d before sleep => %ju.%.9ju\n",
+	  child, (uintmax_t) before.tv_sec, (uintmax_t) before.tv_nsec);
 
   struct timespec sleeptime = { .tv_nsec = 500000000 };
   if (nanosleep (&sleeptime, NULL) != 0)
@@ -150,8 +152,8 @@ do_test (void)
       goto done;
     }
   /* Should be close to 0.5.  */
-  printf ("live PID %d after sleep => %lu.%.9lu\n",
-	  child, after.tv_sec, after.tv_nsec);
+  printf ("live PID %d after sleep => %ju.%.9ju\n",
+	  child, (uintmax_t) after.tv_sec, (uintmax_t) after.tv_nsec);
 
   struct timespec diff = { .tv_sec = after.tv_sec - before.tv_sec,
 			   .tv_nsec = after.tv_nsec - before.tv_nsec };
@@ -164,8 +166,8 @@ do_test (void)
       || diff.tv_nsec > 600000000
       || diff.tv_nsec < 100000000)
     {
-      printf ("before - after %lu.%.9lu outside reasonable range\n",
-	      diff.tv_sec, diff.tv_nsec);
+      printf ("before - after %ju.%.9ju outside reasonable range\n",
+	      (uintmax_t) diff.tv_sec, (uintmax_t) diff.tv_nsec);
       result = 1;
     }
 
@@ -203,8 +205,8 @@ do_test (void)
 	      || d.tv_nsec < sleeptime.tv_nsec
 	      || d.tv_nsec > sleeptime.tv_nsec * 2)
 	    {
-	      printf ("nanosleep time %lu.%.9lu outside reasonable range\n",
-		      d.tv_sec, d.tv_nsec);
+	      printf ("nanosleep time %ju.%.9ju outside reasonable range\n",
+		      (uintmax_t) d.tv_sec, (uintmax_t) d.tv_nsec);
 	      result = 1;
 	    }
 	}
@@ -236,8 +238,8 @@ do_test (void)
       goto done;
     }
   /* Should be close to 0.6.  */
-  printf ("dead PID %d => %lu.%.9lu\n",
-	  child, dead.tv_sec, dead.tv_nsec);
+  printf ("dead PID %d => %ju.%.9ju\n",
+	  child, (uintmax_t) dead.tv_sec, (uintmax_t) dead.tv_nsec);
 
   diff.tv_sec = dead.tv_sec - after.tv_sec;
   diff.tv_nsec = dead.tv_nsec - after.tv_nsec;
@@ -248,8 +250,8 @@ do_test (void)
     }
   if (diff.tv_sec != 0 || diff.tv_nsec > 200000000)
     {
-      printf ("dead - after %lu.%.9lu outside reasonable range\n",
-	      diff.tv_sec, diff.tv_nsec);
+      printf ("dead - after %ju.%.9ju outside reasonable range\n",
+	      (uintmax_t) diff.tv_sec, (uintmax_t) diff.tv_nsec);
       result = 1;
     }
 
@@ -265,9 +267,9 @@ do_test (void)
 
   if (clock_gettime (child_clock, &dead) == 0)
     {
-      printf ("clock_gettime on reaped PID %d clock %lx => %lu%.9lu\n",
+      printf ("clock_gettime on reaped PID %d clock %lx => %ju%.9ju\n",
 	      child, (unsigned long int) child_clock,
-	      dead.tv_sec, dead.tv_nsec);
+	      (uintmax_t) dead.tv_sec, (uintmax_t) dead.tv_nsec);
       result = 1;
     }
   else
@@ -280,9 +282,9 @@ do_test (void)
 
   if (clock_getres (child_clock, &dead) == 0)
     {
-      printf ("clock_getres on reaped PID %d clock %lx => %lu%.9lu\n",
+      printf ("clock_getres on reaped PID %d clock %lx => %ju%.9ju\n",
 	      child, (unsigned long int) child_clock,
-	      dead.tv_sec, dead.tv_nsec);
+	      (uintmax_t) dead.tv_sec, (uintmax_t) dead.tv_nsec);
       result = 1;
     }
   else
diff --git a/rt/tst-cpuclock2.c b/rt/tst-cpuclock2.c
index 8a447e1..caaa94f 100644
--- a/rt/tst-cpuclock2.c
+++ b/rt/tst-cpuclock2.c
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <unistd.h>
+#include <stdint.h>
 
 #if (_POSIX_THREADS - 0) <= 0
 
@@ -221,8 +222,9 @@ do_test (void)
       result = 1;
       return 1;
     }
-  printf ("live thread clock %lx resolution %lu.%.9lu\n",
-	  (unsigned long int) th_clock, res.tv_sec, res.tv_nsec);
+  printf ("live thread clock %lx resolution %ju.%.9ju\n",
+	  (unsigned long int) th_clock,
+	  (uintmax_t) res.tv_sec, (uintmax_t) res.tv_nsec);
 
   struct timespec process_before, process_after;
   if (clock_gettime (process_clock, &process_before) < 0)
@@ -239,8 +241,8 @@ do_test (void)
 	      (unsigned long int) th_clock, strerror (errno));
       return 1;
     }
-  printf ("live thread before sleep => %lu.%.9lu\n",
-	  before.tv_sec, before.tv_nsec);
+  printf ("live thread before sleep => %ju.%.9ju\n",
+	  (uintmax_t) before.tv_sec, (uintmax_t) before.tv_nsec);
 
   struct timespec me_before, me_after;
   if (clock_gettime (my_thread_clock, &me_before) < 0)
@@ -249,8 +251,8 @@ do_test (void)
 	      (unsigned long int) my_thread_clock, strerror (errno));
       return 1;
     }
-  printf ("self thread before sleep => %lu.%.9lu\n",
-	  me_before.tv_sec, me_before.tv_nsec);
+  printf ("self thread before sleep => %ju.%.9ju\n",
+	  (uintmax_t) me_before.tv_sec, (uintmax_t) me_before.tv_nsec);
 
   struct timespec sleeptime = { .tv_nsec = 500000000 };
   if (nanosleep (&sleeptime, NULL) != 0)
@@ -265,8 +267,8 @@ do_test (void)
 	      (unsigned long int) th_clock, strerror (errno));
       return 1;
     }
-  printf ("live thread after sleep => %lu.%.9lu\n",
-	  after.tv_sec, after.tv_nsec);
+  printf ("live thread after sleep => %ju.%.9ju\n",
+	  (uintmax_t) after.tv_sec, (uintmax_t) after.tv_nsec);
 
   if (clock_gettime (process_clock, &process_after) < 0)
     {
@@ -281,8 +283,8 @@ do_test (void)
 	      (unsigned long int) my_thread_clock, strerror (errno));
       return 1;
     }
-  printf ("self thread after sleep => %lu.%.9lu\n",
-	  me_after.tv_sec, me_after.tv_nsec);
+  printf ("self thread after sleep => %ju.%.9ju\n",
+	  (uintmax_t) me_after.tv_sec, (uintmax_t) me_after.tv_nsec);
 
   unsigned long long int th_diff = tsdiff (&before, &after);
   unsigned long long int pdiff = tsdiff (&process_before, &process_after);
diff --git a/rt/tst-mqueue1.c b/rt/tst-mqueue1.c
index c242c37..e310fb3 100644
--- a/rt/tst-mqueue1.c
+++ b/rt/tst-mqueue1.c
@@ -26,6 +26,7 @@
 #include <sys/wait.h>
 #include <time.h>
 #include <unistd.h>
+#include <stdint.h>
 #include "tst-mqueue.h"
 
 static int
@@ -46,20 +47,21 @@ check_attrs (struct mq_attr *attr, int nonblock, long cnt)
   if (attr->mq_maxmsg != 10 || attr->mq_msgsize != 1)
     {
       printf ("attributes don't match those passed to mq_open\n"
-	      "mq_maxmsg %ld, mq_msgsize %ld\n",
-	      attr->mq_maxmsg, attr->mq_msgsize);
+	      "mq_maxmsg %jd, mq_msgsize %jd\n",
+	      (intmax_t) attr->mq_maxmsg, (intmax_t) attr->mq_msgsize);
       result = 1;
     }
 
   if ((attr->mq_flags & O_NONBLOCK) != nonblock)
     {
-      printf ("mq_flags %lx != %x\n", (attr->mq_flags & O_NONBLOCK), nonblock);
+      printf ("mq_flags %jx != %x\n",
+	      (intmax_t) (attr->mq_flags & O_NONBLOCK), nonblock);
       result = 1;
     }
 
   if (attr->mq_curmsgs != cnt)
     {
-      printf ("mq_curmsgs %ld != %ld\n", attr->mq_curmsgs, cnt);
+      printf ("mq_curmsgs %jd != %ld\n", (intmax_t) attr->mq_curmsgs, cnt);
       result = 1;
     }
 
diff --git a/rt/tst-mqueue3.c b/rt/tst-mqueue3.c
index 4607e1b..c7270a1 100644
--- a/rt/tst-mqueue3.c
+++ b/rt/tst-mqueue3.c
@@ -61,14 +61,14 @@ fct (union sigval s)
   /* Check the values.  */
   if (attr.mq_maxmsg != MAXMSG)
     {
-      printf ("%s: mq_maxmsg wrong: is %ld, expecte %d\n",
-	      __FUNCTION__, attr.mq_maxmsg, MAXMSG);
+      printf ("%s: mq_maxmsg wrong: is %jd, expecte %d\n",
+	      __FUNCTION__, (intmax_t) attr.mq_maxmsg, MAXMSG);
       exit (1);
     }
   if (attr.mq_msgsize != MAXMSG)
     {
-      printf ("%s: mq_msgsize wrong: is %ld, expecte %d\n",
-	      __FUNCTION__, attr.mq_msgsize, MSGSIZE);
+      printf ("%s: mq_msgsize wrong: is %jd, expecte %d\n",
+	      __FUNCTION__, (intmax_t) attr.mq_msgsize, MSGSIZE);
       exit (1);
     }
 
diff --git a/rt/tst-mqueue4.c b/rt/tst-mqueue4.c
index 60603be..d6733c2 100644
--- a/rt/tst-mqueue4.c
+++ b/rt/tst-mqueue4.c
@@ -139,9 +139,10 @@ do_test (void)
       || attr.mq_msgsize != 2
       || attr.mq_curmsgs != 2)
     {
-      printf ("mq_getattr returned unexpected { .mq_flags = %ld,\n"
-	      ".mq_maxmsg = %ld, .mq_msgsize = %ld, .mq_curmsgs = %ld }\n",
-	      attr.mq_flags, attr.mq_maxmsg, attr.mq_msgsize, attr.mq_curmsgs);
+      printf ("mq_getattr returned unexpected { .mq_flags = %jd,\n"
+	      ".mq_maxmsg = %jd, .mq_msgsize = %jd, .mq_curmsgs = %jd }\n",
+	      (intmax_t) attr.mq_flags, (intmax_t) attr.mq_maxmsg,
+	      (intmax_t) attr.mq_msgsize, (intmax_t) attr.mq_curmsgs);
       result = 1;
     }
 
@@ -215,9 +216,10 @@ do_test (void)
       || attr.mq_msgsize != 2
       || attr.mq_curmsgs != 1)
     {
-      printf ("mq_getattr returned unexpected { .mq_flags = %ld,\n"
-	      ".mq_maxmsg = %ld, .mq_msgsize = %ld, .mq_curmsgs = %ld }\n",
-	      attr.mq_flags, attr.mq_maxmsg, attr.mq_msgsize, attr.mq_curmsgs);
+      printf ("mq_getattr returned unexpected { .mq_flags = %jd,\n"
+	      ".mq_maxmsg = %jd, .mq_msgsize = %jd, .mq_curmsgs = %jd }\n",
+	      (intmax_t) attr.mq_flags, (intmax_t) attr.mq_maxmsg,
+	      (intmax_t) attr.mq_msgsize, (intmax_t) attr.mq_curmsgs);
       result = 1;
     }
 
diff --git a/rt/tst-timer4.c b/rt/tst-timer4.c
index f64fadd..a397663 100644
--- a/rt/tst-timer4.c
+++ b/rt/tst-timer4.c
@@ -23,6 +23,7 @@
 #include <string.h>
 #include <time.h>
 #include <unistd.h>
+#include <stdint.h>
 #if _POSIX_THREADS
 # include <pthread.h>
 
@@ -168,9 +169,9 @@ check_ts (const char *name, const struct timespec *start,
       || (end->tv_sec == ts.tv_sec && end->tv_nsec < ts.tv_nsec))
     {
       printf ("\
-*** timer %s invoked too soon: %ld.%09ld instead of expected %ld.%09ld\n",
-	      name, (long) end->tv_sec, end->tv_nsec,
-	      (long) ts.tv_sec, ts.tv_nsec);
+*** timer %s invoked too soon: %ld.%09jd instead of expected %ld.%09jd\n",
+	      name, (long) end->tv_sec, (intmax_t) end->tv_nsec,
+	      (long) ts.tv_sec, (intmax_t) ts.tv_nsec);
       return 1;
     }
   else
@@ -200,8 +201,8 @@ do_test (void)
       result = 1;
     }
   else
-    printf ("clock_gettime returned timespec = { %ld, %ld }\n",
-	    (long) ts.tv_sec, ts.tv_nsec);
+    printf ("clock_gettime returned timespec = { %ld, %jd }\n",
+	    (long) ts.tv_sec, (intmax_t) ts.tv_nsec);
 
   if (clock_getres (TEST_CLOCK, &ts) != 0)
     {
@@ -209,8 +210,8 @@ do_test (void)
       result = 1;
     }
   else
-    printf ("clock_getres returned timespec = { %ld, %ld }\n",
-	    (long) ts.tv_sec, ts.tv_nsec);
+    printf ("clock_getres returned timespec = { %ld, %jd }\n",
+	    (long) ts.tv_sec, (intmax_t) ts.tv_nsec);
 
   struct sigevent ev;
   memset (&ev, 0x11, sizeof (ev));
@@ -488,9 +489,9 @@ do_test (void)
 	   || it.it_interval.tv_sec || it.it_interval.tv_nsec)
     {
       printf ("\
-*** timer_gettime timer_none returned { %ld.%09ld, %ld.%09ld }\n",
-	      (long) it.it_value.tv_sec, it.it_value.tv_nsec,
-	      (long) it.it_interval.tv_sec, it.it_interval.tv_nsec);
+*** timer_gettime timer_none returned { %ld.%09jd, %ld.%09jd }\n",
+	      (long) it.it_value.tv_sec, (intmax_t) it.it_value.tv_nsec,
+	      (long) it.it_interval.tv_sec, (intmax_t) it.it_interval.tv_nsec);
       result = 1;
     }
 
@@ -603,8 +604,8 @@ do_test (void)
   else if (it.it_interval.tv_sec || it.it_interval.tv_nsec != 100000000)
     {
       printf ("\
-!!! second timer_gettime timer_none returned it_interval %ld.%09ld\n",
-	      (long) it.it_interval.tv_sec, it.it_interval.tv_nsec);
+!!! second timer_gettime timer_none returned it_interval %ld.%09jd\n",
+	      (long) it.it_interval.tv_sec, (intmax_t) it.it_interval.tv_nsec);
       /* FIXME: For now disabled.
       result = 1; */
     }

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0459fba5178a1c8f0c32c90d13749f599107fbef

commit 0459fba5178a1c8f0c32c90d13749f599107fbef
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Dec 19 13:52:08 2014 -0800

    Replace %ld with %jd and cast to intmax_t

diff --git a/ChangeLog b/ChangeLog
index 5335ec9..57fd89e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -47,6 +47,8 @@
 	* libio/tst-ftell-active-handler.c (do_append_test): Likewise.
 	* nptl/tst-mutex5.c: Include <stdint.h>.
 	(do_test): Replace %ld with %jd and cast to intmax_t.
+	* posix/tst-regex.c (run_test): Likewise.
+	(run_test_backwards): Likewise.
 
 2014-12-19  H.J. Lu  <hongjiu.lu@intel.com>
 
diff --git a/posix/tst-regex.c b/posix/tst-regex.c
index 7df0bd1..0e086ab 100644
--- a/posix/tst-regex.c
+++ b/posix/tst-regex.c
@@ -274,8 +274,8 @@ run_test (const char *expr, const char *mem, size_t memlen, int icase,
 	      finish.tv_sec -= start.tv_sec;
 	    }
 
-	  printf ("elapsed time: %ld.%09ld sec\n",
-		  finish.tv_sec, finish.tv_nsec);
+	  printf ("elapsed time: %jd.%09jd sec\n",
+		  (intmax_t) finish.tv_sec, (intmax_t) finish.tv_nsec);
 	}
     }
 
@@ -327,8 +327,8 @@ run_test (const char *expr, const char *mem, size_t memlen, int icase,
 		mintime = finish;
 	    }
 	}
-      printf ("elapsed time: %ld.%09ld sec\n",
-	      mintime.tv_sec, mintime.tv_nsec);
+      printf ("elapsed time: %jd.%09jd sec\n",
+	      (intmax_t) mintime.tv_sec, (intmax_t) mintime.tv_nsec);
     }
 #endif
 
@@ -420,8 +420,8 @@ run_test_backwards (const char *expr, const char *mem, size_t memlen,
 	      finish.tv_sec -= start.tv_sec;
 	    }
 
-	  printf ("elapsed time: %ld.%09ld sec\n",
-		  finish.tv_sec, finish.tv_nsec);
+	  printf ("elapsed time: %jd.%09jd sec\n",
+		  (intmax_t) finish.tv_sec, (intmax_t) finish.tv_nsec);
 	}
     }
 
@@ -489,8 +489,8 @@ run_test_backwards (const char *expr, const char *mem, size_t memlen,
 		mintime = finish;
 	    }
 	}
-      printf ("elapsed time: %ld.%09ld sec\n",
-	      mintime.tv_sec, mintime.tv_nsec);
+      printf ("elapsed time: %jd.%09jd sec\n",
+	      (intmax_t) mintime.tv_sec, (intmax_t) mintime.tv_nsec);
     }
 #endif
 

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2f3fabcd73038d77a0574a9260cd3b7181d1ad19

commit 2f3fabcd73038d77a0574a9260cd3b7181d1ad19
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Dec 19 13:51:13 2014 -0800

    Replace %ld with %jd and cast to intmax_t

diff --git a/ChangeLog b/ChangeLog
index a588fc1..5335ec9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -45,6 +45,8 @@
 	* io/test-utime.c (main): Replace %ld with %jd and cast to
 	intmax_t.
 	* libio/tst-ftell-active-handler.c (do_append_test): Likewise.
+	* nptl/tst-mutex5.c: Include <stdint.h>.
+	(do_test): Replace %ld with %jd and cast to intmax_t.
 
 2014-12-19  H.J. Lu  <hongjiu.lu@intel.com>
 
diff --git a/nptl/tst-mutex5.c b/nptl/tst-mutex5.c
index 6988840..48e1ea8 100644
--- a/nptl/tst-mutex5.c
+++ b/nptl/tst-mutex5.c
@@ -22,6 +22,7 @@
 #include <time.h>
 #include <unistd.h>
 #include <sys/time.h>
+#include <stdint.h>
 #include <config.h>
 
 
@@ -132,8 +133,8 @@ do_test (void)
 
       if (tv2.tv_sec < 2)
 	{
-	  printf ("premature timeout: %ld.%06ld difference\n",
-		  tv2.tv_sec, tv2.tv_usec);
+	  printf ("premature timeout: %jd.%06jd difference\n",
+		  (intmax_t) tv2.tv_sec, (intmax_t) tv2.tv_usec);
 	  return 1;
 	}
     }

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c14dcb5c46f336cc1613ba1d29325544a692c239

commit c14dcb5c46f336cc1613ba1d29325544a692c239
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Dec 19 13:49:58 2014 -0800

    Replace %ld with %jd and cast to intmax_t

diff --git a/ChangeLog b/ChangeLog
index 5621189..a588fc1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -44,6 +44,7 @@
 	[BZ #17732]
 	* io/test-utime.c (main): Replace %ld with %jd and cast to
 	intmax_t.
+	* libio/tst-ftell-active-handler.c (do_append_test): Likewise.
 
 2014-12-19  H.J. Lu  <hongjiu.lu@intel.com>
 
diff --git a/libio/tst-ftell-active-handler.c b/libio/tst-ftell-active-handler.c
index 7be75bc..186aec6 100644
--- a/libio/tst-ftell-active-handler.c
+++ b/libio/tst-ftell-active-handler.c
@@ -574,23 +574,23 @@ do_append_test (const char *filename)
 
   if (seek_ret != new_seek_ret)
     {
-      printf ("incorrectly modified file offset to %ld, should be %ld",
-	      new_seek_ret, seek_ret);
+      printf ("incorrectly modified file offset to %jd, should be %jd",
+	      (intmax_t)  new_seek_ret, (intmax_t) seek_ret);
       ret |= 1;
     }
   else
-    printf ("retained current file offset %ld", seek_ret);
+    printf ("retained current file offset %jd", (intmax_t) seek_ret);
 
   new_seek_ret = ftello (fp);
 
   if (seek_ret != new_seek_ret)
     {
-      printf (", ftello reported incorrect offset %ld, should be %ld\n",
-	      new_seek_ret, seek_ret);
+      printf (", ftello reported incorrect offset %jd, should be %jd\n",
+	      (intmax_t) new_seek_ret, (intmax_t) seek_ret);
       ret |= 1;
     }
   else
-    printf (", ftello reported correct offset %ld\n", seek_ret);
+    printf (", ftello reported correct offset %jd\n", (intmax_t) seek_ret);
 
   fclose (fp);
 

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=71f83f0f6680805befea35feb032ea2643adb4b6

commit 71f83f0f6680805befea35feb032ea2643adb4b6
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Dec 19 13:48:40 2014 -0800

    Replace %ld with %jd and cast to intmax_t

diff --git a/ChangeLog b/ChangeLog
index de45fe4..5621189 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -41,6 +41,12 @@
 
 2014-12-19  H.J. Lu  <hongjiu.lu@intel.com>
 
+	[BZ #17732]
+	* io/test-utime.c (main): Replace %ld with %jd and cast to
+	intmax_t.
+
+2014-12-19  H.J. Lu  <hongjiu.lu@intel.com>
+
 	* sysdeps/x86_64/x32/Makefile (CFLAGS-s_llround.c): Replace
 	-Wno-error with -fno-builtin-lround.
 
diff --git a/io/test-utime.c b/io/test-utime.c
index 26a5464..afb8a29 100644
--- a/io/test-utime.c
+++ b/io/test-utime.c
@@ -109,25 +109,29 @@ main (int argc, char *argv[])
 
   if (st.st_mtime != ut.modtime)
     {
-      printf ("modtime %ld != %ld\n", st.st_mtime, ut.modtime);
+      printf ("modtime %jd != %jd\n",
+	      (intmax_t) st.st_mtime, (intmax_t) ut.modtime);
       return 1;
     }
 
   if (st.st_atime != ut.actime)
     {
-      printf ("actime %ld != %ld\n", st.st_atime, ut.actime);
+      printf ("actime %jd != %jd\n",
+	      (intmax_t) st.st_atime, (intmax_t) ut.actime);
       return 1;
     }
 
   if (stnow.st_mtime < now1 || stnow.st_mtime > now2)
     {
-      printf ("modtime %ld <%ld >%ld\n", stnow.st_mtime, now1, now2);
+      printf ("modtime %jd <%jd >%jd\n",
+	      (intmax_t) stnow.st_mtime, (intmax_t) now1, (intmax_t) now2);
       return 1;
     }
 
   if (stnow.st_atime < now1 || stnow.st_atime > now2)
     {
-      printf ("actime %ld <%ld >%ld\n", stnow.st_atime, now1, now2);
+      printf ("actime %jd <%jd >%jd\n",
+	      (intmax_t) stnow.st_atime, (intmax_t) now1, (intmax_t) now2);
       return 1;
     }
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]