From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14611 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Markus Wichmann Newsgroups: gmane.linux.lib.musl.general Subject: Re: About those weak aliases Date: Thu, 5 Sep 2019 18:50:08 +0200 Message-ID: <20190905165008.GA9317@voyager> References: <20190902190359.GA6472@voyager> <20190902201009.GV22009@port70.net> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="28854"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.9.4 (2018-02-28) To: musl@lists.openwall.com Original-X-From: musl-return-14627-gllmg-musl=m.gmane.org@lists.openwall.com Thu Sep 05 18:50:25 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1i5uxk-0007PV-AU for gllmg-musl@m.gmane.org; Thu, 05 Sep 2019 18:50:24 +0200 Original-Received: (qmail 26521 invoked by uid 550); 5 Sep 2019 16:50:21 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 26493 invoked from network); 5 Sep 2019 16:50:21 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1567702209; bh=W48kAy7E7LMFS0s0VPxspM6bIuFCHPlsTOEPU/mqM6A=; h=X-UI-Sender-Class:Date:From:To:Subject:References:In-Reply-To; b=U66mwm+KsibLEFfIi/4K4MLqGT7t/hNbGGhc7YpJ/gYU1mSDhYpx1R/TrjnYi185C i1qIpiyf/rz5TL5FhIr5VZ7arCKDhvVxqgEesx+vDP0pxiE9FBlNGKrDHUhqWX3lCW svoQ2pGXWrg+j38I69BgtM/3k2hMzvkDAcGnN+p0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Content-Disposition: inline In-Reply-To: <20190902201009.GV22009@port70.net> X-Provags-ID: V03:K1:XGGIOEN9WMcb8sN4tP9XpBXW9iI+DahOZ4Pamwmfyx9FYrY3Spb 6gDubfQGj4enmKgHzz3kRwlNP6nCCufsa+IvVBbijZj9ewjwCkDTCJ5Pfg6VWZj9G3lkt2Y WeKGiQnteHVTxZemxpedZzJyQFhsE2E4wwESIfqbRe85GDEJJbgX8CiGF1ZqDtYXR0Df+/i wsXYIDrP4kLJkjl9JBrmg== X-UI-Out-Filterresults: notjunk:1;V03:K0:TpO1iYP1Z1s=:EbQdj0DaAcQ8vjXBtvlbj0 LCDRUi42tB4s8ih6U4T1PsMcILIHGIrC9kBwuAI/VxXehYUIxZArC3qN4oZnebttgjsydNrFy 1U1RqB4SB0KrUaEAN+4ykAj4rNyIhFGGx5wQckAcLQz88cezSsTQaae9nc2z8c3g2q7rEobt1 NxbzJ9JUWlAcnLZ/FvAyMN1j3pouNCy8NsNfY0xXIPmjKxQQWCbYgCsNPY6w0OR5E5lPdAeQj /0+b0IiWWmn8nIE28WqK3rmhQvjUSPSADEfUmiWogw3jjiTp7+pXK32jkbGt5Hk6MWrUR9uy1 kYnq1cncaajI2poAW9K07JGF97mIMWubecD6fC8dXwL8NeyOKeEvhBYvXZuuY+fzq2a13P+eZ cIWuglDiGlFDHZvetEPMP9VNdds4MTdAEix+wIWqk16Tma0HEsLRNLwW41OO1b2QRgFWIxBVU 1tNYOL+nTG+2PMRcu8GU7x/M+lKbr16modb+P6PL8QAyShvtyGEvTz9BwvgDNxzduWJcNRgwr BmGG070ksvaIXoc4oGLkuxAAVK6QlFOiv12IvHXmhUmRLGPtPAG69xhzyoRlEELWTri/gWTSS so2d0+siZG8gggfVuaNbIo6INqrDkSIlTn46wxP0zN2a0mmsQsDF5Wd/7ruNRs/JR5I+MhnHD pi2fQLFvA/PuCg2Gzf4CWyN+06Kjv//enT1+dSgrsWSF8LgFnuJ6Jf1urNIYBJSvpNFg+IgnG F2UWGw+WfcpeJztHuSNemwCL0uwcy5ixuNzMqAqc1kO5OaaeGiquol42FM7vRxlvdpfH1t7h Xref: news.gmane.org gmane.linux.lib.musl.general:14611 Archived-At: On Mon, Sep 02, 2019 at 10:10:10PM +0200, Szabolcs Nagy wrote: > * Markus Wichmann [2019-09-02 21:04:48 +0200]: > > I'd like to know what those weak aliases are for in the many cases whe= re > > they are used to define a public interface. Or, more to the point, by > > what criteria they are handed out, and by what logic the internal > > symbols are used. > > > > For instance, pthread_mutex_lock() et al. are weakly defined, but > > it's a weak alias for __pthread_mutex_lock which can be used > to implement iso c apis (where pthread* is not reserved and > thus may conflict with user defined symbols) > Yes, namespacing, I thought so. But this style is not used consistently. For example, open() does not go that route, even though the name is not reserved in ISO 9899. The other issue is, if two versions of a symbol exist, which one is referenced internally. It seems musl mostly tries to use the internal (strong) symbol, but not always. mmap() has the same mechanism in use, but the dynamic linker references the weak version. > there are other usage of weak symbols, there was a patch > that tried to cathegorize them: > > https://www.openwall.com/lists/musl/2013/02/15/1 > That thread talks about pretty much every use of weak aliases except the type at issue here. Ciao, Markus