From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2777 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH v3] move the definition of __pthread_tsd_main to the only compilation unit that references it Date: Mon, 11 Feb 2013 13:51:11 +0100 Message-ID: <20130211125111.GD6181@port70.net> References: <1360579429.9132.37.camel@eris.loria.fr> <20130211111417.GA6181@port70.net> <1360585447.9132.70.camel@eris.loria.fr> 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 1360587084 23250 80.91.229.3 (11 Feb 2013 12:51:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Feb 2013 12:51:24 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2778-gllmg-musl=m.gmane.org@lists.openwall.com Mon Feb 11 13:51:46 2013 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 1U4srG-0005xA-46 for gllmg-musl@plane.gmane.org; Mon, 11 Feb 2013 13:51:42 +0100 Original-Received: (qmail 26255 invoked by uid 550); 11 Feb 2013 12:51:22 -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 26247 invoked from network); 11 Feb 2013 12:51:22 -0000 Content-Disposition: inline In-Reply-To: <1360585447.9132.70.camel@eris.loria.fr> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2777 Archived-At: * Jens Gustedt [2013-02-11 13:24:07 +0100]: > > In case of dynamic linking, this sounds a bit dangerous to me. Suppose > I have a program that runs fine, without linking to the key stuff. Say > it launches a new thread which then has the key table invalid. > > Then I dynamically load a module that uses keys. The thread that has > an invalid table jumps into a function of that module that calles > pthread_key_get() ? > > In such a scenario everything would simply crash, wouldn't it? > this weak alias magic only works for static linking since the .so has non-weak version of the symbols (the non-weak symbols will take precedence and only those will be added to the .so, but in .a there will be objects with weak symbols and objects with non-weak ones and linker will do the right thing)