diff mbox

Fix ecvt_r, fcvt_r namespace (bug 18522)

Message ID alpine.DEB.2.10.1506112227180.15628@digraph.polyomino.org.uk
State New
Headers show

Commit Message

Joseph Myers June 11, 2015, 10:28 p.m. UTC
The functions ecvt, fcvt and gcvt, in some standards, bring in
references to ecvt_r and fcvt_r, which aren't in any of those
standards.  The calls are correctly to __ecvt_r and __fcvt_r, but then
the names ecvt_r and fcvt_r are defined as strong aliases; this patch
changes them to weak aliases.

Tested for x86_64 and x86 (testsuite, and that disassembly of
installed stripped shared libraries is unchanged by the patch).

2015-06-11  Joseph Myers  <joseph@codesourcery.com>

	[BZ #18522]
	* misc/efgcvt_r.c
	[LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) && !LONG_DOUBLE_CVT]
	(cvt_symbol): Use weak_alias instead of strong_alias.
	[LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)] (cvt_symbol): Likewise.
	* conform/Makefile (test-xfail-XPG4/stdlib.h/linknamespace):
	Remove variable.
	(test-xfail-UNIX98/stdlib.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/stdlib.h/linknamespace): Likewise.

Comments

Carlos O'Donell June 12, 2015, 1:57 a.m. UTC | #1
On 06/11/2015 06:28 PM, Joseph Myers wrote:
> The functions ecvt, fcvt and gcvt, in some standards, bring in
> references to ecvt_r and fcvt_r, which aren't in any of those
> standards.  The calls are correctly to __ecvt_r and __fcvt_r, but then
> the names ecvt_r and fcvt_r are defined as strong aliases; this patch
> changes them to weak aliases.
> 
> Tested for x86_64 and x86 (testsuite, and that disassembly of
> installed stripped shared libraries is unchanged by the patch).
> 
> 2015-06-11  Joseph Myers  <joseph@codesourcery.com>
> 
> 	[BZ #18522]
> 	* misc/efgcvt_r.c
> 	[LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) && !LONG_DOUBLE_CVT]
> 	(cvt_symbol): Use weak_alias instead of strong_alias.
> 	[LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)] (cvt_symbol): Likewise.
> 	* conform/Makefile (test-xfail-XPG4/stdlib.h/linknamespace):
> 	Remove variable.
> 	(test-xfail-UNIX98/stdlib.h/linknamespace): Likewise.
> 	(test-xfail-XOPEN2K/stdlib.h/linknamespace): Likewise.

Looks good to me.

c.
diff mbox

Patch

diff --git a/conform/Makefile b/conform/Makefile
index 8e76bcb..390a8b9 100644
--- a/conform/Makefile
+++ b/conform/Makefile
@@ -351,7 +351,6 @@  test-xfail-XPG3/wordexp.h/linknamespace = yes
 test-xfail-XPG4/fmtmsg.h/linknamespace = yes
 test-xfail-XPG4/glob.h/linknamespace = yes
 test-xfail-XPG4/netdb.h/linknamespace = yes
-test-xfail-XPG4/stdlib.h/linknamespace = yes
 test-xfail-XPG4/syslog.h/linknamespace = yes
 test-xfail-XPG4/unistd.h/linknamespace = yes
 test-xfail-XPG4/wordexp.h/linknamespace = yes
@@ -361,13 +360,11 @@  test-xfail-POSIX/semaphore.h/linknamespace = yes
 test-xfail-UNIX98/fmtmsg.h/linknamespace = yes
 test-xfail-UNIX98/mqueue.h/linknamespace = yes
 test-xfail-UNIX98/netdb.h/linknamespace = yes
-test-xfail-UNIX98/stdlib.h/linknamespace = yes
 test-xfail-UNIX98/syslog.h/linknamespace = yes
 test-xfail-UNIX98/unistd.h/linknamespace = yes
 test-xfail-UNIX98/wchar.h/linknamespace = yes
 test-xfail-XOPEN2K/fmtmsg.h/linknamespace = yes
 test-xfail-XOPEN2K/netdb.h/linknamespace = yes
-test-xfail-XOPEN2K/stdlib.h/linknamespace = yes
 test-xfail-XOPEN2K/syslog.h/linknamespace = yes
 test-xfail-POSIX2008/grp.h/linknamespace = yes
 test-xfail-POSIX2008/netdb.h/linknamespace = yes
diff --git a/misc/efgcvt_r.c b/misc/efgcvt_r.c
index ea62b6c..2761222 100644
--- a/misc/efgcvt_r.c
+++ b/misc/efgcvt_r.c
@@ -251,13 +251,13 @@  __APPEND (FUNC_PREFIX, ecvt_r) (value, ndigit, decpt, sign, buf, len)
 #  define cvt_symbol(symbol) \
   cvt_symbol_1 (libc, __APPEND (FUNC_PREFIX, symbol), \
 	      APPEND (q, symbol), GLIBC_2_0); \
-  strong_alias (__APPEND (FUNC_PREFIX, symbol), APPEND (FUNC_PREFIX, symbol))
+  weak_alias (__APPEND (FUNC_PREFIX, symbol), APPEND (FUNC_PREFIX, symbol))
 #  define cvt_symbol_1(lib, local, symbol, version) \
   compat_symbol (lib, local, symbol, version)
 # endif
 #else
 # define cvt_symbol(symbol) \
-  strong_alias (__APPEND (FUNC_PREFIX, symbol), APPEND (FUNC_PREFIX, symbol))
+  weak_alias (__APPEND (FUNC_PREFIX, symbol), APPEND (FUNC_PREFIX, symbol))
 #endif
 cvt_symbol(fcvt_r);
 cvt_symbol(ecvt_r);