public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Carlos O'Donell <carlos@redhat.com>
Cc: Florian Weimer <fweimer@redhat.com>,
	Joseph Myers <joseph@codesourcery.com>,
	 Szabolcs Nagy <szabolcs.nagy@arm.com>,
	 libc-alpha <libc-alpha@sourceware.org>,
	 Thomas Gleixner <tglx@linutronix.de>,
	Ben Maurer <bmaurer@fb.com>,
	 Peter Zijlstra <peterz@infradead.org>,
	 "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	 Boqun Feng <boqun.feng@gmail.com>,
	Will Deacon <will.deacon@arm.com>,
	 Dave Watson <davejwatson@fb.com>, Paul Turner <pjt@google.com>,
	 Rich Felker <dalias@libc.org>,
	 linux-kernel <linux-kernel@vger.kernel.org>,
	 linux-api <linux-api@vger.kernel.org>
Subject: Re: [RFC PATCH glibc 1/4] glibc: Perform rseq(2) registration at C startup and thread creation (v5)
Date: Fri, 18 Jan 2019 17:41:00 -0000	[thread overview]
Message-ID: <1887968822.1146.1547833305059.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <20190115015148.32155-1-mathieu.desnoyers@efficios.com>

----- On Jan 14, 2019, at 8:51 PM, Mathieu Desnoyers mathieu.desnoyers@efficios.com wrote:

[...]

> diff --git a/sysdeps/unix/sysv/linux/rseq-sym.c
> b/sysdeps/unix/sysv/linux/rseq-sym.c
> new file mode 100644
> index 0000000000..6856d0388a
[...]
> +/* volatile because fields can be read/updated by the kernel.  */
> +__thread volatile struct rseq __rseq_abi = {
> +  .cpu_id = RSEQ_CPU_ID_UNINITIALIZED,
> +};
> +
> +/* volatile because refcount can be read/updated by signal handlers.  */
> +__thread volatile uint32_t __rseq_refcount;

Back to the weak vs non-weak question about those two symbols. I understand
that tagging them as weak symbols has little effect on the dynamic loader
when it loads libc.so. However, I'm worried about that happens when
libc is statically linked into an application, and there happens to
be more than one instance of those symbols (e.g. libc and another library
define the same symbols, and both are statically linked into the same
application). Isn't it a situation where tagging those symbols as "weak"
becomes useful ?

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

  parent reply	other threads:[~2019-01-18 17:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-15  1:52 Mathieu Desnoyers
2019-01-15  1:52 ` [RFC PATCH glibc 2/4] glibc: sched_getcpu(): use rseq cpu_id TLS on Linux Mathieu Desnoyers
2019-01-15  1:52 ` [RFC PATCH glibc 4/4] rseq registration tests (v2) Mathieu Desnoyers
2019-01-15  1:52 ` [RFC PATCH glibc 3/4] support record failure: allow use from constructor Mathieu Desnoyers
2019-01-18 17:41 ` Mathieu Desnoyers [this message]
2019-01-21 21:24   ` [RFC PATCH glibc 1/4] glibc: Perform rseq(2) registration at C startup and thread creation (v5) Mathieu Desnoyers

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=1887968822.1146.1547833305059.JavaMail.zimbra@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=bmaurer@fb.com \
    --cc=boqun.feng@gmail.com \
    --cc=carlos@redhat.com \
    --cc=dalias@libc.org \
    --cc=davejwatson@fb.com \
    --cc=fweimer@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=szabolcs.nagy@arm.com \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.com \
    /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).