aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-05-16 09:03:45 -0700
committerH.J. Lu <hjl.tools@gmail.com>2018-05-16 09:04:35 -0700
commit04958880e04264da97873b4d41d9bc34567afaef (patch)
tree3b9abfdf4628354305efcde9626fe38682bfbf3e /sysdeps
parentc9992d13c4160edd5449ee6c8f407663f2ac6dbd (diff)
downloadglibc-04958880e04264da97873b4d41d9bc34567afaef.zip
glibc-04958880e04264da97873b4d41d9bc34567afaef.tar.gz
glibc-04958880e04264da97873b4d41d9bc34567afaef.tar.bz2
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 <string/strncat.c>. * sysdeps/x86_64/multiarch/strncat.c (__strncat): New strong alias. (__GI___strncat): New hidden alias.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/x86_64/multiarch/strncat-c.c3
-rw-r--r--sysdeps/x86_64/multiarch/strncat.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/sysdeps/x86_64/multiarch/strncat-c.c b/sysdeps/x86_64/multiarch/strncat-c.c
index db8ad99..93a7fab 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 <string/strncat.c>
diff --git a/sysdeps/x86_64/multiarch/strncat.c b/sysdeps/x86_64/multiarch/strncat.c
index 1267eb4..841c165 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