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

Florian Weimer fw@deneb.enyo.de
Wed Feb 11 18:31:25 GMT 2026


* 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.


More information about the Libc-alpha mailing list