1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00

Fix h_errno namespace (bug 18520).

The 2008 edition of POSIX removed h_errno, but some functions still
bring in references to the h_errno external symbol.  As this symbol is
not a part of the public ABI (only __h_errno_location is), this patch
fixes this by renaming the GLIBC_PRIVATE TLS symbol to __h_errno.

Tested for x86_64 and x86 (testsuite, and comparison of installed
shared libraries).  Disassembly of all shared libraries using h_errno
changes because of the renaming (and changes to associated TLS / GOT
offsets in some cases); disassembly of libpthread on x86_64 changes
more substantially because the enlargement of .dynsym affects
subsequent addresses.

	[BZ #18520]
	* inet/herrno.c (h_errno): Rename to __h_errno.
	(__libc_h_errno): Define as alias of __h_errno not h_errno.
	* include/netdb.h [IS_IN_LIB && !IS_IN (libc)] (h_errno): Define
	to __h_errno instead of h_errno.
	* nptl/herrno.c (h_errno): Rename to __h_errno.
	(__h_errno_location): Refer to __h_errno not h_errno.
	* resolv/Versions (h_errno): Rename to __h_errno.
	* conform/Makefile (test-xfail-XOPEN2K8/grp.h/linknamespace):
	Remove variable.
	(test-xfail-XOPEN2K8/pwd.h/linknamespace): Likewise.
This commit is contained in:
Joseph Myers
2015-06-12 10:10:18 +00:00
parent 4b9c2b707b
commit 9acacaa02f
7 changed files with 22 additions and 9 deletions

View File

@@ -9,7 +9,7 @@
# if IS_IN (libc)
# define h_errno __libc_h_errno
# else
# define h_errno h_errno /* For #ifndef h_errno tests. */
# define h_errno __h_errno
# endif
extern __thread int h_errno attribute_tls_model_ie;
# endif /* IS_IN_LIB */