tests-special += $(objpfx)list-tunables.out
endif
-# Make sure that the compiler does not insert any library calls in tunables
-# code paths.
-ifeq (yes,$(have-loop-to-function))
-CFLAGS-dl-tunables.c += -fno-tree-loop-distribute-patterns
-endif
-
all-dl-routines = $(dl-routines) $(sysdep-dl-routines)
# But they are absent from the shared libc, because that code is in ld.so.
elide-routines.os = \
#define TUNABLES_INTERNAL 1
#include "dl-tunables.h"
-/* The function might be called before the process is self-relocated. */
-static size_t
-__attribute_optimization_barrier__
-_dl_strlen (const char *s)
-{
- const char *p = s;
- for (; *s != '\0'; s++);
- return s - p;
-}
-
static char **
get_next_env (char **envp, char **name, char **val, char ***prev_envp)
{
if (tunable_is_name (name, envname))
{
/* The environment variable is always null-terminated. */
- size_t envvallen = _dl_strlen (envval);
-
tunables_env_alias[i] =
- (struct tunable_toset_t) { cur, envval, envvallen };
+ (struct tunable_toset_t) { cur, envval, strlen (envval) };
break;
}
}
# Called during static initialization
CFLAGS-strncmp.c += $(no-stack-protector)
CFLAGS-memset.c += $(no-stack-protector)
+CFLAGS-strlen.c += $(no-stack-protector)
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
#define _DL_IFUNC_GENERIC_H
asm ("memset = __memset_generic");
+asm ("strlen = __strlen_generic");
#endif
#endif
#include "../strlen.S"
+
+#if IS_IN (rtld)
+strong_alias (strlen, __strlen_generic)
+#endif
#ifndef SHARED
asm ("memset = __memset_aligned");
asm ("memcmp = __memcmp_aligned");
+asm ("strlen = __strlen_aligned");
#endif
#endif
# sysdep_routines
CFLAGS-memcpy_noalignment.c += -mno-strict-align
+# Called during static initialization
+CFLAGS-memset-generic.c += $(no-stack-protector)
endif
asm ("memcmp = " HAVE_MEMCMP_IFUNC_GENERIC);
+#if MINIMUM_X86_ISA_LEVEL >= 4
+# define HAVE_STRCMP_IFUNC_GENERIC "__strlen_evex"
+#elif MINIMUM_X86_ISA_LEVEL == 3
+# define HAVE_STRCMP_IFUNC_GENERIC "__strlen_avx2"
+#else
+# define HAVE_STRCMP_IFUNC_GENERIC "__strlen_sse2"
+#endif
+
+asm ("strlen = " HAVE_STRCMP_IFUNC_GENERIC);
+
#endif /* SHARED */
#endif