From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2059.outbound.protection.outlook.com [40.107.104.59]) by sourceware.org (Postfix) with ESMTPS id 9F4573858425 for ; Thu, 13 Apr 2023 12:38:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9F4573858425 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.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=O2GjGWWMxKgRBS7Z/N2aQ9t3Co2IRwraEJxU8bRL4a0=; b=GGJfFxRLI1jtFrcbHrl9kCJ/uEdsgIv6FYDqnKQm8db5hZpQN1oO3tkDkH5i2nJ2s/MsMk/nRZ76hM7ti3Ng9bsseVR1zVFNLJdaLnouTreLa/C3KqQCWUA04zF9i0auolQIj70iOoXkbB3DL1ID9DhCe+bo1pRRe0LqVzmhGBk= Received: from DU2PR04CA0351.eurprd04.prod.outlook.com (2603:10a6:10:2b4::10) by DB4PR08MB9214.eurprd08.prod.outlook.com (2603:10a6:10:3fa::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 12:38:48 +0000 Received: from DBAEUR03FT060.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b4:cafe::43) by DU2PR04CA0351.outlook.office365.com (2603:10a6:10:2b4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 12:38:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT060.mail.protection.outlook.com (100.127.142.238) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 12:38:48 +0000 Received: ("Tessian outbound 99a3040377ca:v136"); Thu, 13 Apr 2023 12:38:48 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ae54e345fb5f653a X-CR-MTA-TID: 64aa7808 Received: from b3393f858af1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A6BBFD29-52C2-42A6-83C5-0D38089CB598.1; Thu, 13 Apr 2023 12:38:42 +0000 Received: from EUR02-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b3393f858af1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 12:38:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AFSQGI/dU3MzPHeVYv8iVqkCPJ8XyShXLIKg6sIDAiyyKskEsVa/YhLJBUSLsu7Jo/sJjG99lCRFjjHjSvR0FoaT7YmycRLFGKc9L+WMrqmlYBCTKKVEeNCTdQXA/BfP8GC5KJl5Aiai5RqI/0JMOUSuwL1pDCRZWHoZ/V4uwIzSC1g1vgYmDg31W1oBbal5IBzqySTHs4QPYkhaRo3QPAJZubG6yNiRwLUFbRsq67vohkc6SvYTEvyy//IfeC9TXinadgINZkhrzyeCpFXrIXstzK220mQfILFfBvN0md4RZqPe4vDLPr2iiBKvHLGEfkCgKMKP5WbZOsWfRJocrg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=O2GjGWWMxKgRBS7Z/N2aQ9t3Co2IRwraEJxU8bRL4a0=; b=eCrZmrcPh5zj71agDUzTZQAEhUSLelHjFa2RwKnPs2KgKNxECJMk28iP5mNeVvHIHwVQRV1ShMszPQ3ODB9qkf33d3xhqvDKq4aexayxtUcoLux1UbtWuOQXP9Tpq58PXgSBVzcinChg6tWWvj7DkveDTmCbwOi9SrRf+8lBY4gyys7SBW62zdHsD97IUAyRqZ+QLlYEbaSjPOZGm/4Af7uF9p/X9127CXM/pMU606+/jyyRTRyvqdQesuR4e6FOhKzQHrNrBFqss2F06R+qYts5JhfsnhafB3LuMVua9VEiSKoZJbn2rf84sgo+W7VjsicbbrLDslgVhxDT94CmFA== 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=O2GjGWWMxKgRBS7Z/N2aQ9t3Co2IRwraEJxU8bRL4a0=; b=GGJfFxRLI1jtFrcbHrl9kCJ/uEdsgIv6FYDqnKQm8db5hZpQN1oO3tkDkH5i2nJ2s/MsMk/nRZ76hM7ti3Ng9bsseVR1zVFNLJdaLnouTreLa/C3KqQCWUA04zF9i0auolQIj70iOoXkbB3DL1ID9DhCe+bo1pRRe0LqVzmhGBk= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DB9PR08MB7179.eurprd08.prod.outlook.com (2603:10a6:10:2cc::19) by DB3PR08MB8891.eurprd08.prod.outlook.com (2603:10a6:10:42a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 12:38:38 +0000 Received: from DB9PR08MB7179.eurprd08.prod.outlook.com ([fe80::242d:33fe:1c48:bd8]) by DB9PR08MB7179.eurprd08.prod.outlook.com ([fe80::242d:33fe:1c48:bd8%6]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 12:38:38 +0000 Date: Thu, 13 Apr 2023 13:38:22 +0100 From: Szabolcs Nagy To: stsp , Rich Felker Cc: Adhemerval Zanella Netto , libc-alpha@sourceware.org, janderson@rice.edu, Carlos O'Donell Subject: Re: [PATCH v9 0/13] implement dlmem() function Message-ID: References: <298b04a6-3055-b89b-59c1-4cfbe955848e@yandex.ru> <81749d04-8cdb-de0b-b88e-24347ed535ba@yandex.ru> <729710b5-6dae-d5f2-99ee-6923be5e627d@yandex.ru> <20230412182043.GI3298@brightrain.aerifal.cx> <08d9ca95-112c-d85e-8e82-7a595ef4d051@yandex.ru> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <08d9ca95-112c-d85e-8e82-7a595ef4d051@yandex.ru> X-ClientProxiedBy: LO4P123CA0230.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a6::19) To DB9PR08MB7179.eurprd08.prod.outlook.com (2603:10a6:10:2cc::19) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR08MB7179:EE_|DB3PR08MB8891:EE_|DBAEUR03FT060:EE_|DB4PR08MB9214:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a06870f-b274-430e-3043-08db3c1c078e x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Md3Y+47T3dcJj0qXqVgdOqAZ4LWp0vHcErCa07euTF3wBpc+XxyOVlggjTUoHt/oEx7+4PhmtCJbDNwarYuolhsyNoqliY72UmxxQPCb8Vu0RpqEWbvqxr+Vq1iobK0yG4INKLDTEkpI2rH8ta+tozXaaEZ+X//HF32gpXUdBqsLwP0JhYudye6let6E2TzfM83AdXpPIHrv9tUwZBMzfwzyGNd8FFNLStQE8Cv5l2Nstl13eHc7wSfZm2OE0+hS4+UdlfdUJTEmrm+h4NJ9en6jSfXs3o9J5RkcywYjSHvp0jjuvdOEaDsa/vNiIKntKyMFp2DtDAKeOh1LsibfNdZaUvSObupkR1vNNuJ7FN1F5pdkzo1WW7UiWZnjp09ynkjxReJjUYtHJCemWFCLd8NxTM3YfVlo5dkCNuAzXvQdCp6feyvDsDkuh2jLCx0Oe3LBdMxxp4Bc66zAAO++cxkXyFaDVZDmN6CEyI4GivLjUznksozuOclXIf20ShNPIV0k33EdqAiDdhIA+4g12WsdXvJsbQvGXF/B1i63V/40DUcnnBJL0UvGs0yt2NcB X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR08MB7179.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(366004)(396003)(136003)(39860400002)(376002)(451199021)(83380400001)(38100700002)(186003)(66946007)(66556008)(4326008)(6486002)(66476007)(316002)(6666004)(110136005)(54906003)(478600001)(86362001)(36756003)(41300700001)(8676002)(6506007)(26005)(6512007)(8936002)(5660300002)(2616005)(44832011)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB8891 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT060.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 1455b5e8-569a-4415-5e6b-08db3c1c003d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yy4bNjiG5hf+EGsOkp10R0A64NLVG5WcZKkpDKquKXvFKKUVTrHSDmAHvxSI11P4A2ZAS5XeK9Egil8z/ocasteDApmCBZRy7kLICQKgMxpUqtrECsvLnC3AKR0435Sqq0hbeUyh2b26t1jwuG2e94bUt8OBhwydUtpxh+J8VOkSh3v0UerfGSAU7G9IQc1hPGiHBcSJbLQrt37s1ohwz/lOAdypyNOl4V8aGd33IO6jeOOSdSkn9GCENpQzGhv6bh/FXcxCidaoco3L47weLTOB1NZB18T0uFb4/M7HjMkMqWKCpaNAdw5vGLarN7jiQVPm5uhJXWbOIG/CXtyDXzVT5+sK1RPtJYve+ljiKdUfw4QhamSwbJiAcrEMJfSaX82thSXOzIg0Pm5TBEuwb1bagFWFeFLUI1GFzUF0UH156o7q6uZoZnz5r3ZE5sozw5mFHW9gD24EAzRnYlc4fOBiH5WQgmK5zKkv8Bbtc1WdsizY3TbtlDlSYWM/CfiNMwllF4Q6/W0A4oFCib22qMaMBPCfTpU4UaSjKriZVUy7yptVa1vjJrKkgdP3lUGjJg7AseVueRvHJu/RzYz2Is4tzJFcEe+UrYqxCsMO7dg5qdAb9H5j6UFF+L+LjRg+chcbGqNnMfpsnrYG1Pbpa2cnlUk2AvTg6aPykA8OI+OW4g7Sx6S0j9kejs+wAYDQcVQ2XbLq6cZAIcS3BLsGLw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(39860400002)(396003)(376002)(451199021)(40470700004)(36840700001)(46966006)(83380400001)(40460700003)(336012)(2616005)(186003)(2906002)(36756003)(40480700001)(86362001)(82310400005)(36860700001)(81166007)(82740400003)(47076005)(356005)(6486002)(316002)(41300700001)(8936002)(5660300002)(54906003)(478600001)(70206006)(70586007)(4326008)(6666004)(8676002)(6506007)(44832011)(6512007)(107886003)(26005)(110136005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 12:38:48.6410 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9a06870f-b274-430e-3043-08db3c1c078e X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT060.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR08MB9214 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: The 04/13/2023 15:01, stsp wrote: > 12.04.2023 23:20, Rich Felker пишет: > > On Wed, Apr 12, 2023 at 11:00:19PM +0500, stsp wrote: > > > 12.04.2023 22:23, stsp пишет: > > > > The same "lazy relocation" can even be > > > > applied to a regular dlopen(). > > > Of course it can't, as dlopen() is expected > > > to call library ctors. So only with an optional > > > dlmem() flag such behavior should be performed, > > > in which case dlsetbase() should also do the > > > final relocation and ctors calling. > > Have you not realized yet how far outside any concept of "reasonable" > > this ever-expanding contract is? > > OK, consider this small proposal (not dlmem): > > RTLD_NORELOC - new flag to skip the relocation step. > > dlrelocate(handle, base) - new call to explicitly > perform the relocation (and call ctors) that was > skipped with RTLD_NORELOC flag. > > That alone already solves most of what I wanted > to achieve with dlmem(). Namely, it allows the > user to specify the relocation address he needs. > He does so by manually moving the solib image > to the desired location, and then calling dlrelocate() > with new base address. > > Could you please tell me beforehand why that > proposal will be rejected? it does not allow handling relocation failures sensibly, does not specify what happens with dependencies and exposes half loaded modules to users with unclear use-case or semantics for them. > > Whatever happens, this whole proposal is going to be rejected, over > > and over, > > I believe you, but the question is still "why". > In all the other projects I contributed in, the > proposals were in most cases getting the > change requests. And in glibc, the only available > change request is to drop the proposal? :) if you fix an actual bug that's accepted. you are adding a new interface without gathering consensus that it's a good idea at all or how it should work. > > and the more effort you pour into engineering it on the > > belief that it will somehow eventually be accepted, the more > > disappointed (and maybe angry?) you're going to be at the people who > > have to keep rejecting it. > This is a wrong assumption, because in a > worst case this code will make it into a standalone > loader. So far I know how to do that only until > glibc changes one of its core structs, like rtld_global_ro > or link_map. With every such change, the loader > will stop working. So that would be a very unfortunate > and unreliable solution. I'd like to avoid it, but > there is no risk that my efforts working on that > code will be wasted. when i said you should write your own loader i expected you to create simple stubs in memory at the location you want them to be and bind them to a library that is loaded by libc (so you can connect your weird world with the libc world). it looked like a simple solution to me, but i still dont know exactly your requirements so in a sense we still don't have a well understood use-case for any of your proposed changes. so maye the use-case is where you should start.