public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Fengkai Sun <qcloud1014@gmail.com>
To: libc-help@sourceware.org
Subject: CHECK_STATIC_TLS in R_X86_64_TPOFF64 type relocation
Date: Sun, 26 Dec 2021 21:29:13 +0800	[thread overview]
Message-ID: <CAF6YOcMeKcekiiLj63ERTYXX_JdJSCSYmz48Qm4N-0B43nUneg@mail.gmail.com> (raw)

Hi list,

I noticed that when resolving R_X86_64_TPOFF64 type relocations, the
runtime dynamic linker would call the macro CHECK_STATIC_TLS, which can be
expanded into a call to _dl_try_allocate_static_tls. (in
sysdeps/x86_64/dl-machine.h)

The comments of _dl_try_allocate_static_tls says:

> We are trying to perform a static TLS relocation in MAP, but it was
dynamically loaded.

To the best of my knowledge, I found that R_X86_64_TPOFF64 is for
Initial-exec TLS model, which only appears in executables.

Since glibc has refused to dlopen PIEs since 2.29, why does it not see it
as an error, but still try to allocate static TLS for PIEs?

---
Thanks,
Fengkai

             reply	other threads:[~2021-12-26 13:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-26 13:29 Fengkai Sun [this message]
2021-12-26 15:48 ` Florian Weimer
2021-12-27  3:05   ` Fengkai Sun

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=CAF6YOcMeKcekiiLj63ERTYXX_JdJSCSYmz48Qm4N-0B43nUneg@mail.gmail.com \
    --to=qcloud1014@gmail.com \
    --cc=libc-help@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).