From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2065.outbound.protection.outlook.com [40.107.241.65]) by sourceware.org (Postfix) with ESMTPS id 17BEA3858D28 for ; Fri, 31 Mar 2023 17:13:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 17BEA3858D28 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=B4kUutQrfnBuO63cc4+aycogsDa1+9cLCGhOD6tckpY=; b=siN/EYXGP5vFkwWnnMMImV2RmVG39lFtHjmvVpkRfAVBl9BdkujpjfvZfeLSyUP2epT3OJcI4C6ll6pJrATtGkUyTFh6jHhXmqz1kpUS5kPeX9GhBVQuYRy0IIJY97bwyK5Wh7eHCIjoBttcAatSdmdLUIBWSYxp6Dcnre+uDmE= Received: from AM6P195CA0045.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:87::22) by DBBPR08MB6217.eurprd08.prod.outlook.com (2603:10a6:10:201::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.23; Fri, 31 Mar 2023 17:13:22 +0000 Received: from AM7EUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:87:cafe::bb) by AM6P195CA0045.outlook.office365.com (2603:10a6:209:87::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.22 via Frontend Transport; Fri, 31 Mar 2023 17:13:22 +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 AM7EUR03FT041.mail.protection.outlook.com (100.127.140.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.16 via Frontend Transport; Fri, 31 Mar 2023 17:13:22 +0000 Received: ("Tessian outbound 5bb4c51d5a1f:v136"); Fri, 31 Mar 2023 17:13:22 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 9e748f01fd646010 X-CR-MTA-TID: 64aa7808 Received: from b55a7cd07bff.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6F2C09CF-46D2-491D-9714-D85F2FFA2AA3.1; Fri, 31 Mar 2023 17:13:15 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b55a7cd07bff.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 31 Mar 2023 17:13:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KkYbksRHfjgAVP8CaWYjSrwLBxGM5nrnuHYwSOMbOMTK64yMWI0gEmWTcPGESLUEfIhinP4Xfr4pH4pPSppHv+5Qa1WO5kCIBsOyADt2OjWsrwFQ0bhYUn9Xvav4svhcR99nU6myuh9c3HH9U+F1Bk8hSIrBQJkm1el7jBUo8lpy5JByueif69KrlUs12zrnZ5jnLMIv3RMeE7xa+qhYWwnWCUbyjmrDPA6KXHX4sXiTS4Sb6tRXFOd7x/r2xqjrbIOvW6v5sm//xCuKsybbCPb/tcGI0/9m8PD1nrIKFHMH2xcqDeqxVeXD2emOjIJn3Kl8JOoZB9o+if5ZxECnoQ== 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=B4kUutQrfnBuO63cc4+aycogsDa1+9cLCGhOD6tckpY=; b=gZS5s41ey6LVWF0eyOwjthGMAxUWa6WsUF087V+bGk3uTvmWzAbX6qY/XQx/7bXfnipXbx1+VzSpROyUdAnuB0eI1d2y/0kb7jCbvPFxNOuXHTB4Wu/d8LnDZHZfytyGa4bk+fEThYLNP5IdwuBWlNnBRCspytSbSVsIrUfmCfgE03NNKSUa7saKQur6GKweOA5f6i70fESklWVojl4WxZeygNv1zsLqCiqHEbxm34GtHapqlNd1/qggT6eIV9GKw6Oh5HstE9sbMXzd9OjZJVjuc4l2V6LkF0A9/8MbXZrGwSxQKhwEryMpndXhsGitRSH/p0NTr4FpkKJK5xjMGA== 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=B4kUutQrfnBuO63cc4+aycogsDa1+9cLCGhOD6tckpY=; b=siN/EYXGP5vFkwWnnMMImV2RmVG39lFtHjmvVpkRfAVBl9BdkujpjfvZfeLSyUP2epT3OJcI4C6ll6pJrATtGkUyTFh6jHhXmqz1kpUS5kPeX9GhBVQuYRy0IIJY97bwyK5Wh7eHCIjoBttcAatSdmdLUIBWSYxp6Dcnre+uDmE= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from PAXPR08MB7172.eurprd08.prod.outlook.com (2603:10a6:102:20a::19) by AM8PR08MB5569.eurprd08.prod.outlook.com (2603:10a6:20b:1de::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.23; Fri, 31 Mar 2023 17:13:08 +0000 Received: from PAXPR08MB7172.eurprd08.prod.outlook.com ([fe80::4045:c746:9ec9:7bbc]) by PAXPR08MB7172.eurprd08.prod.outlook.com ([fe80::4045:c746:9ec9:7bbc%4]) with mapi id 15.20.6254.024; Fri, 31 Mar 2023 17:13:07 +0000 Date: Fri, 31 Mar 2023 18:12:53 +0100 From: Szabolcs Nagy To: stsp , Adhemerval Zanella Netto , libc-alpha@sourceware.org, janderson@rice.edu, Carlos O'Donell , Rich Felker Subject: Re: [PATCH v9 0/13] implement dlmem() function Message-ID: References: <20230318165110.3672749-1-stsp2@yandex.ru> <2f3a10fa-4f79-7f9a-6407-d227dbf31935@yandex.ru> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2f3a10fa-4f79-7f9a-6407-d227dbf31935@yandex.ru> X-ClientProxiedBy: LO4P123CA0446.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a9::19) To PAXPR08MB7172.eurprd08.prod.outlook.com (2603:10a6:102:20a::19) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: PAXPR08MB7172:EE_|AM8PR08MB5569:EE_|AM7EUR03FT041:EE_|DBBPR08MB6217:EE_ X-MS-Office365-Filtering-Correlation-Id: ef9bf56f-556f-45e6-ec90-08db320b3b4c 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: j5I2oxaub2V17UHiESh8Fu+loOPdB65+SRfL4BbP5wnz/wp+6F7AvgWZtAfLIzax85jTHTngxIpwlu3yOaCuE+s1r5YFr4P/DODlSO7wCY2bYQVcGYmeOlt0mrpd7RcZcu1TTV1wIfTavHBdQ18okDXTgriSrT7sIX30NhBgpGoUre3RVEQciv91smfa1UYKF8oC/J9h2VcJCOhHmRcorPoepyKb4HqTr/5itP+KxP4XJve4KMeJSDpCYKhkziZbOPPEa9XeHfbwyddq5M6tofLAR54ZtLpPdeOenVLTKbxh0KbF17f5HnJyD6LC4S9VqeFqJExoK02oAeZZeZ86g7sljvBHUetn7kmOFOoYIHQriDNuVsqDOVgJuRerfAaGbw+moJlYJtS2zevf34l7rWoiGN31OtTP7XQMpR9WYBkkyxGbElPvKE9wRCZmnCIuRejMcBNnJm4iwgdwUFbJfZeWVYtGRNHCk5hQLMf+97IN1QsVMvuNcG0YQomLsBMx2uDjPcAbg8PtkR3CzqJ2KVNcN/DAjJoMZA8R3MbiRdxV5+2ef9+ecm7lObQ8esC7 X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR08MB7172.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(346002)(39860400002)(396003)(366004)(451199021)(186003)(6666004)(6506007)(26005)(83380400001)(2616005)(41300700001)(66556008)(478600001)(66476007)(66946007)(316002)(110136005)(8676002)(38100700002)(2906002)(6486002)(36756003)(5660300002)(86362001)(6512007)(8936002)(44832011);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5569 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: AM7EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c8aa2a06-6d8e-4b00-ceae-08db320b3232 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7RTEcepmB0zP5y1BVU8n6nw9eXZK9FAMjvMj813AVfN2WE3kIem0F2tXZOTkBpxvaUhzz8NRrp0WCjehXckpYSahbb5UGTOQ6EipccPHpvzj5KmfRfw28rt9eIX3kLQ1nRomJZ6qI86B7ETx/3ZXaK9mtKaAFl3xbdRIJlk1PgsvNy78wu6W1iS4PguEXzQ5uig2mTrWH2nHiUFx5pYvo+3aRGpN2hk19U18A3uC7kYnqEKkxu3SSDJJuEoOB1bf6Ra7cHyp5McH8W4qgIG+4S2xxEoBK7WXm0EGCeMiiRhHcmHB4eZTmvwFu1fjRSobIntHoFuizekh+2YGjuKkhECC5kHRC4jX2NNZAeJJ7yB5m9dvjG81t9Yv/VV6uDe6Py/4B5To2mK9A6nYvawmt+Q+Zo4ZO95NwxTIWEhlmLB4VeqA4zjYr82OdPF0SxfgZwp4uhfAKKcuJysOqdSxNsaKrGI6KtiRAlx+ut0Hngit6Y1BZLVOzqFGh+xQskQ0eFU/1rtiG9+WEf5bh5ikdcmFGCxwqWoPQ+3OTWDPuuPPjbEabe5YfCiyFTBnSdGk2XORECi5WvW9Fncwto2Ihk+b4Wjc0bcFKog/2xSV5W4yIVms8EvWHRBaZOgXDX0rwHeljHWMAAukOPiunTAulgpedo3mVyIW+4hPsw843Gi0M4VziSdHE0y6/AoR48Zu0p4VoKapykVSsHah8An7NA== 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)(396003)(346002)(376002)(39860400002)(136003)(451199021)(46966006)(40470700004)(36840700001)(83380400001)(36756003)(186003)(6512007)(6506007)(70586007)(478600001)(70206006)(6666004)(8676002)(41300700001)(8936002)(336012)(81166007)(82740400003)(82310400005)(5660300002)(356005)(44832011)(2906002)(6486002)(26005)(40460700003)(2616005)(47076005)(40480700001)(316002)(110136005)(36860700001)(86362001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2023 17:13:22.3202 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef9bf56f-556f-45e6-ec90-08db320b3b4c 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: AM7EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB6217 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 03/31/2023 20:12, stsp wrote: > 31.03.2023 17:20, Szabolcs Nagy пишет: > > The 03/29/2023 18:18, stsp via Libc-alpha wrote: > > > Just to be more constructive, here is the > > > example: > > > > > > void *dlopen_with_offset(const char *file, off_t offset, int flags) > > > { > > this api requires no libc change: > > > > dump the contents to a temp file and use dlopen on it. > > This doesn't work for my use-case. > dlmem() can optionally preserve the destination > mapping, which is not possible by definition with > any file-based API. loading from special place and loading into special place are different things. you gave an example of the former but then talk about the latter. loading from special place can be solved by writing the contents to a temp file and loading that. loading into special place is difficult especially if you want to control the details of segment mapping. in case of your dlmem design it passes down a user callback that runs under dynamic linker locks to map segments. the interface contract of this callback is not documented, so it can deadlock and exposes dynamic linker internals (makes implementation changes harder later). if all you want is force mapping below 4G then you should have asked for an RTLD_ flag (which may not be useful enough or may not be supportable on all relevant targets, but at least does not need significant loader changes).