This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Do not elide the libc hidden def of sparc's memset/memcpywhen multiarching.


Contrary to the comments in sysdeps/x86-64/multiarch/mem{set,cpy}.S it
does make sense to send libc-internal memcpy calls through the PLT.

There are several quite critical memcpy and memset calls inside of
glibc (libio, malloc, etc.) and those should use the most optimized
routine possible.

Furthermore, at least on sparc, the performance difference between the
different implementations is huge.

Someone with some x86-64 knowhow should really investigate that case
and perhaps put a similar change as this one there.

Committed to master.

	* sysdeps/sparc/sparc64/multiarch/memcpy.S: Provide a hidden def to
	the IFUNC routine in the libc case.
	* sysdeps/sparc/sparc64/multiarch/memcpy.S: Likewise.
---
 ChangeLog                                |    4 ++++
 sysdeps/sparc/sparc64/multiarch/memcpy.S |   10 +++++-----
 sysdeps/sparc/sparc64/multiarch/memset.S |   10 +++++-----
 3 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 506babf..555c395 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2012-03-28  David S. Miller  <davem@davemloft.net>
 
+	* sysdeps/sparc/sparc64/multiarch/memcpy.S: Provide a hidden def to
+	the IFUNC routine in the libc case.
+	* sysdeps/sparc/sparc64/multiarch/memcpy.S: Likewise.
+
 	* sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memset.c: New file.
 	* sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memcpy.c: New file.
 	* sysdeps/sparc/sparc32/sparcv9/rtld-memset.c: New file.
diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy.S b/sysdeps/sparc/sparc64/multiarch/memcpy.S
index 36c4886..0f3751e 100644
--- a/sysdeps/sparc/sparc64/multiarch/memcpy.S
+++ b/sysdeps/sparc/sparc64/multiarch/memcpy.S
@@ -1,5 +1,5 @@
 /* Multiple versions of memcpy
-   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc.
    Contributed by David S. Miller (davem@davemloft.net)
    This file is part of the GNU C Library.
 
@@ -72,10 +72,10 @@ ENTRY(memcpy)
 	 mov	%o1, %o0
 END(memcpy)
 
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in a shared library.  */
-# define libc_hidden_builtin_def(name) \
-	.globl __GI_memcpy; __GI_memcpy = __memcpy_ultra1
+libc_hidden_builtin_def (memcpy)
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
 
 #define memcpy __memcpy_ultra1
 
diff --git a/sysdeps/sparc/sparc64/multiarch/memset.S b/sysdeps/sparc/sparc64/multiarch/memset.S
index c717f0c..26cc669 100644
--- a/sysdeps/sparc/sparc64/multiarch/memset.S
+++ b/sysdeps/sparc/sparc64/multiarch/memset.S
@@ -1,5 +1,5 @@
 /* Multiple versions of memset and bzero
-   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc.
    Contributed by David S. Miller (davem@davemloft.net)
    This file is part of the GNU C Library.
 
@@ -88,10 +88,10 @@ weak_alias (__bzero, bzero)
 # undef weak_alias
 # define weak_alias(a, b)
 
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in a shared library.  */
-# define libc_hidden_builtin_def(name) \
-	.globl __GI_memset; __GI_memset = __memset_ultra1
+libc_hidden_builtin_def (memset)
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
 
 #define memset __memset_ultra1
 #define __bzero __bzero_ultra1
-- 
1.7.9.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]