Skip to content

Commit

Permalink
PowerPC: Fix bzero definition for static libc for PPC32
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Adhemerval Zanella committed Mar 12, 2014
1 parent c44496d commit dd3946c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2014-03-12 Adhemerval Zanella <azanella@linux.vnet.ibm.com>

[BZ #16689]
* sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S
(__bzero_ppc): Call memset@local instead of __memset_ppc@local for
static build.
* sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c: Build IFUNC
selector for static builds.

2014-03-12 Siddhesh Poyarekar <siddhesh@redhat.com>

[BZ #16695]
Expand Down
3 changes: 2 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Version 2.20
* The following bugs are resolved with this release:

15347, 15804, 15894, 16447, 16532, 16545, 16574, 16600, 16609, 16610,
16611, 16613, 16623, 16632, 16639, 16670, 16674, 16677, 16683, 16695.
16611, 16613, 16623, 16632, 16639, 16670, 16674, 16677, 16683, 16689,
16695.

* The am33 port, which had not worked for several years, has been removed
from ports.
Expand Down
11 changes: 10 additions & 1 deletion sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit dd3946c

Please sign in to comment.