glibc/sysdeps/generic
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
..
bits Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
net Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
netinet Combine __USE_BSD and __USE_SVID into __USE_MISC. 2014-02-12 23:41:01 +00:00
nfs Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
sys Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
_G_config.h Remove _G_OPEN64, _G_LSEEK64, _G_MMAP64, _G_FSTAT64 from _G_config.h. 2012-10-18 18:50:43 +00:00
_itoa.h Remove NOT_IN_libc 2014-11-24 15:03:45 +05:30
a.out.h
abort-instr.h Use __builtin_trap for ABORT_INSTRUCTION. 2014-07-31 13:07:19 -07:00
aio_misc.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
allocalim.h Update. 2002-10-09 09:42:48 +00:00
asm-syntax.h
confstr.h
device-nrs.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
dirstream.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
dl-cache.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
dl-dtprocnum.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
dl-fptr.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
dl-hash.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
dl-irel.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
dl-librecon.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
dl-lookupcfg.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
dl-machine.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
dl-osinfo.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
dl-procinfo.c Dummy dl-procinfo.c file for platforms which don't have one. 2002-02-01 18:25:44 +00:00
dl-procinfo.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
dl-sysdep.h Remove IS_IN_rtld 2014-11-24 11:41:48 +05:30
dl-tls.h Update. 2002-02-07 04:08:19 +00:00
dwarf2.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
elide.h Add fallback file for elide.h 2014-06-14 09:27:09 -07:00
eloop-threshold.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
entry.h Update. 2002-03-15 03:16:52 +00:00
errqueue.h Update. 2001-01-10 23:47:39 +00:00
exit-thread.h Clean up __exit_thread. 2014-05-13 09:49:20 -07:00
fd_to_filename.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fips-private.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fork.h Update. 2002-10-01 00:05:23 +00:00
fpu_control.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
frame.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
framestate.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
gcc-compat.h ARM: Disable compat mcount code when unneeded. 2014-01-10 13:32:35 -08:00
gccframe.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
get-rounding-mode.h Add missing #include in get-rounding-mode.h 2014-06-23 14:07:59 -07:00
gmp-mparam.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
hp-timing-common.h Unify hp-timing implementations 2014-07-03 08:38:30 -07:00
hp-timing.h Always provide HP_SMALL_TIMING_AVAIL 2014-07-03 08:38:36 -07:00
ifreq.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
ifunc-sel.h Move sysdeps/generic/elf/* to sysdeps/generic 2012-03-19 21:04:21 +01:00
intr-msg.h
inttypes.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
ldconfig.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
ldsodefs.h Remove IS_IN_rtld 2014-11-24 11:41:48 +05:30
libc-mmap.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
libcidn.abilist Add missed zero length files in previous abilist commit. 2012-04-28 15:38:24 -04:00
libm-test-ulps
libnss_compat.abilist Add missed zero length files in previous abilist commit. 2012-04-28 15:38:24 -04:00
libnss_db.abilist Add missed zero length files in previous abilist commit. 2012-04-28 15:38:24 -04:00
libnss_dns.abilist Add missed zero length files in previous abilist commit. 2012-04-28 15:38:24 -04:00
libnss_files.abilist Add missed zero length files in previous abilist commit. 2012-04-28 15:38:24 -04:00
libnss_hesiod.abilist Add missed zero length files in previous abilist commit. 2012-04-28 15:38:24 -04:00
libnss_nis.abilist Add missed zero length files in previous abilist commit. 2012-04-28 15:38:24 -04:00
libnss_nisplus.abilist Add missed zero length files in previous abilist commit. 2012-04-28 15:38:24 -04:00
local-setxid.h * sysdeps/posix/spawni.c (__spawni): Use local_seteuid and 2006-06-04 22:17:06 +00:00
localplt.data Run check-localpltk/textrel/execstack over ld.so. 2014-11-06 15:48:44 -05:00
machine-gmon.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
machine-lock.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
machine-sp.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Makefile Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
malloc-machine.h Avoid comma operator warnings. 2014-02-07 15:26:28 -08:00
malloc-sysdep.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
math_ldbl_opt.h * math/math.h [__NO_LONG_DOUBLE_MATH] (__nldbl_nexttowardf): New 2006-01-14 12:10:44 +00:00
math_ldbl.h
math_private.h Add generic HAVE_RM_CTX implementation 2014-06-23 17:29:00 +01:00
math-tests.h Add fenv test support for targets which don't have FP traps. 2014-04-17 09:39:27 +01:00
memcopy.h Add comment for MEMCPY_OK_FOR_FWD_MEMMOVE 2014-07-05 01:09:15 +05:30
memusage.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
not-cancel.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
nscd-types.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
pagecopy.h Fix -Wundef warning on PAGE_COPY_THRESHOLD 2014-07-03 01:49:43 +05:30
paths.h generic paths.h: remove old paths from _PATH_STDPATH 2012-11-04 10:11:39 +01:00
profil-counter.h Fix profil_counter namespace (bug 17725). 2014-12-17 18:10:37 +00:00
pty-private.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
register-dump.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
rtld-lowlevel.h Jakub Jelinek <jakub@redhat.com> 2006-10-10 00:51:29 +00:00
safe-fatal.h Add __safe_fatal and use it in __pthread_unwind forwarder fallback. 2014-07-31 14:00:33 -07:00
sigcontextinfo.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
siglist.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
sigset-cvt-mask.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
stackguard-macros.h BZ #15754: Fix test case for ARM. 2013-09-23 01:44:38 -04:00
stackinfo.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
stdint.h S390: Define SIZE_MAX as unsigned long (BZ #16712). 2014-03-24 16:59:01 +01:00
symbol-hacks.h Remove NOT_IN_libc 2014-11-24 15:03:45 +05:30
sysdep-cancel.h * elf/dl-sym.c (do_sym): Use RTLD_SINGLE_THREAD_P. 2006-10-29 21:46:32 +00:00
sysdep.h Remove configure tests for assembler CFI support. 2014-06-26 17:33:32 +00:00
testrtsig.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
thread_state.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tininess.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tls-macros.h * elf/tls-macros.h: #include_next <tls-macros.h> to get a sysdeps 2005-03-13 09:09:05 +00:00
tls.h Remove second argument from TLS_INIT_TP macro 2014-05-27 14:48:46 +02:00
tst-audit.h Move testsuite audit definitions to sysdeps tst-audit.h files. 2012-07-26 11:29:07 +00:00
tst-stack-align.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
unsecvars.h * malloc/malloc.c (_int_malloc): Remove unused any_larger variable. 2006-10-11 16:29:13 +00:00
unwind-dw2-fde-glibc.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
unwind-dw2-fde.c Don't use INTDEF/INTUSE in unwind-dw2-fde.c (bug 14132). 2014-10-28 17:12:57 +00:00
unwind-dw2-fde.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
unwind-dw2.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
unwind-pe.c Update. 2004-03-10 10:04:19 +00:00
unwind-pe.h Fix Wundef warning for __cplusplus 2014-07-09 10:36:23 +05:30
unwind.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
utmp-equal.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00