From: Florian Weimer <fweimer@redhat.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] elf: Remove dead l_need_tls_init static-TLS init path
Date: Mon, 03 Aug 2026 15:01:14 +0200 [thread overview]
Message-ID: <lhuqzkfbbol.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20260609132547.1577550-1-adhemerval.zanella@linaro.org> (Adhemerval Zanella's message of "Tue, 9 Jun 2026 10:25:45 -0300")
* Adhemerval Zanella:
> Since af34b1376a3 ("elf: Initialize static TLS before relocation
> processing", BZ 34164) dropped the 'defer-if-not-relocated' branch in
> _dl_try_allocate_static_tls, nothing sets l_need_tls_init any more. The
> second pass in update_tls_slotinfo, guarded by l_need_tls_init, is
> therefore dead: its _dl_update_slotinfo / _dl_init_static_tls calls never
> run, and the static TLS image is initialised inline during relocation (IE
> model) or lazily on first dynamic-TLS access instead.
>
> Remove the dead loop, the now write-only l_need_tls_init field and its
> clear in _dl_allocate_tls_init. No functional change.
>
> Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu.
> I also run the elf tests on armv7-a, alpha, loongarch64, mips64le,
> powerpc, riscv, and s390x using qemu system.
> ---
> elf/dl-open.c | 50 +++++++++++---------------------------------------
> elf/dl-tls.c | 9 +++------
> include/link.h | 3 ---
> 3 files changed, 14 insertions(+), 48 deletions(-)
>
> diff --git a/elf/dl-open.c b/elf/dl-open.c
> index cf4749694f9..ba06e837bae 100644
> --- a/elf/dl-open.c
> +++ b/elf/dl-open.c
> @@ -382,36 +382,6 @@ update_tls_slotinfo (struct link_map *new)
> TLS generation counter wrapped! Please report this."));
> /* Can be read concurrently. */
> atomic_store_release (&GL(dl_tls_generation), newgen);
I think update_tls_slotinfo can now be inlined into its caller? At the
least the function is now about updating the TLS generation counter, so
the name doesn't quite match anymore.
Thanks,
Florian
PS: I won't make it to the patch review meeting today.
next prev parent reply other threads:[~2026-08-03 13:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 13:25 Adhemerval Zanella
2026-06-09 14:13 ` Florian Weimer
2026-06-09 16:04 ` Adhemerval Zanella Netto
2026-06-10 7:33 ` Florian Weimer
2026-06-10 11:46 ` Adhemerval Zanella Netto
2026-06-23 12:23 ` Adhemerval Zanella Netto
2026-08-03 13:01 ` Florian Weimer [this message]
2026-08-03 14:23 ` Adhemerval Zanella Netto
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=lhuqzkfbbol.fsf@oldenburg.str.redhat.com \
--to=fweimer@redhat.com \
--cc=adhemerval.zanella@linaro.org \
--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).