]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
x86: Make strncmp usable from rtld
authorFlorian Weimer <fweimer@redhat.com>
Tue, 12 Jun 2018 13:00:33 +0000 (15:00 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 12 Jun 2018 13:00:33 +0000 (15:00 +0200)
Due to the way the conditions were written, the rtld build of strncmp
ended up with no definition of the strncmp symbol at all: The
implementations were renamed for use within an IFUNC resolver, but the
IFUNC resolver itself was missing (because rtld does not use IFUNCs).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
ChangeLog
sysdeps/i386/i686/multiarch/strncmp-c.c
sysdeps/x86_64/multiarch/strncmp-sse2.S

index c5dc3bed212469e07858cd35961e7bd9c83a4042..c1b9cdfd29d005672a757a167314d7d7066d1a70 100644 (file)
--- 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]
index cc059da49441e4058ecfc81a388ccc5a7bae0dd3..2e3eca9b2b4e636292b18d32320a16f08cc81cfc 100644 (file)
@@ -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)  \
index cc5252d82665fd1980de137e0ef8a52d81ae00ef..a5ecb82b13025472857115fd88c963f828833842 100644 (file)
 
 #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>