From: H.J. Lu Date: Wed, 16 May 2018 16:03:45 +0000 (-0700) Subject: x86-64: Use IFUNC strncat inside libc.so X-Git-Tag: glibc-2.28~275 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=04958880e04264da97873b4d41d9bc34567afaef;p=thirdparty%2Fglibc.git x86-64: Use IFUNC strncat inside libc.so Unlike i386, we can call hidden IFUNC functions inside libc.so since x86-64 PLT is always PIC. Tested on x86-64. * sysdeps/x86_64/multiarch/strncat-c.c (STRNCAT_PRIMARY): Removed. Include . * sysdeps/x86_64/multiarch/strncat.c (__strncat): New strong alias. (__GI___strncat): New hidden alias. --- diff --git a/ChangeLog b/ChangeLog index 3113eda2223..3d4f2373ffa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2018-05-16 H.J. Lu + + * sysdeps/x86_64/multiarch/strncat-c.c (STRNCAT_PRIMARY): Removed. + Include . + * sysdeps/x86_64/multiarch/strncat.c (__strncat): New strong + alias. + (__GI___strncat): New hidden alias. + 2018-05-16 Joseph Myers * sysdeps/mips/mips32/libm-test-ulps: Update. diff --git a/sysdeps/x86_64/multiarch/strncat-c.c b/sysdeps/x86_64/multiarch/strncat-c.c index db8ad9917c5..93a7fab7eab 100644 --- a/sysdeps/x86_64/multiarch/strncat-c.c +++ b/sysdeps/x86_64/multiarch/strncat-c.c @@ -1,3 +1,2 @@ #define STRNCAT __strncat_sse2 -#define STRNCAT_PRIMARY -#include "string/strncat.c" +#include diff --git a/sysdeps/x86_64/multiarch/strncat.c b/sysdeps/x86_64/multiarch/strncat.c index 1267eb4972f..841c165565a 100644 --- a/sysdeps/x86_64/multiarch/strncat.c +++ b/sysdeps/x86_64/multiarch/strncat.c @@ -27,4 +27,9 @@ # include "ifunc-unaligned-ssse3.h" libc_ifunc_redirected (__redirect_strncat, strncat, IFUNC_SELECTOR ()); +strong_alias (strncat, __strncat); +# ifdef SHARED +__hidden_ver1 (strncat, __GI___strncat, __redirect_strncat) + __attribute__((visibility ("hidden"))); +# endif #endif