From 17c199ee92e4ca8a34a47c42924608a25a444eb2 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 17 Jun 2015 20:08:22 +0000 Subject: Fix gethostbyaddr in6addr_any, in6addr_loopback namespace (bug 18532). gethostbyaddr brings in references to in6addr_any and thereby in6addr_loopback, which aren't in all the standards containing gethostbyaddr (gethostbyaddr is in XPG4 and UNIX98, in6addr_any and in6addr_loopback are new in POSIX.1:2001). This patch fixes this by making those symbols into weak aliases (safe in this case, unlike for most data symbols, because these data symbols are const). Tested for x86_64 and x86 (testsuite, and comparison of disassembly of installed stripped shared libraries). Disassembly is unchanged for x86_64; for x86, I see some changes of stack offsets, but no other code generation changes or code size differences. [BZ #18532] * inet/in6_addr.c (in6addr_any): Rename to __in6addr_any and define as weak alias of __in6addr_any. Use libc_hidden_data_weak. (in6addr_loopback): Rename to __in6addr_loopback and define as weak alias of __in6addr_loopback. Use libc_hidden_data_weak. * include/netinet/in.h (__in6addr_loopback): Declare. Use libc_hidden_proto. (__in6addr_any): Likewise. * inet/gethstbyad_r.c (PREPROCESS): Use __in6addr_any instead of in6addr_any. * conform/Makefile (test-xfail-XPG4/netdb.h/linknamespace): Remove variable. (test-xfail-UNIX98/netdb.h/linknamespace): Likewise. --- include/netinet/in.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/netinet/in.h b/include/netinet/in.h index 6fb5c86..5e37746 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -5,7 +5,11 @@ #ifndef _ISOMAC libc_hidden_proto (bindresvport) libc_hidden_proto (in6addr_loopback) +extern __typeof (in6addr_loopback) __in6addr_loopback; +libc_hidden_proto (__in6addr_loopback) libc_hidden_proto (in6addr_any) +extern __typeof (in6addr_any) __in6addr_any; +libc_hidden_proto (__in6addr_any) #endif #endif -- cgit v1.1