public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Florian Weimer via Libc-alpha <libc-alpha@sourceware.org>
Cc: Florian Weimer <fweimer@redhat.com>
Subject: Re: [PATCH v3 1/2] elf: Do not run constructors for proxy objects
Date: Tue, 22 Aug 2023 13:14:43 +0200	[thread overview]
Message-ID: <mvmjztn9vmk.fsf@suse.de> (raw)
In-Reply-To: <ca9c2cfd0f0d09eb65e8dffe971cc62511d32d60.1692701787.git.fweimer@redhat.com> (Florian Weimer via Libc-alpha's message of "Tue, 22 Aug 2023 12:58:29 +0200")

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

  reply	other threads:[~2023-08-22 11:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22 10:58 [PATCH v3 0/2] Predictable ELF destructor ordering (bug 30785) Florian Weimer
2023-08-22 10:58 ` [PATCH v3 1/2] elf: Do not run constructors for proxy objects Florian Weimer
2023-08-22 11:14   ` Andreas Schwab [this message]
2023-08-22 11:25     ` Florian Weimer
2023-08-22 11:50       ` Andreas Schwab
2023-08-22 10:58 ` [PATCH v3 2/2] elf: Always call destructors in reverse constructor order (bug 30785) Florian Weimer
2023-09-01 17:59   ` DJ Delorie
2023-09-01 21:29     ` Florian Weimer
2023-08-23 10:04 ` [PATCH v3 0/2] Predictable ELF destructor ordering " Florian Weimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mvmjztn9vmk.fsf@suse.de \
    --to=schwab@suse.de \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).