[PATCH v3 1/2] elf: Do not run constructors for proxy objects

Andreas Schwab schwab@suse.de
Tue Aug 22 11:14:43 GMT 2023


On Aug 22 2023, Florian Weimer via Libc-alpha wrote:

> diff --git a/elf/dl-init.c b/elf/dl-init.c
> index 5b0732590f..fefd471851 100644
> --- a/elf/dl-init.c
> +++ b/elf/dl-init.c
> @@ -25,6 +25,10 @@
>  static void
>  call_init (struct link_map *l, int argc, char **argv, char **env)
>  {
> +  /* Do not run constructors for proxy objects.  */
> +  if (l != l->l_real)
> +    return;
> +
>    /* If the object has not been relocated, this is a bug.  The
>       function pointers are invalid in this case.  (Executables do not
>       need relocation, and neither do proxy objects.)  */

Now that we know that l == l->l_real, the following assertion does not
need to indirect through l_real any more.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


More information about the Libc-alpha mailing list