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 master updated. glibc-2.20-174-gbef8fd6


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, master has been updated
       via  bef8fd6013f7d398661077340753c745a8939279 (commit)
      from  c52ff39e8ee052e4a57676d65a27f09bd0a859ad (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

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

commit bef8fd6013f7d398661077340753c745a8939279
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Nov 12 22:33:41 2014 +0000

    Fix qsort_r namespace (bug 17571).
    
    qsort_r is defined in the same file as qsort, but is not an ISO C
    function, so should be a weak alias for __qsort_r.  The uses in
    getaddrinfo should also call __qsort_r, since getaddrinfo is a POSIX
    function and qsort_r isn't.  This patch implements this.  Because nscd
    uses the getaddrinfo sources outside libc, as do the tst-rfc3484
    tests, a #define of __qsort_r to qsort_r is added there alongside the
    similar defines for other libc-internal symbols used in getaddrinfo.
    
    Tested for x86_64 (testsuite, and that disassembly of installed shared
    libraries is unchanged by the patch).
    
    	[BZ #17571]
    	* stdlib/msort.c (qsort_r): Rename to __qsort_r and define as weak
    	alias of __qsort_r.
    	(qsort): Call __qsort_r instead of qsort_r.
    	* include/stdlib.h (qsort_r): Do not call libc_hidden_proto.
    	(__qsort_r): Declare.  Call libc_hidden_proto.
    	* sysdeps/posix/getaddrinfo.c (getaddrinfo): Call __qsort_r
    	instead of qsort_r.
    	* nscd/gai.c (__qsort_r): Define to qsort_r.
    	* posix/tst-rfc3484.c (__qsort_r): Likewise.
    	* posix/tst-rfc3484-2.c (__qsort_r): Likewise.
    	* posix/tst-rfc3484-3.c (__qsort_r): Likewise.

diff --git a/ChangeLog b/ChangeLog
index b7ec0f1..236779e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2014-11-12  Joseph Myers  <joseph@codesourcery.com>
 
+	[BZ #17571]
+	* stdlib/msort.c (qsort_r): Rename to __qsort_r and define as weak
+	alias of __qsort_r.
+	(qsort): Call __qsort_r instead of qsort_r.
+	* include/stdlib.h (qsort_r): Do not call libc_hidden_proto.
+	(__qsort_r): Declare.  Call libc_hidden_proto.
+	* sysdeps/posix/getaddrinfo.c (getaddrinfo): Call __qsort_r
+	instead of qsort_r.
+	* nscd/gai.c (__qsort_r): Define to qsort_r.
+	* posix/tst-rfc3484.c (__qsort_r): Likewise.
+	* posix/tst-rfc3484-2.c (__qsort_r): Likewise.
+	* posix/tst-rfc3484-3.c (__qsort_r): Likewise.
+
 	[BZ #17570]
 	* malloc/malloc.c (malloc_info): Rename to __malloc_info and
 	define as weak alias of __malloc_info.
diff --git a/NEWS b/NEWS
index 5017517..5f3d4b4 100644
--- a/NEWS
+++ b/NEWS
@@ -11,7 +11,7 @@ Version 2.21
 
   6652, 12926, 14132, 14138, 14171, 15215, 15884, 17266, 17344, 17363,
   17370, 17371, 17411, 17460, 17475, 17485, 17501, 17506, 17508, 17522,
-  17555, 17570, 17583, 17584.
+  17555, 17570, 17571, 17583, 17584.
 
 * New locales: tu_IN, bh_IN.
 
diff --git a/include/stdlib.h b/include/stdlib.h
index 8d8c753..b8efbd7 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -37,7 +37,8 @@ extern __typeof (secure_getenv) __libc_secure_getenv;
 libc_hidden_proto (__libc_secure_getenv)
 libc_hidden_proto (bsearch)
 libc_hidden_proto (qsort)
-libc_hidden_proto (qsort_r)
+extern __typeof (qsort_r) __qsort_r;
+libc_hidden_proto (__qsort_r)
 libc_hidden_proto (lrand48_r)
 libc_hidden_proto (wctomb)
 
diff --git a/nscd/gai.c b/nscd/gai.c
index 95373e4..c159c0b 100644
--- a/nscd/gai.c
+++ b/nscd/gai.c
@@ -28,6 +28,7 @@
 #define __sendto sendto
 #define __strchrnul strchrnul
 #define __getline getline
+#define __qsort_r qsort_r
 /* nscd uses 1MB or 2MB thread stacks.  */
 #define __libc_use_alloca(size) (size <= __MAX_ALLOCA_CUTOFF)
 
diff --git a/posix/tst-rfc3484-2.c b/posix/tst-rfc3484-2.c
index fcf8a8c..ee92813 100644
--- a/posix/tst-rfc3484-2.c
+++ b/posix/tst-rfc3484-2.c
@@ -10,6 +10,7 @@
 #define __inet_aton inet_aton
 #define __gethostbyaddr_r gethostbyaddr_r
 #define __gethostbyname2_r gethostbyname2_r
+#define __qsort_r qsort_r
 
 void
 attribute_hidden
diff --git a/posix/tst-rfc3484-3.c b/posix/tst-rfc3484-3.c
index 86d59be..c987366 100644
--- a/posix/tst-rfc3484-3.c
+++ b/posix/tst-rfc3484-3.c
@@ -10,6 +10,7 @@
 #define __inet_aton inet_aton
 #define __gethostbyaddr_r gethostbyaddr_r
 #define __gethostbyname2_r gethostbyname2_r
+#define __qsort_r qsort_r
 
 void
 attribute_hidden
diff --git a/posix/tst-rfc3484.c b/posix/tst-rfc3484.c
index 2726fa0..73c4dff 100644
--- a/posix/tst-rfc3484.c
+++ b/posix/tst-rfc3484.c
@@ -10,6 +10,7 @@
 #define __inet_aton inet_aton
 #define __gethostbyaddr_r gethostbyaddr_r
 #define __gethostbyname2_r gethostbyname2_r
+#define __qsort_r qsort_r
 
 void
 attribute_hidden
diff --git a/stdlib/msort.c b/stdlib/msort.c
index 02ef28b..5ac5df7 100644
--- a/stdlib/msort.c
+++ b/stdlib/msort.c
@@ -162,7 +162,7 @@ msort_with_tmp (const struct msort_param *p, void *b, size_t n)
 
 
 void
-qsort_r (void *b, size_t n, size_t s, __compar_d_fn_t cmp, void *arg)
+__qsort_r (void *b, size_t n, size_t s, __compar_d_fn_t cmp, void *arg)
 {
   size_t size = n * s;
   char *tmp = NULL;
@@ -298,12 +298,13 @@ qsort_r (void *b, size_t n, size_t s, __compar_d_fn_t cmp, void *arg)
     }
   free (tmp);
 }
-libc_hidden_def (qsort_r)
+libc_hidden_def (__qsort_r)
+weak_alias (__qsort_r, qsort_r)
 
 
 void
 qsort (void *b, size_t n, size_t s, __compar_fn_t cmp)
 {
-  return qsort_r (b, n, s, (__compar_d_fn_t) cmp, NULL);
+  return __qsort_r (b, n, s, (__compar_d_fn_t) cmp, NULL);
 }
 libc_hidden_def (qsort)
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 8f392b9..31bb7e6 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -2626,11 +2626,11 @@ getaddrinfo (const char *name, const char *service,
 	  __libc_lock_lock (lock);
 	  if (__libc_once_get (old_once) && gaiconf_reload_flag)
 	    gaiconf_reload ();
-	  qsort_r (order, nresults, sizeof (order[0]), rfc3484_sort, &src);
+	  __qsort_r (order, nresults, sizeof (order[0]), rfc3484_sort, &src);
 	  __libc_lock_unlock (lock);
 	}
       else
-	qsort_r (order, nresults, sizeof (order[0]), rfc3484_sort, &src);
+	__qsort_r (order, nresults, sizeof (order[0]), rfc3484_sort, &src);
 
       /* Queue the results up as they come out of sorting.  */
       q = p = results[order[0]].dest_addr;

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

Summary of changes:
 ChangeLog                   |   13 +++++++++++++
 NEWS                        |    2 +-
 include/stdlib.h            |    3 ++-
 nscd/gai.c                  |    1 +
 posix/tst-rfc3484-2.c       |    1 +
 posix/tst-rfc3484-3.c       |    1 +
 posix/tst-rfc3484.c         |    1 +
 stdlib/msort.c              |    7 ++++---
 sysdeps/posix/getaddrinfo.c |    4 ++--
 9 files changed, 26 insertions(+), 7 deletions(-)


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]