summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--sysdeps/i386/i686/multiarch/strncmp-c.c2
-rw-r--r--sysdeps/x86_64/multiarch/strncmp-sse2.S11
3 files changed, 16 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index c5dc3bed21..c1b9cdfd29 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2018-06-12 Florian Weimer <fweimer@redhat.com>
+
+ x86: Make strncmp usable from rtld.
+ * sysdeps/i386/i686/multiarch/strncmp-c.c: Only rename strncmp to
+ __strncmp_ia32 if in libc (and not in rtld).
+ * sysdeps/x86_64/multiarch/strncmp-sse2.S: Rename strcmp to
+ strncmp if not in libc (and not to __strncmp_sse2).
+
2018-06-12 Rafal Luzynski <digitalfreak@lingonborough.com>
[BZ #23140]
diff --git a/sysdeps/i386/i686/multiarch/strncmp-c.c b/sysdeps/i386/i686/multiarch/strncmp-c.c
index cc059da494..2e3eca9b2b 100644
--- a/sysdeps/i386/i686/multiarch/strncmp-c.c
+++ b/sysdeps/i386/i686/multiarch/strncmp-c.c
@@ -1,4 +1,4 @@
-#ifdef SHARED
+#if defined (SHARED) && IS_IN (libc)
# define STRNCMP __strncmp_ia32
# undef libc_hidden_builtin_def
# define libc_hidden_builtin_def(name) \
diff --git a/sysdeps/x86_64/multiarch/strncmp-sse2.S b/sysdeps/x86_64/multiarch/strncmp-sse2.S
index cc5252d826..a5ecb82b13 100644
--- a/sysdeps/x86_64/multiarch/strncmp-sse2.S
+++ b/sysdeps/x86_64/multiarch/strncmp-sse2.S
@@ -18,10 +18,13 @@
#include <sysdep.h>
-#define STRCMP __strncmp_sse2
-
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(strcmp)
+#if IS_IN (libc)
+# define STRCMP __strncmp_sse2
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(strcmp)
+#else
+# define STRCMP strncmp
+#endif
#define USE_AS_STRNCMP
#include <sysdeps/x86_64/strcmp.S>