lkml.org 
[lkml]   [2019]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH glibc 1/4] glibc: Perform rseq(2) registration at C startup and thread creation (v5)
----- 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

\
 
 \ /
  Last update: 2019-01-18 18:42    [W:2.335 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site