From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31179 invoked by alias); 26 Oct 2016 12:17:42 -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 31083 invoked by uid 89); 26 Oct 2016 12:17:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=reserved, management X-HELO: relay1.mentorg.com Date: Wed, 26 Oct 2016 12:17:00 -0000 From: Joseph Myers To: Florian Weimer CC: GNU C Library Subject: Re: Evolution of ELF symbol management In-Reply-To: <2e86a3a6-3ad3-6834-4c6c-64836a956dbd@redhat.com> Message-ID: References: <9727f95a-df3d-ec11-8c1d-9b7ea6cbcaac@redhat.com> <2e86a3a6-3ad3-6834-4c6c-64836a956dbd@redhat.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-SW-Source: 2016-10/txt/msg00461.txt.bz2 Further consideration of the __libc_* approach: There are some cases that should never need public aliases: (a) ISO C90 functions (no aliases needed unless called from macros defined in system headers - such macros should properly call C90 functions by aliases in case they are shadowed by local variables in the function calling the macro; the function names are reserved with file scope / external linkage, but not as local variable names); (b) obsolete functions (even if we still support linking with a deprecated function because it's in an older standard we support, we could say namespace-clean use of it isn't supported); (c) if multiple public functions are or should be aliased to each other, e.g. for long double = double, we could have just one __libc_* alias between them. > Maybe we need to take a step back and ask ourselves if we should use symbol > versioning to address this. The two blockers I know of are purely static > links, and the design decision (no doubt for backwards compatibility) to > interpose versioned symbols with unversioned symbols. The latter is difficult > to address, but if we could make the change somehow, it would enable a nice > performance boost in the dynamic linker, too. But it certainly looks like > that for the static link case, we only have the header files we can tweak to > achieve what we want. And symbol versioning cannot help with the API issue of C++ compilations being forced to use _GNU_SOURCE because much of the libstdc++ implementation is in the headers and wants to use libc features outside the libc subset defined in the C++ standard. That requires public API aliases for lots of functions (maybe for constants, types etc. as well). -- Joseph S. Myers joseph@codesourcery.com