glibc/sysdeps/tile/tilegx
Joseph Myers 1769608794 Use libc_hidden_proto / libc_hidden_def with __strnlen.
Various code in glibc uses __strnlen instead of strnlen for namespace
reasons.  However, __strnlen does not use libc_hidden_proto /
libc_hidden_def (as is normally done for any function defined and
called within the same library, whether or not exported from the
library and whatever namespace it is in), so the compiler does not
know that those calls are to a function within libc.

This patch uses libc_hidden_proto / libc_hidden_def with __strnlen.
On x86_64, it makes no difference to the installed stripped shared
libraries.  On 32-bit x86, it causes __strnlen calls to go to the same
place as strnlen calls (the fallback strnlen implementation), rather
than through a PLT entry for the strnlen IFUNC; I'm not sure of the
logic behind when calls from within libc should use IFUNCs versus when
they should go direct to a particular function implementation, but
clearly it doesn't make sense for strnlen and __strnlen to be handled
differently in this regard.

Tested for x86_64 and x86 (testsuite, and comparison of installed
shared libraries as described above).

	* string/strnlen.c [!STRNLEN] (__strnlen): Use libc_hidden_def.
	* include/string.h (__strnlen): Use libc_hidden_proto.
	* sysdeps/aarch64/strnlen.S (__strnlen): Use libc_hidden_def.
	* sysdeps/i386/i686/multiarch/strnlen-c.c [SHARED]
	(libc_hidden_def): Define __GI___strnlen as well as __GI_strnlen.
	* sysdeps/powerpc/powerpc32/power4/multiarch/strnlen-power7.S
	(libc_hidden_def): Undefine and redefine.
	* sysdeps/powerpc/powerpc32/power4/multiarch/strnlen-ppc32.c
	[SHARED] (libc_hidden_def): Define __GI___strnlen as well as
	__GI_strnlen.
	* sysdeps/powerpc/powerpc32/power7/strnlen.S (__strnlen): Use
	libc_hidden_def.
	* sysdeps/tile/tilegx/strnlen.c (__strnlen): Likewise.
2015-06-02 20:24:25 +00:00
..
bits tilegx32: set __HAVE_64B_ATOMICS to 0 2015-01-28 14:51:21 -05:00
tilegx32
tilegx64
Implies tilegx: enable wordsize-64 support for ieee745 dbl-64. 2014-12-23 14:04:35 -05:00
Makefile
memchr.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
memcpy.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
memset.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
memusage.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
rawmemchr.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
strcasestr.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
strchr.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
strchrnul.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
string-endian.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
strlen.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
strnlen.c Use libc_hidden_proto / libc_hidden_def with __strnlen. 2015-06-02 20:24:25 +00:00
strrchr.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
strstr.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00