powerpc: fix ifunc implementation list for POWER9 strlen and stpcpy

Message ID 20200917141636.10543-1-rzinsly@linux.ibm.com
State Committed
Headers
Series powerpc: fix ifunc implementation list for POWER9 strlen and stpcpy |

Commit Message

Raphael M Zinsly Sept. 17, 2020, 2:16 p.m. UTC
  __strlen_power9 and __stpcpy_power9 were added to their ifunc lists
using the wrong function names.
---
 sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Paul E Murphy Sept. 17, 2020, 4:03 p.m. UTC | #1
Good catch.  I was surprised no warnings were generated, but looking at 
the macros, the type information about the ifuncs is stripped away.

LGTM, and pushed.

On 9/17/20 9:16 AM, Raphael Moreira Zinsly wrote:
> __strlen_power9 and __stpcpy_power9 were added to their ifunc lists
> using the wrong function names.
> ---
>   sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
> index ea10b00417..dd54e7d6bb 100644
> --- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
> +++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
> @@ -99,7 +99,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
>     /* Support sysdeps/powerpc/powerpc64/multiarch/stpcpy.c.  */
>     IFUNC_IMPL (i, name, stpcpy,
>   #ifdef __LITTLE_ENDIAN__
> -	      IFUNC_IMPL_ADD (array, i, strncmp, hwcap2 & PPC_FEATURE2_ARCH_3_00,
> +	      IFUNC_IMPL_ADD (array, i, stpcpy, hwcap2 & PPC_FEATURE2_ARCH_3_00,
>   			      __stpcpy_power9)
>   #endif
>   	      IFUNC_IMPL_ADD (array, i, stpcpy, hwcap2 & PPC_FEATURE2_ARCH_2_07,
> @@ -112,7 +112,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
>     /* Support sysdeps/powerpc/powerpc64/multiarch/strlen.c.  */
>     IFUNC_IMPL (i, name, strlen,
>   #ifdef __LITTLE_ENDIAN__
> -	      IFUNC_IMPL_ADD (array, i, strcpy, hwcap2 & PPC_FEATURE2_ARCH_3_00,
> +	      IFUNC_IMPL_ADD (array, i, strlen, hwcap2 & PPC_FEATURE2_ARCH_3_00,
>   			      __strlen_power9)
>   #endif
>   	      IFUNC_IMPL_ADD (array, i, strlen, hwcap2 & PPC_FEATURE2_ARCH_2_07,
>
  
Paul A. Clarke Sept. 18, 2020, 3:24 p.m. UTC | #2
On Thu, Sep 17, 2020 at 11:03:29AM -0500, Paul E Murphy via Libc-alpha wrote:
> Good catch.  I was surprised no warnings were generated, but looking at the
> macros, the type information about the ifuncs is stripped away.

Should we create a test for this type of error, since it went otherwise
undetected?

> 
> LGTM, and pushed.
> 
> On 9/17/20 9:16 AM, Raphael Moreira Zinsly wrote:
> > __strlen_power9 and __stpcpy_power9 were added to their ifunc lists
> > using the wrong function names.
> > ---
> >   sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
> > index ea10b00417..dd54e7d6bb 100644
> > --- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
> > +++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
> > @@ -99,7 +99,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
> >     /* Support sysdeps/powerpc/powerpc64/multiarch/stpcpy.c.  */
> >     IFUNC_IMPL (i, name, stpcpy,
> >   #ifdef __LITTLE_ENDIAN__
> > -	      IFUNC_IMPL_ADD (array, i, strncmp, hwcap2 & PPC_FEATURE2_ARCH_3_00,
> > +	      IFUNC_IMPL_ADD (array, i, stpcpy, hwcap2 & PPC_FEATURE2_ARCH_3_00,
> >   			      __stpcpy_power9)
> >   #endif
> >   	      IFUNC_IMPL_ADD (array, i, stpcpy, hwcap2 & PPC_FEATURE2_ARCH_2_07,
> > @@ -112,7 +112,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
> >     /* Support sysdeps/powerpc/powerpc64/multiarch/strlen.c.  */
> >     IFUNC_IMPL (i, name, strlen,
> >   #ifdef __LITTLE_ENDIAN__
> > -	      IFUNC_IMPL_ADD (array, i, strcpy, hwcap2 & PPC_FEATURE2_ARCH_3_00,
> > +	      IFUNC_IMPL_ADD (array, i, strlen, hwcap2 & PPC_FEATURE2_ARCH_3_00,
> >   			      __strlen_power9)
> >   #endif
> >   	      IFUNC_IMPL_ADD (array, i, strlen, hwcap2 & PPC_FEATURE2_ARCH_2_07,
> > 

PC
  

Patch

diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index ea10b00417..dd54e7d6bb 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -99,7 +99,7 @@  __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/stpcpy.c.  */
   IFUNC_IMPL (i, name, stpcpy,
 #ifdef __LITTLE_ENDIAN__
-	      IFUNC_IMPL_ADD (array, i, strncmp, hwcap2 & PPC_FEATURE2_ARCH_3_00,
+	      IFUNC_IMPL_ADD (array, i, stpcpy, hwcap2 & PPC_FEATURE2_ARCH_3_00,
 			      __stpcpy_power9)
 #endif
 	      IFUNC_IMPL_ADD (array, i, stpcpy, hwcap2 & PPC_FEATURE2_ARCH_2_07,
@@ -112,7 +112,7 @@  __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/strlen.c.  */
   IFUNC_IMPL (i, name, strlen,
 #ifdef __LITTLE_ENDIAN__
-	      IFUNC_IMPL_ADD (array, i, strcpy, hwcap2 & PPC_FEATURE2_ARCH_3_00,
+	      IFUNC_IMPL_ADD (array, i, strlen, hwcap2 & PPC_FEATURE2_ARCH_3_00,
 			      __strlen_power9)
 #endif
 	      IFUNC_IMPL_ADD (array, i, strlen, hwcap2 & PPC_FEATURE2_ARCH_2_07,