public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Fix x86_64 rawmemchr namespace (bug 17572)
@ 2014-11-10 17:54 Joseph Myers
  2014-11-12 21:42 ` Roland McGrath
  0 siblings, 1 reply; 2+ messages in thread
From: Joseph Myers @ 2014-11-10 17:54 UTC (permalink / raw)
  To: libc-alpha

rawmemchr is not an ISO C function, but __rawmemchr is called from ISO
C functions, so rawmemchr should be a weak alias.  On most
architecture it is, but x86_64 defines the function as rawmemchr with
__rawmemchr as a strong alias.  This patch makes x86_64 follow the
same arrangements as other architectures, fixing one of the bugs shown
in the sample output of my proposed tests for such namespace issues
<https://sourceware.org/ml/libc-alpha/2014-11/msg00157.html>.

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

2014-11-10  Joseph Myers  <joseph@codesourcery.com>

	[BZ #17572]
	* sysdeps/x86_64/rawmemchr.S (rawmemchr): Rename to __rawmemchr
	and define as weak alias of __rawmemchr.
	(__rawmemchr): Do not define as strong alias of rawmemchr.

diff --git a/sysdeps/x86_64/rawmemchr.S b/sysdeps/x86_64/rawmemchr.S
index ed93d3f..1b392cb 100644
--- a/sysdeps/x86_64/rawmemchr.S
+++ b/sysdeps/x86_64/rawmemchr.S
@@ -21,7 +21,7 @@
 #include <sysdep.h>
 
 	.text
-ENTRY (rawmemchr)
+ENTRY (__rawmemchr)
 	movd	%rsi, %xmm1
 	mov	%rdi, %rcx
 
@@ -201,7 +201,7 @@ L(return_null):
 	xor	%rax, %rax
 	ret
 
-END (rawmemchr)
+END (__rawmemchr)
 
-strong_alias (rawmemchr, __rawmemchr)
+weak_alias (__rawmemchr, rawmemchr)
 libc_hidden_builtin_def (__rawmemchr)

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fix x86_64 rawmemchr namespace (bug 17572)
  2014-11-10 17:54 Fix x86_64 rawmemchr namespace (bug 17572) Joseph Myers
@ 2014-11-12 21:42 ` Roland McGrath
  0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2014-11-12 21:42 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

Looks OK.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-12 21:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-10 17:54 Fix x86_64 rawmemchr namespace (bug 17572) Joseph Myers
2014-11-12 21:42 ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).