From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2057 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: TLS (thread-local storage) support Date: Fri, 5 Oct 2012 13:27:29 -0400 Message-ID: <20121005172729.GN254@brightrain.aerifal.cx> References: <20121004211332.GA12874@brightrain.aerifal.cx> <20121005030414.GM254@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1349458574 2579 80.91.229.3 (5 Oct 2012 17:36:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Oct 2012 17:36:14 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2058-gllmg-musl=m.gmane.org@lists.openwall.com Fri Oct 05 19:36:20 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1TKBow-0008JV-Ay for gllmg-musl@plane.gmane.org; Fri, 05 Oct 2012 19:36:18 +0200 Original-Received: (qmail 3303 invoked by uid 550); 5 Oct 2012 17:36:11 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 3295 invoked from network); 5 Oct 2012 17:36:11 -0000 Content-Disposition: inline In-Reply-To: <20121005030414.GM254@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2057 Archived-At: On Thu, Oct 04, 2012 at 11:04:14PM -0400, Rich Felker wrote: > On Thu, Oct 04, 2012 at 05:13:32PM -0400, Rich Felker wrote: > > Hi, > > > > I've committed the initial version of thread-local storage > > (__thread/_Thread_local keyword). So far, it only works in > > static-linked applications, > > Scratch that. It's now supported everywhere except dynamically loaded > (dlopen'd) shared libraries. And I'm working on adding support for And they're working now too. I've also made some general fixes and improvements to the dynamic linker -- minor corrections in how library files are located, and support for recursive calls to dlopen (happens when a library has constructors and one of those constructors calls dlopen). This same change was also necessary to avoid blocking pthread_create calls for the entire duration of constructor execution. Some further dynamic linker development directions: - Unifying the relocation code in arch/$(ARCH)/reloc.h to minimize duplication. - Adding dlsym() support for TLS vars (obtaining current thread's copy). - Cleanup and reduction of code duplication - phdr parsing and symbol lookup logic is duplicated in several places. And of course testing TLS on other archs and fixing anything that's broken... Rich