From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2060 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: TLS (thread-local storage) support Date: Sat, 6 Oct 2012 22:39:39 +0200 Message-ID: <20121006203939.GF24157@port70.net> References: <20121004211332.GA12874@brightrain.aerifal.cx> <20121005030414.GM254@brightrain.aerifal.cx> <20121005172729.GN254@brightrain.aerifal.cx> <20121006143300.GE24157@port70.net> 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 1349555992 32759 80.91.229.3 (6 Oct 2012 20:39:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Oct 2012 20:39:52 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2061-gllmg-musl=m.gmane.org@lists.openwall.com Sat Oct 06 22:39:58 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 1TKbAE-0003A5-GH for gllmg-musl@plane.gmane.org; Sat, 06 Oct 2012 22:39:58 +0200 Original-Received: (qmail 17944 invoked by uid 550); 6 Oct 2012 20:39:51 -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 17936 invoked from network); 6 Oct 2012 20:39:51 -0000 Content-Disposition: inline In-Reply-To: <20121006143300.GE24157@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2060 Archived-At: * Szabolcs Nagy [2012-10-06 16:33:01 +0200]: > should the attached code work with dlopen > when compiled as a dso? > > (i wanted to check if the alignments are ok after a dlopen, > but i can see how this usage may not be supported) > > it seems it dies here in the ctor a more minimal example: a.c: __thread int xx; int *p; __attribute__((constructor)) static void init(void) { p = &xx; } b.c: #include void *h; int main() { h = dlopen("./a.so", RTLD_LAZY); } compiled as musl-gcc -shared -fPIC -g -o a.so a.c musl-gcc -g -o b b.c ./b segfaults in init at p=&xx