From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id 7F2C4389851E for ; Thu, 17 Dec 2020 20:55:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7F2C4389851E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=fw@deneb.enyo.de Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1kq0It-0000db-WD; Thu, 17 Dec 2020 20:55:16 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1kq0It-0005EB-Rf; Thu, 17 Dec 2020 21:55:15 +0100 From: Florian Weimer To: Ryan Burn Cc: Ryan Burn via Libc-help Subject: Re: Trouble with portable linking References: <87lfdwdwb4.fsf@mid.deneb.enyo.de> Date: Thu, 17 Dec 2020 21:55:15 +0100 In-Reply-To: (Ryan Burn's message of "Thu, 17 Dec 2020 12:47:44 -0800") Message-ID: <87zh2ccfv0.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2020 20:55:19 -0000 * Ryan Burn: > On Thu, Dec 17, 2020 at 12:14 PM Florian Weimer wrote: > >> If you want to be compatible with glibc versions that check the >> embedded soname in symbol versions (which is not visible in the @ >> syntax), you need to build a stub library that defines the required >> symbol versions in the right shared object. There is no way to >> achieve this with .symver directives. > > Thanks for the response! Could you elaborate a little more on how I > can build the stub library? Here's a script that generates such a stub DSO from an existing full DSO: It is not completely correct for data symbols; that part needs a bit of tweaking to get the alignment right. The resulting assembler file is architecture-specific because the object sizes and symbol versions are. > If I understand correctly, newer versions of glibc will resolve a > versioned symbol even if the embedded soname doesn't match. Is there a > way to explicitly define the soname so that I can specify it to > libpthread? The link editor copies the soname of the shared object that contains a versioned symbol definition when it generates the versioned symbol reference. That's why I think you need that stub DSO. It's the only way I know of that actually works.