From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19504 invoked by alias); 18 Jan 2019 17:41:51 -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 19489 invoked by uid 89); 18 Jan 2019 17:41:50 -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, statically, H*M:JavaMail X-HELO: mail.efficios.com DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 4416FA6DE0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1547833305; bh=vxHNxRwrUsgH5AuaVvctZGNxnneoiXQrQlyOTKucT0w=; h=Date:From:To:Message-ID:MIME-Version; b=Y084zBb37KXnswUhAmAHU8PULv7qfOj8M/+3gRY7gC2BB/eAJIsYmzoT78PaW0o9g BpF71MJgJO7BxtPwlYg9//Hvww4HKl5cE9z7LuDh9tuWhUZzK1NF0JMEdPNjhkUYtr SVTBESwMgJLWbT5ndFou/2LP7nGqGvcRBX5BzBhuDjpKXXYqvpqk9BMKnhO7Znsp/5 XJfNKRIcPjBuZmRXOmKed59cho8Il+TChtMcMDXHM0XIwGuETZiLUJce2EJoGj90oz OIZw7ctPb+P1KB4bqgcOjp1GyLPp121t2lW0Q3ogknsVkIix+3f5Kk6VZXdu5Ak/61 Z50sz1xvl11Vw== Date: Fri, 18 Jan 2019 17:41:00 -0000 From: Mathieu Desnoyers To: Carlos O'Donell 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: <1887968822.1146.1547833305059.JavaMail.zimbra@efficios.com> In-Reply-To: <20190115015148.32155-1-mathieu.desnoyers@efficios.com> References: <20190115015148.32155-1-mathieu.desnoyers@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/msg00479.txt.bz2 ----- 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