glibc/sysdeps
Joseph Myers ea41469b7a Fix profil_counter namespace (bug 17725).
On ARM, where profil_counter is not static, it is brought in by
references to various standard functions, as noted in
<https://sourceware.org/ml/libc-alpha/2014-11/msg00890.html>, although
it is not a standard function itself.  I don't know if this also
causes test failures on SPARC, although I see no reason for it not to
do so.

This patch fixes this namespace issue.  profil_counter is renamed to
__profil_counter and made a weak alias on ARM and SPARC.  Because of
the uses in profil.c / sprofil.c it seems simplest to make the rename
globally, including on the other architectures for which
profil_counter was static and so the change is of no substance.  The
variant names profil_counter_* used in sprofil.c are also renamed to
start with __ so that undesired function names do not get exported in
static libc.

As I noted in bug 17726, profil_counter should probably be a compat
symbol on ARM and SPARC, so it wouldn't exist at all in static libc
even as a weak alias.  Since defining a compat symbol still requires
an internal name as a target of an alias, this patch still seems
reasonable as an intermediate step towards that goal: it wouldn't be
possible for the function simply to be static profil_counter on ARM
and SPARC with profil_counter also being the exported compat symbol
name, so profil.c / sprofil.c would still need to be prepared to call
the function under another name (here, __profil_counter).

Tested for x86_64 (testsuite, and that stripped installed shared
libraries are unchanged by the patch) and ARM (ABI and linknamespace
tests - this patch reduces the number of linknamespace failures I see
on ARM from 227 to 5, the residue being math.h failures for fe*
functions and for j0l/j1n/jnl/y0l/y1l/ynl aliases).

2014-12-17  Joseph Myers  <joseph@codesourcery.com>

	[BZ #17725]
	* sysdeps/generic/profil-counter.h (profil_counter): Rename to
	__profil_counter.
	* sysdeps/unix/sysv/linux/hppa/profil-counter.h (profil_counter):
	Likewise.
	* sysdeps/unix/sysv/linux/i386/profil-counter.h (profil_counter):
	Likewise.
	* sysdeps/unix/sysv/linux/ia64/profil-counter.h (profil_counter):
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/profil-counter.h
	(profil_counter): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/profil-counter.h
	(profil_counter): Likewise.
	* sysdeps/unix/sysv/linux/sh/profil-counter.h (profil_counter):
	Likewise.
	* sysdeps/unix/sysv/linux/tile/profil-counter.h (profil_counter):
	Likewise.
	* sysdeps/unix/sysv/linux/x86_64/profil-counter.h
	(profil_counter): Likewise.
	* sysdeps/unix/sysv/linux/arm/profil-counter.h (profil_counter):
	Likewise.
	[!__profil_counter] (profil_counter): Define as weak alias of
	__profil_counter.
	* sysdeps/unix/sysv/linux/sparc/sparc32/profil-counter.h
	(profil_counter): Rename to __profil_counter.
	[!__profil_counter] (profil_counter): Define as weak alias of
	__profil_counter.
	* sysdeps/unix/sysv/linux/sparc/sparc64/profil-counter.h
	(profil_counter): Rename to __profil_counter.
	[!__profil_counter] (profil_counter): Define as weak alias of
	__profil_counter.
	* sysdeps/posix/profil.c: Update comment referring to
	profil_counter.
	(__profil): Use __profil_counter instead of profil_counter.
	* sysdeps/posix/sprofil.c (profil_counter): Rename to
	__profil_counter.  Use __profil_counter_ushort and
	__profil_counter_uint in definitions.
	(__sprofil): Use __profil_counter_uint and __profil_counter_ushort
	instead of profil_counter_uint and profil_counter_ushort.
2014-12-17 18:10:37 +00:00
..
aarch64 [AArch64] Fix strchrnul clobbering v15 2014-12-10 09:54:09 +00:00
alpha Remove IS_IN_rtld 2014-11-24 11:41:48 +05:30
arm Remove NOT_IN_libc 2014-11-24 15:03:45 +05:30
generic Fix profil_counter namespace (bug 17725). 2014-12-17 18:10:37 +00:00
gnu Use PTR_MANGLE on libgcc unwinder function pointers. 2014-12-16 15:47:53 -08:00
hppa Don't use INTDEF/INTUSE with _dl_init (bug 14132). 2014-11-04 23:26:39 +00:00
i386 Fix strftime wcschr namespace (bug 17634). 2014-12-10 16:59:02 +00:00
ia64 Remove NOT_IN_libc 2014-11-24 15:03:45 +05:30
ieee754 powerpc: Fix lgammal_r overflow warnings 2014-12-11 07:17:11 -05:00
init_array
m68k Remove IS_IN_rtld 2014-11-24 11:41:48 +05:30
mach Fix resolver if_* namespace (bug 17717). 2014-12-16 18:18:49 +00:00
microblaze microblaze: 64b atomic operations are not supported. 2014-11-21 14:09:21 +01:00
mips * sysdeps/mips/dl-trampoline.c: Modify switch expression to have 2014-12-11 10:23:01 -08:00
nptl Revert "Use pragmas rather than makefiles for necessary options for unwind code." 2014-12-16 15:46:00 -08:00
posix Fix profil_counter namespace (bug 17725). 2014-12-17 18:10:37 +00:00
powerpc Fix strftime wcschr namespace (bug 17634). 2014-12-10 16:59:02 +00:00
pthread Move semaphore.h to sysdeps/pthread/. 2014-12-11 22:58:48 +00:00
s390 S/390: Get rid of assembler warning value truncated. 2014-12-11 17:02:24 +01:00
sh * Fix SH specific compiler warnings which are for integer-pointer 2014-12-12 08:07:35 +09:00
sparc Remove NOT_IN_libc 2014-11-24 15:03:45 +05:30
tile tile: add inhibit_loop_to_libcall to string functions 2014-12-11 15:13:48 -05:00
unix Fix profil_counter namespace (bug 17725). 2014-12-17 18:10:37 +00:00
wordsize-32 Remove NOT_IN_libc 2014-11-24 15:03:45 +05:30
wordsize-64
x86 Recognize recent x86 CPUs in string.h 2014-11-27 17:21:12 +01:00
x86_64 Fix x86_64 memrchr namespace (bug 17719). 2014-12-16 18:31:31 +00:00