From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38893 invoked by alias); 21 Oct 2019 16:42:33 -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 38884 invoked by uid 89); 21 Oct 2019 16:42:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=providers, H*i:sk:87imoin, H*f:sk:87imoin, pollution X-HELO: EUR02-HE1-obe.outbound.protection.outlook.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=605ES3SGP/vF5j83wqVU/pm7gaoCVPhr3rP/bNOduag=; b=XSPcf1CCMeGB/FYV59/jvkkMpOu8tekWUQ5lesdC/67YgdRnXewROa6dPdEXR64pGdzRhkO81BlhZqPii3VsIwmuKXBX/0A/3gi+ujGUlJmaxYd8bCSK4/tcR5Wk5fT4mR2Nv8FVPFx3Ml4K3RsmZ0Dtby6sE44LSpU/nEnElII= Authentication-Results: spf=temperror (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;sourceware.org; dmarc=none action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) X-CheckRecipientChecked: true X-CR-MTA-CID: afc286c0ec598255 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=STyXcta1mFDamVKsKMEZw/qDfab3ELbWIuVWPKzKqRxmB/46FdAeEpMvYV8Vfh//wfsVhnUtcixG2paaPmwRdvG3yuG8PtJKysLgznpmb8Pu6uwDqoepMf8mdEOKZdbNbcFwWaSnJqwJ75K0x2DLLzrTTrBKTftj/YeW4NIZxl0Oylt3NUuNNWaXfiYzLDTO56354UNXRpU8TB0wOdcGCNiiowVnmkQdxL+y7V3UAtI/2Cb0RMJ4UQCo1DPvFE2ogl17yazzQyYeHe3wT9f2a6OQ+dG4Z6acZha/5PlmAFVvu0pDAdOMwG0ZYQ0cB0vm3ltKhvzNUULErjaljFjcRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=605ES3SGP/vF5j83wqVU/pm7gaoCVPhr3rP/bNOduag=; b=CWo/lG+8mVwUDVfvEBmxeGkc27NPu6J1EBRer68A8svAf/qBb2PdABEcrDRAiix9lG78rKBbl1G8gBaaD1SWcYI+DqvoCLnE9/ieOiHpBCgMOHbwOKsoL+NCCiTySYG0inakxYez11mz/FLeAEF7pg+EycbtR9lBKi92CLqoYRBHwF5xqJyyUH9jjLR8nYZBj1pUQRRL1bRp7AIJI07FZWwUBwlm1HUUzGJH2g99/sFYPxKMY05K94i3qPe6eOs6suYdIPAqgZFCb6tr+XO6NhvYP5KtSanNqckFu9rgRUJlaOM+0hwgC1Ats9qTURuL3jAQDA9nAeQPwlKQPiHhkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=605ES3SGP/vF5j83wqVU/pm7gaoCVPhr3rP/bNOduag=; b=XSPcf1CCMeGB/FYV59/jvkkMpOu8tekWUQ5lesdC/67YgdRnXewROa6dPdEXR64pGdzRhkO81BlhZqPii3VsIwmuKXBX/0A/3gi+ujGUlJmaxYd8bCSK4/tcR5Wk5fT4mR2Nv8FVPFx3Ml4K3RsmZ0Dtby6sE44LSpU/nEnElII= From: Szabolcs Nagy To: Florian Weimer , David Kilroy CC: nd , "libc-alpha@sourceware.org" Subject: Re: [PATCH 1/3] elf: Allow dlopen of filter object to work [BZ #16272] Date: Mon, 21 Oct 2019 16:42:00 -0000 Message-ID: <6cbb4c5e-72e0-507d-fa34-5a70db35c03a@arm.com> References: <4eae391688a6e42b0b75467de265c122e6402668.1571301957.git.david.kilroy@arm.com> <87r23ath25.fsf@oldenburg2.str.redhat.com> <87a79uqqxa.fsf@oldenburg2.str.redhat.com> <87imoinprn.fsf@oldenburg2.str.redhat.com> In-Reply-To: <87imoinprn.fsf@oldenburg2.str.redhat.com> user-agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Szabolcs.Nagy@arm.com; x-ms-exchange-transport-forked: True x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:9508;OLM:9508; X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(4636009)(39860400002)(346002)(366004)(136003)(396003)(376002)(189003)(199004)(305945005)(86362001)(6636002)(64756008)(7736002)(66556008)(110136005)(66446008)(3846002)(66946007)(25786009)(66476007)(58126008)(54906003)(14454004)(478600001)(5660300002)(65956001)(65806001)(66066001)(2906002)(6116002)(31696002)(36756003)(316002)(31686004)(6512007)(386003)(71190400001)(71200400001)(446003)(4326008)(6486002)(8936002)(102836004)(2616005)(476003)(81166006)(186003)(6246003)(6506007)(229853002)(26005)(44832011)(76176011)(486006)(256004)(8676002)(81156014)(52116002)(11346002)(6436002)(53546011)(99286004);DIR:OUT;SFP:1101;SCL:1;SRVR:DB7PR08MB3291;H:DB7PR08MB3292.eurprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: G7i84yJ/RoNPIaEVaODwMFR5B4pOyjie0NP2002dlid0jrQCyZ52bCAXzCvj71bkN8twkMwvTm1AWBoq1X+IBr6bKl0a8GhfHTAj/xG7iN3JL9Qlx+sXshE29/ULLY/yMp44hMaOH8MVsAtHZ8TJxltEmJjteVH9r8plXo21YPOm4VouWNep1q4Fte4btfnaU22s1Oy22RmGhe5rzj3GfG6Vanv7HsKR0QhPIchQ135AeygrJ3KwFfhzP6mDq1kTsxUPiaRTrOcjbeFvoyhlkx+5s9ELDJnBAr3rzlheGhoxs/GwGyluBMsw5Xqdd0ed7eRskIc/kP54f0APaUiyWbA5yFZztVzSXj70Z1OQW62vhxTn4aT9PzjnYI9vGHbUv+JfTXkMeoICngibhsBSqtcMonAXH/f8Mpmj3Srzqlo= Content-Type: text/plain; charset="Windows-1252" Content-ID: <253E1A64FB98DA448233D06D5FC0BA44@eurprd08.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs.Nagy@arm.com; Return-Path: Szabolcs.Nagy@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: bbe3f2fb-3557-470f-1131-08d75645a19e X-SW-Source: 2019-10/txt/msg00625.txt.bz2 On 21/10/2019 15:21, Florian Weimer wrote: > * David Kilroy: >> I suspect that this wouldn't work in my use case though. External projec= ts >> link against the filter object we produce, and don't know about the filt= ee >> (which is effectively an implementation detail). Different suppliers can= also >> supply the library (which may or may not be a filter object), so having = the >> external project link the library differently based on implementation is= ... >> suboptimal. >=20 > If you currently use a symbolic link for the .so link object, it should > be easy enough to replace that with the script. If the link time DSO is > stored under its soname, then of course this does not work, but you > wouldn't be able to transparently inject the filter either, so that > doesn't seem to be your scenario. linker script only works at static link time, not for dlopen. > I'm less clear how this all interacts with dlopen. It seems that you > want a simple alias mechanism for dlopen. In that case, a simple > symbolic link with the soname should work, and you don't need a separate > filter object, either. the scenario is: libA.so and libB.so export a set of symbols. this is abi and there are multiple providers of libA.so and libB.so. one provider wants to have a single libinternal.so that defines all the symbols of libA and libB as they share a lot of code. (1) having libA.so and libB.so as "wrapper libraries" around libinternal.so with RTLD_NEXT would work, but that's less efficient because of the extra indirection, (2) the filter library magic would avoid the wrapper. (3) symlinking libA.so and libB.so to libinternal.so makes all symbols visible when either of them is loaded, polluting the link namespace. (4) creating two copies of libinternal.so with different set of exported symbols would work just waste memory (assuming there is no internal global state that needs to be shared) i think if link namespace pollution is ok then (3) is the best solution otherwise it's less clear, but probably (4) is most reliable. (libinternal.so is a video driver lib and libA, libB, .. are various opengl libs with fixed abi)