[PATCH] elf: Use dl-symbol-redir-ifunc.h instead _dl_strlen

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Wed Feb 11 18:42:02 GMT 2026



On 11/02/26 15:31, Florian Weimer wrote:
> * Adhemerval Zanella Netto:
> 
>> On 11/02/26 10:58, Florian Weimer wrote:
>>> * Adhemerval Zanella:
>>>
>>>>  static char **
>>>>  get_next_env (char **envp, char **name, char **val, char ***prev_envp)
>>>>  {
>>>> @@ -334,8 +324,9 @@ __tunables_init (char **envp)
>>>>  
>>>>  	  if (tunable_is_name (name, envname))
>>>>  	    {
>>>> +	      size_t envvallen = 0;
>>>>  	      /* The environment variable is always null-terminated.  */
>>>> -	      size_t envvallen = _dl_strlen (envval);
>>>> +	      for (const char *p = envval; *p != '\0'; p++, envvallen++);
>>>
>>
>> Because it would require potentially more dl-symbol-redir-ifunc.h change
>> than the ones I am testing now (x86_64/aarch64).  At least for clang-21,
>> we only supports these architectures.
> 
> Then this needs a comment why we can't use strlen.

I think we can, it is just that it might require additional machinery on
dl-symbol-redir-ifunc.h for different architectures than the one I checked
for the _dl_strlen addition.  

So I went for simplicity, where I know that it should not change gcc code 
generation. 


More information about the Libc-alpha mailing list