[PATCH 7/8] stdlib: Avoid strlen plt with clang

Adhemerval Zanella adhemerval.zanella@linaro.org
Wed Dec 17 17:51:53 GMT 2025


The clang-21 LoopIdiomRecognizePass replaces some loops in
__xpg_basename with a strlen call.
---
 sysdeps/generic/symbol-hacks.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sysdeps/generic/symbol-hacks.h b/sysdeps/generic/symbol-hacks.h
index 58398d33a5..0d728cce91 100644
--- a/sysdeps/generic/symbol-hacks.h
+++ b/sysdeps/generic/symbol-hacks.h
@@ -20,6 +20,7 @@ asm ("__strcpy_chk = __GI___strcpy_chk");
 asm ("strcpy = __GI_strcpy");
 asm ("strncpy = __GI_strncpy");
 asm ("strcat = __GI_strcat");
+asm ("strlen = __GI_strlen");
 
 /* Some targets do not use __stack_chk_fail_local.  In libc.so,
    redirect __stack_chk_fail to a hidden reference
-- 
2.43.0



More information about the Libc-alpha mailing list