From 4ffb1771554dd4661beb44be2036c598aa56c80a Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 18 Feb 2015 18:47:34 +0000 Subject: Fix search.h namespace (bug 17996). The implementation of the (XSI POSIX) functions hsearch / hcreate / hdestroy uses hsearch_r / hcreate_r / hdestroy_r, which are not POSIX functions. This patch makes those into weak aliases for __*_r and uses those names for the calls within libc. Tested for x86_64 that the disassembly of installed shared libraries is unchanged by this patch. [BZ #17996] * include/search.h (hcreate_r): Don't use libc_hidden_proto. (hdestroy_r): Likewise. (hsearch_r): Likewise. (__hcreate_r): Declare and use libc_hidden_proto. (__hdestroy_r): Likewise. (__hsearch_r): Likewise. * misc/hsearch.c (hsearch): Call __hsearch_r instead of hsearch_r. (hcreate): Call __hcreate_r instead of hcreate_r. (__hdestroy): Call __hdestroy_r instead of hdestroy_r. * misc/hsearch_r.c (hcreate_r): Rename to __hcreate_r and define as weak alias of __hcreate_r. (hdestroy_r): Rename to __hdestroy_r and define as weak alias of __hdestroy_r. (hsearch_r): Rename to __hsearch_r and define as weak alias of __hsearch_r. * conform/Makefile (test-xfail-XPG3/search.h/linknamespace): Remove variable. (test-xfail-XPG4/search.h/linknamespace): Likewise. (test-xfail-UNIX98/search.h/linknamespace): Likewise. (test-xfail-XOPEN2K/search.h/linknamespace): Likewise. (test-xfail-XOPEN2K8/search.h/linknamespace): Likewise. --- conform/Makefile | 5 ----- 1 file changed, 5 deletions(-) (limited to 'conform/Makefile') diff --git a/conform/Makefile b/conform/Makefile index c0c0db74a9..39f41bd7c5 100644 --- a/conform/Makefile +++ b/conform/Makefile @@ -348,7 +348,6 @@ test-xfail-XOPEN2K8/ndbm.h/linknamespace = yes test-xfail-XPG3/fnmatch.h/linknamespace = yes test-xfail-XPG3/glob.h/linknamespace = yes test-xfail-XPG3/regex.h/linknamespace = yes -test-xfail-XPG3/search.h/linknamespace = yes test-xfail-XPG3/stdio.h/linknamespace = yes test-xfail-XPG3/unistd.h/linknamespace = yes test-xfail-XPG3/wordexp.h/linknamespace = yes @@ -357,7 +356,6 @@ test-xfail-XPG4/fnmatch.h/linknamespace = yes test-xfail-XPG4/glob.h/linknamespace = yes test-xfail-XPG4/netdb.h/linknamespace = yes test-xfail-XPG4/regex.h/linknamespace = yes -test-xfail-XPG4/search.h/linknamespace = yes test-xfail-XPG4/stdio.h/linknamespace = yes test-xfail-XPG4/stdlib.h/linknamespace = yes test-xfail-XPG4/syslog.h/linknamespace = yes @@ -377,7 +375,6 @@ test-xfail-UNIX98/glob.h/linknamespace = yes test-xfail-UNIX98/mqueue.h/linknamespace = yes test-xfail-UNIX98/netdb.h/linknamespace = yes test-xfail-UNIX98/regex.h/linknamespace = yes -test-xfail-UNIX98/search.h/linknamespace = yes test-xfail-UNIX98/stdio.h/linknamespace = yes test-xfail-UNIX98/stdlib.h/linknamespace = yes test-xfail-UNIX98/syslog.h/linknamespace = yes @@ -389,7 +386,6 @@ test-xfail-XOPEN2K/fnmatch.h/linknamespace = yes test-xfail-XOPEN2K/glob.h/linknamespace = yes test-xfail-XOPEN2K/netdb.h/linknamespace = yes test-xfail-XOPEN2K/regex.h/linknamespace = yes -test-xfail-XOPEN2K/search.h/linknamespace = yes test-xfail-XOPEN2K/signal.h/linknamespace = yes test-xfail-XOPEN2K/stdlib.h/linknamespace = yes test-xfail-XOPEN2K/sys/wait.h/linknamespace = yes @@ -409,6 +405,5 @@ test-xfail-XOPEN2K8/grp.h/linknamespace = yes test-xfail-XOPEN2K8/netdb.h/linknamespace = yes test-xfail-XOPEN2K8/pwd.h/linknamespace = yes test-xfail-XOPEN2K8/regex.h/linknamespace = yes -test-xfail-XOPEN2K8/search.h/linknamespace = yes test-xfail-XOPEN2K8/syslog.h/linknamespace = yes test-xfail-XOPEN2K8/unistd.h/linknamespace = yes -- cgit 1.4.1