From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103514 invoked by alias); 21 Jan 2019 21:24:05 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 103358 invoked by uid 89); 21 Jan 2019 21:24:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=registration, H*M:zimbra, H*UA:Zimbra, H*x:Zimbra X-HELO: mail.efficios.com DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 29D6CB4D4A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1548105836; bh=fSU2JRLPtR/56gZe4r2TAeNx6cGq1OoI4zlPdI8inB8=; h=Date:From:To:Message-ID:MIME-Version; b=lFDhDYgfNVwHUsu0rb1mb3Gxq+ySCvfwyvHmlxWY3QsBfOL7Zp3WlArxdaz4ebc25 j2fuxxMszI6khkoLFJkyqWIX2MayGszAky2Bp7wrkV6P3sMTXvkImRCcliDQUgiaSK 2M3jfqxxQaX8wEYvSULp0njMsIKZ3lJ8BElfLXQc9DgaKBu1x7FoI9HDy3c9ztdRN/ WrYbqlzFfllWd8kopUzPGXcRHQHaznDvM/Obte0p6m47PohUc/YJv9SCTgaQ+WBlzu vQo+j5gIxatTf07/YlAL+iKVgdIirIAm67N1OIDIkTv0u1+cRtk41i9WkGQFFeHI3y KfszM5Kum9uQA== Date: Mon, 21 Jan 2019 21:24:00 -0000 From: Mathieu Desnoyers To: carlos Cc: Florian Weimer , Joseph Myers , Szabolcs Nagy , libc-alpha , Thomas Gleixner , Ben Maurer , Peter Zijlstra , "Paul E. McKenney" , Boqun Feng , Will Deacon , Dave Watson , Paul Turner , Rich Felker , linux-kernel , linux-api Message-ID: <1189519139.464.1548105835783.JavaMail.zimbra@efficios.com> In-Reply-To: <1887968822.1146.1547833305059.JavaMail.zimbra@efficios.com> References: <20190115015148.32155-1-mathieu.desnoyers@efficios.com> <1887968822.1146.1547833305059.JavaMail.zimbra@efficios.com> Subject: Re: [RFC PATCH glibc 1/4] glibc: Perform rseq(2) registration at C startup and thread creation (v5) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-01/txt/msg00538.txt.bz2 ----- On Jan 18, 2019, at 12:41 PM, Mathieu Desnoyers mathieu.desnoyers@efficios.com wrote: > ----- 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 ? Testing shows that it seems fine to statically link two archives within an executable in a scenario where each .a defines the same symbol, without using "weak", so I won't worry about this further. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com