From owner-freebsd-arch@freebsd.org Sat Jul 30 07:09:15 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 187C4BA9AF8 for ; Sat, 30 Jul 2016 07:09:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id F2B06181D for ; Sat, 30 Jul 2016 07:09:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id F2199BA9AF6; Sat, 30 Jul 2016 07:09:14 +0000 (UTC) Delivered-To: arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1C13BA9AF5 for ; Sat, 30 Jul 2016 07:09:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C6BE181C; Sat, 30 Jul 2016 07:09:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u6U7985Y005777 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 30 Jul 2016 10:09:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u6U7985Y005777 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u6U798WA005776; Sat, 30 Jul 2016 10:09:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 30 Jul 2016 10:09:08 +0300 From: Konstantin Belousov To: Daniel Eischen Cc: Ed Schouten , "freebsd-arch@freebsd.org" , Ed Maste Subject: Re: lib/libc/Versions.def: new symbol version for 12.x Message-ID: <20160730070908.GM83214@kib.kiev.ua> References: <4647100A-67D9-416D-8E34-4CC1F450227A@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4647100A-67D9-416D-8E34-4CC1F450227A@freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2016 07:09:15 -0000 On Fri, Jul 29, 2016 at 05:37:00PM -0400, Daniel Eischen wrote: > They were originally modeled similar to Solaris (and Linux to some extent, IIRC): > > https://docs.oracle.com/cd/E19683-01/806-4125/solarisabi-8/index.html > > I think there's not much point of changing the naming scheme now, it's not like it's visible to the typical user. The comment in the Version.defs file pretty much explains everything. What we have currently in the symbol versioning scheme definitely has nothing common with Solaris, and has only slight resemblance to the glibc variant. Our rtld implements the GNU extention of the original Solaris versioning, but the way we provide actual versioning in shipped libraries defeats some useful parts of the functionality. The original Solaris scheme, AFAIR, has the goal of preventing binary linked to a newer library, even to try to start with the older version of the library. Solaris libc, when introducing a new symbol, also added a new version to the list of versions implemented by the library. On startup, dynamic linker verifies that all referenced versions are present in the library. This is needed since default binding resolution is lazy, and missed symbol goes undetected until called. As result, applications fail hard somewhere at runtime, surprising users and corrupting data, unless checked. We do exactly opposite, all symbols added during the CURRENT-X development cycle, are added into single namespace. This would be not too bad, we do not care much about CURRENT ABI until it is backward compatible, but we also merge symbols to stable branches under same namespace. The result is that you cannot distinguish older and newer libraries from the same stable branch at the startup linking. >From what I remember, both Solaris and glibc create new namespace for each symbols addition. GNU scheme has more flexibility by allowing to change ABI of symbols, and this is the only feature we use in limited form (we cannot provide ABI compat shims for symbols which change more than once during one CURRENT cycle). IMO it does not make sense to change current scheme without fixing the bug I described above. Any change in naming makes the things even more confusing, and imposing the pain only for somebody aestetic feel does not look right.