about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-03-12 08:55:50 -0500
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-03-12 09:03:22 -0500
commitdd3946c615184e1957a0cb09352cac72be5d6d5b (patch)
tree4ff621b441f436fbc37faa2f532a271ce0f1dad6 /sysdeps
parentc44496df2f090a56d3bf75df930592dac6bba46f (diff)
downloadglibc-dd3946c615184e1957a0cb09352cac72be5d6d5b.tar.gz
glibc-dd3946c615184e1957a0cb09352cac72be5d6d5b.tar.xz
glibc-dd3946c615184e1957a0cb09352cac72be5d6d5b.zip
PowerPC: Fix bzero definition for static libc for PPC32
This patch fixes an issue for powerpc32-fpu static build which fails
with an 'bzero' undefined reference. This patch adds bzero ifunc selector
for static builds and fixes the '__bzero_ppc' reference to default
memset symbol (since static memset build does not provide ifunc
selector).

Fixes BZ#16689.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S11
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c2
2 files changed, 11 insertions, 2 deletions
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S
index 7a7cca99ed..80a2dc589b 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S
@@ -19,8 +19,17 @@
 
 #include <sysdep.h>
 
+/* memset ifunc selector is not built for static and memset@local
+   for shared builds makes the linker point the call to the ifunc
+   selector.  */
+#ifdef SHARED
+# define MEMSET __memset_ppc
+#else
+# define MEMSET memset
+#endif
+
 ENTRY (__bzero_ppc)
         mr      r5,r4
         li      r4,0
-        b       __memset_ppc@local
+        b       MEMSET@local
 END (__bzero_ppc)
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c
index 2a6298a33d..baaa6b4bcf 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 /* Define multiple versions only for definition in libc.  */
-#if defined SHARED && !defined NOT_IN_libc
+#ifndef NOT_IN_libc
 # include <string.h>
 # include <strings.h>
 # include "init-arch.h"