[PATCH] elf: Fix DTV gap reuse logic (BZ #27135)

Florian Weimer fweimer@redhat.com
Thu Jul 8 06:00:43 GMT 2021


* Adhemerval Zanella:

> diff --git a/elf/dl-tls.c b/elf/dl-tls.c
> index 2b5161d10a..4ec4c7f38c 100644
> --- a/elf/dl-tls.c
> +++ b/elf/dl-tls.c
> @@ -157,7 +157,11 @@ _dl_next_tls_modid (void)
>  	      }
>  
>  	    if (result - disp < runp->len)
> -	      break;
> +	      {
> +		/* Mark the entry as used, so any dependency see it.  */
> +		runp->slotinfo[result - disp].map = (struct link_map *) -1;
> +		break;
> +	      }
>  
>  	    disp += runp->len;
>  	  }

Which dependency?

I think the special value -1 needs to be documented on the slotinfo
struct member.

When Carlos and I discussed this, we couldn't quite decide whether it
was appropriate just to assign the actual link map value here.

Thanks,
Florian



More information about the Libc-alpha mailing list