Message ID | 90458da8b7b46e806f756c2715c87fc9d2c1be95.1613390045.git.szabolcs.nagy@arm.com |
---|---|
State | Committed |
Commit | 69499bb6eeb4f5d1b3502758208301d21042a783 |
Delegated to: | Adhemerval Zanella Netto |
Headers |
Return-Path: <libc-alpha-bounces@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7D7AF3950428; Mon, 15 Feb 2021 11:56:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D7AF3950428 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1613390211; bh=8/dDhL1LQGgb0rkFzjutSFNml3hgMv2hymhQKmnJHuU=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=FhpID4inhMWVriHWjFMVa5UfRLnqk45YN09kBQdvwiw7K+QQ99yXtad/fcAz7T59C opKq6gr7lmaNSKka1G105gG/d7zjLY+9X3zVgtTFOnQkfdzE8NBqUFC/YAx62Q/3YV A/oQwSYteJjeSe7GKG05zZ9f5XiPs/hmJv/johi4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140041.outbound.protection.outlook.com [40.107.14.41]) by sourceware.org (Postfix) with ESMTPS id 7C9743950422 for <libc-alpha@sourceware.org>; Mon, 15 Feb 2021 11:56:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7C9743950422 Received: from AM6P195CA0099.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:86::40) by AS8PR08MB6102.eurprd08.prod.outlook.com (2603:10a6:20b:23d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.29; Mon, 15 Feb 2021 11:56:46 +0000 Received: from AM5EUR03FT016.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:86:cafe::f6) by AM6P195CA0099.outlook.office365.com (2603:10a6:209:86::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Mon, 15 Feb 2021 11:56:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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=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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT016.mail.protection.outlook.com (10.152.16.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Mon, 15 Feb 2021 11:56:46 +0000 Received: ("Tessian outbound 2b57fdd78668:v71"); Mon, 15 Feb 2021 11:56:46 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c2a4cd72de4c038b X-CR-MTA-TID: 64aa7808 Received: from 35dba45f63d2.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id CB94D38D-D028-4D84-AE8B-CAC209079A87.1; Mon, 15 Feb 2021 11:56:40 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 35dba45f63d2.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 15 Feb 2021 11:56:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SE5TNaXu7XhuPN+IWUPdf0cCwsqqmin+mMMICV4Si0mDXE2IWfsXohnzLIsT18owKatm+WBN2XMRrCnd2xaJPCSWZqGljoUhZVq+4BkawsYrA4n9eUm2GVoCDJyoEvEtd9HwgvFyfVZRorQvA2/eG7eCgyJKNvgJX2mF8/9NrsAHjt6UAa2Wjn6nelZJbTSdml3jXziCqvRVuNDNYDqZlVV3tpJvJ+i5aI0E+k14diqTw5O8CBKVrpPzPUwrbbej0t3Puj/9v0P//Lhejh6n7CkLKvZ3Hh+qMyb3eK/7OZZXAUdZRQkPTKHlUuOTk8AOhy7cDWMOt37sKR5BiN52zQ== 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=8/dDhL1LQGgb0rkFzjutSFNml3hgMv2hymhQKmnJHuU=; b=KgXJNJXBIWQPPpSb0RdUonzFD9yJmaVGy9Xy1AYZLPQ5QGiB6tQyrCTyMqxe33tJUDRElftTRP1WUt8+ZimwmkeZiPAJvcTmZ+mvtK/kqXST4rDXPeUkxkQzG0fLFASzIgcgHndvbiyG19A+6/BUI17isWCot/hb5O2S5PCPQTMwCkYzfyFwrOmoTUpy3rNAGC9SqQjRRV+hO8ft/0Wtpc5wLnomHUFCzHXY2+6GUu1f7vpqT5Vqr3OHb9szEW+TOhAsPnuXwlnTUHT57921vu39NNKsVph1zq77OZzynt90d6dZ0rpWs7Kn2TEB12M9hzcyMaGg8+z/+riSviFg5w== 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 Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from PA4PR08MB6320.eurprd08.prod.outlook.com (2603:10a6:102:e5::9) by PAXPR08MB6432.eurprd08.prod.outlook.com (2603:10a6:102:154::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.26; Mon, 15 Feb 2021 11:56:39 +0000 Received: from PA4PR08MB6320.eurprd08.prod.outlook.com ([fe80::60f0:3773:69b8:e336]) by PA4PR08MB6320.eurprd08.prod.outlook.com ([fe80::60f0:3773:69b8:e336%2]) with mapi id 15.20.3846.042; Mon, 15 Feb 2021 11:56:39 +0000 To: libc-alpha@sourceware.org Subject: [PATCH 01/15] aarch64: free tlsdesc data on dlclose [BZ #27403] Date: Mon, 15 Feb 2021 11:56:28 +0000 Message-Id: <90458da8b7b46e806f756c2715c87fc9d2c1be95.1613390045.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <cover.1613390045.git.szabolcs.nagy@arm.com> References: <cover.1613390045.git.szabolcs.nagy@arm.com> Content-Type: text/plain X-Originating-IP: [217.140.106.49] X-ClientProxiedBy: SA0PR11CA0166.namprd11.prod.outlook.com (2603:10b6:806:1bb::21) To PA4PR08MB6320.eurprd08.prod.outlook.com (2603:10a6:102:e5::9) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.49) by SA0PR11CA0166.namprd11.prod.outlook.com (2603:10b6:806:1bb::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Mon, 15 Feb 2021 11:56:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 78b57189-5506-451c-7faf-08d8d1a8c506 X-MS-TrafficTypeDiagnostic: PAXPR08MB6432:|AS8PR08MB6102: X-Microsoft-Antispam-PRVS: <AS8PR08MB61025DAD709E97D00FCDB982ED889@AS8PR08MB6102.eurprd08.prod.outlook.com> x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4941;OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: hrTCO79b4SruR4dJXh3Bdd/SHpXdbvE6J6DfVqMNKf2wPW327FpM28vTFLISeT09Yf2h0kXDMFFtHZvTluoyIFRJdvIUY6NKPjcW10oLEJnr8SfOYP6SbP8hGR0rA6tTf52ql3pVX0B4GTKTZxY/24ZBQijwN+yXqvqNet7dfA0rGl+uz3vAu+Xcg15uwGiHmB6f74YKNPo2u49lPaODnduuPLpDCFlPy9NkBfvASSYHKTyJtfQLVL85E4UbOAzYbaOVTWBFS2KCFk0z0vJ5rFHpvBIH8eJd+gfPeQNQH+lsrHxeG/781pgK5uHxs40uBQCaTqdecXmGurhdYLd192gT6YOqimLtxfFIGAXYRsLmtbiTyhwIy7X4FPVFHMfq/j6oiX9e7pAgbb1zfJPFjgeSuu1Gxj8+28aCUpBC0hwONx7z45svM1Wze/KXCgoeDmTaMAh5YqoNJ/3aiCt0Ld7dptQ80u2GaEzZh1VWSLE8y3Pjqv8G4z2hojR+d1tJqPddsZTVU1Y6UkKtnwhQRNe9xEhY/QSQebpa9nlXkUJ1hmdzlk1XWl1EmLfegFp8nqCUkE9bNoc5fsL54u+XOi7YplyjYGcdxsYpfvDlh6W2mKxap7/81rAvdmEFI9hGWMZEE2m7vbiN0mI2u5YnwtDZtO6+6JMe6NBT0PbEEJaJqgrAtBSjdEgXqrylMUML X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR08MB6320.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(136003)(346002)(366004)(39850400004)(69590400012)(6512007)(6916009)(66946007)(66476007)(316002)(66556008)(186003)(52116002)(86362001)(8936002)(36756003)(6486002)(5660300002)(478600001)(26005)(6506007)(956004)(6666004)(16526019)(2616005)(8676002)(2906002)(44832011)(2004002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: FqUFe398dEe4xHi1ezTqUySXGrh3W75+CotPgOqD/YiRzaLo6iUkxlrq35fNAp5rpCCrWZLR8chUDHMz6xFFaK0BNux0bqdpnkUzb8YeSK7oCcORWOz6N+I3S/90LQkwXrsTVT+SCdu4YCoXMd46hzslME0RzzZM2lb0sb4OZSVprQx+LBNRESnw7gq2EI+cE32AEpYRCGb9INLBdGK/O60F6QLdiae9HKK07bp8t1FXKx9mPCUC2as45tt8wPBGEij7dlaRW70FhvVxEGVHyppVszraWkSmdNDL9dQdKMnv/6sD7NWqX8scfUmKQhK0JhYk9hAXdWMbBPyIu4nndUV0mbKrieNQ4m4WVNDL5m3c8+Z+7y0WdwzIh1NrUWpfoKuOvQjQxsoRu/OJzlysWT1oBU3pWYiys36VicBr1uHkFf72zL309wigHIjTYyqr6omxNo+p4sofvHCixpqEO7RlQ50nJfB2X0e0mIHh3m5OcylUHFaBx4zVLL8xogzb+Rzi3JkLmLgust4PCMmkFwFKBPWATKyY2n4qBqHRIN9GQKYQr6ceUBnYr9nks445IaRhV58WdeIsS1ol/GcTKVO/chQwtTjpfF3BdYR4Wfgez3hvcZdfAzwuL8i26pdsIiFj8PsFQ5DAXc0cJafbohiHgKj9btuVcF7FCLXh2SRVoFaNXUt2yIOoAKaatwfmHa/qQRA8f39NTEQdCrmkKjEtYmodkriFwLEPmtdfUuoa/eYEfALhzHGDD9UveaLyx2IPW8v0Q8u2VLo7dPq+rw57n6+1w56e9fV7Snexr4LYKwM3qBBb3U4ZVuokxLwFJ9de9U1E7C4R7sKbxgpr/0SNCALhQIdmz8OkDQxiMW3iE9qBTqcCncXfB/MqFAVwV0T9Wa0qry4nm448Bois1ZKKuc7IhvrWKWVgwEkeekmJ3KTotAuz+vL1AsIam+7CZF3O6vLtbx/imSj1/9bYbTCjYbrFDrB8r2DDfq0kZiCpwJvirYE/V42jo3xPLimu7xssJ8uEbhyNpRaoyhQ8WZ0bcUE+Sth1jFLGzfD6FftDTqQ5xe63W3gKAoLSVO32CSJr+lXJ2+PnZ3SrMM8fo3ELkcXlW1rgL9iDcFJ1onUbnbgwV3QY1mukZyyf9KY17NnkpCAVhg4Bs3tKY3Lt/bYz2juSwPJnhb6flG3cPRGsCUNyJmtmc/1H2MMd7n7up0MfCY2/ZzrBPWQRiJkvD9qkDp67m2/uiAu/mzhWQyGn+0A70HxQchOtHMTR64Nl+lpHGLv2LLIWNLVqdpcMBgfSOEkuaHiFK6useNQSafIqoH96fEWJbwWAh23JW2AR X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6432 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT016.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 8977f21e-9d5e-4530-2fb6-08d8d1a8c0c2 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +g/+yzw/tJ6RkBfQyM4uhjeRCunBxlIlotxd5ogPfoFSxY2LKZv8DUpWoB9JRo/9qcZ+E4Rr+fdJrB+QtFTqH8U3+ahm09bFDrijeszZnYzLXqOqTa9XyOpwwecFwBfA4L7zbcS3Wp803mGgFY/44R09PBK8wEP9aAKeGuYOTKM58Lr4IfoQp6s9AbW4hJymm4/PdnilL3yJZEC9Rdo8FttjyttFwLYv0H5mXklI1HB6U2j38Y6X7HRPuONFL6G5iR9wpOcSGQPBURXV/RgdxoSIP7TLM9Gaqzb3pRyjGmlX5UF73o4Nc3hTynE5I6NLON8UC7q7CkITdryNhtacxLFNLv5DmyvswHTAI+i83KYmczCp1Ot9nF9ArseZwBf707VR05uwtVKOkhV/qHDr9DkQsdJzzRTe7QnhMZlyApYDLKqLmsdEsRxdDSg1mAI32kBSy4o5OC1QTYDoaFg0AJhEYXAr712E4/u3JByO2ULyh6Egs3Moyu704ko66seOg3POLVA16tUxt5U2P7HZ2K05+Iqg8VLWyteiK8SosX7U9TZduoaz7al8w6HIREqamowPAxkxzLSC4Ijbf3sf5PmW8a5sHFujVPHBKtA0PR8FI0RTsMJW8iWwS26+6rsXlpkaCyE7c2Aj4xGYrX4ZehUosI9mPD3S0EBDIvlITyqojgTDnru015glt2ZuXSpFnFmsCF3y7YYacak0W4TPdBMId53WGN5Qsh5PCSb9VbEQextopA/s5H3DLsW45MRDcVWvUgZN6KCg7RdLiiEZQeNrJHRpC+5oJUiUO69yvHg= 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:(4636009)(396003)(346002)(136003)(39850400004)(376002)(46966006)(36840700001)(2616005)(26005)(336012)(69590400012)(6666004)(86362001)(956004)(44832011)(8676002)(16526019)(186003)(47076005)(5660300002)(36860700001)(8936002)(2906002)(6486002)(6512007)(81166007)(356005)(316002)(478600001)(36756003)(6916009)(82310400003)(6506007)(70586007)(70206006)(82740400003)(2004002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2021 11:56:46.2543 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 78b57189-5506-451c-7faf-08d8d1a8c506 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: AM5EUR03FT016.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6102 X-Spam-Status: No, score=-14.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_SHORT, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY 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-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Szabolcs Nagy via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Szabolcs Nagy <szabolcs.nagy@arm.com> Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series |
Dynamic TLS related data race fixes
|
|
Commit Message
Szabolcs Nagy
Feb. 15, 2021, 11:56 a.m. UTC
DL_UNMAP_IS_SPECIAL and DL_UNMAP were not defined. The definitions are now copied from arm, since the same is needed on aarch64. The cleanup of tlsdesc data is handled by the custom _dl_unmap. Fixes bug 27403. --- sysdeps/aarch64/dl-lookupcfg.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 sysdeps/aarch64/dl-lookupcfg.h
Comments
On 15/02/2021 08:56, Szabolcs Nagy via Libc-alpha wrote: > DL_UNMAP_IS_SPECIAL and DL_UNMAP were not defined. The definitions are > now copied from arm, since the same is needed on aarch64. The cleanup > of tlsdesc data is handled by the custom _dl_unmap. > > Fixes bug 27403. > --- > sysdeps/aarch64/dl-lookupcfg.h | 27 +++++++++++++++++++++++++++ > 1 file changed, 27 insertions(+) > create mode 100644 sysdeps/aarch64/dl-lookupcfg.h > > diff --git a/sysdeps/aarch64/dl-lookupcfg.h b/sysdeps/aarch64/dl-lookupcfg.h > new file mode 100644 > index 0000000000..c1ae676ae1 > --- /dev/null > +++ b/sysdeps/aarch64/dl-lookupcfg.h > @@ -0,0 +1,27 @@ > +/* Configuration of lookup functions. > + Copyright (C) 2006-2021 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library. If not, see > + <https://www.gnu.org/licenses/>. */ > + > +#define DL_UNMAP_IS_SPECIAL > + > +#include_next <dl-lookupcfg.h> > + > +struct link_map; > + > +extern void _dl_unmap (struct link_map *map); > + > +#define DL_UNMAP(map) _dl_unmap (map) > The fix looks ok to me (aarch64 supports tlsdesc, but it not calling htab_delete) but _dl_unmap is replicated over aarch64, arm, i386, and x86_64 (the architectures that supports tlsdesc). I think it would be simpler to add a define on linkmap.h to indicate the ABI supports tsldesc and consolidate the _dl_unmap code that call htab_delete on _dl_unmap_segments. It would allow to remove all the tlsdesc.c implementations (and dl-lookupcfg.h completely on some architectures) and simplify the required code if any other architectures decides to support tlsdesc.
The 04/01/2021 09:57, Adhemerval Zanella wrote: > On 15/02/2021 08:56, Szabolcs Nagy via Libc-alpha wrote: > > DL_UNMAP_IS_SPECIAL and DL_UNMAP were not defined. The definitions are > > now copied from arm, since the same is needed on aarch64. The cleanup > > of tlsdesc data is handled by the custom _dl_unmap. > > > > Fixes bug 27403. > > --- > > sysdeps/aarch64/dl-lookupcfg.h | 27 +++++++++++++++++++++++++++ > > 1 file changed, 27 insertions(+) > > create mode 100644 sysdeps/aarch64/dl-lookupcfg.h > > > > diff --git a/sysdeps/aarch64/dl-lookupcfg.h b/sysdeps/aarch64/dl-lookupcfg.h > > new file mode 100644 > > index 0000000000..c1ae676ae1 > > --- /dev/null > > +++ b/sysdeps/aarch64/dl-lookupcfg.h > > @@ -0,0 +1,27 @@ > > +/* Configuration of lookup functions. > > + Copyright (C) 2006-2021 Free Software Foundation, Inc. > > + This file is part of the GNU C Library. > > + > > + The GNU C Library is free software; you can redistribute it and/or > > + modify it under the terms of the GNU Lesser General Public > > + License as published by the Free Software Foundation; either > > + version 2.1 of the License, or (at your option) any later version. > > + > > + The GNU C Library is distributed in the hope that it will be useful, > > + but WITHOUT ANY WARRANTY; without even the implied warranty of > > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > > + Lesser General Public License for more details. > > + > > + You should have received a copy of the GNU Lesser General Public > > + License along with the GNU C Library. If not, see > > + <https://www.gnu.org/licenses/>. */ > > + > > +#define DL_UNMAP_IS_SPECIAL > > + > > +#include_next <dl-lookupcfg.h> > > + > > +struct link_map; > > + > > +extern void _dl_unmap (struct link_map *map); > > + > > +#define DL_UNMAP(map) _dl_unmap (map) > > > > The fix looks ok to me (aarch64 supports tlsdesc, but it not > calling htab_delete) but _dl_unmap is replicated over aarch64, > arm, i386, and x86_64 (the architectures that supports tlsdesc). > I think it would be simpler to add a define on linkmap.h to > indicate the ABI supports tsldesc and consolidate the _dl_unmap > code that call htab_delete on _dl_unmap_segments. > > It would allow to remove all the tlsdesc.c implementations (and > dl-lookupcfg.h completely on some architectures) and simplify > the required code if any other architectures decides to support > tlsdesc. i agree. the last few patches allow even more refactoring (by removing lazy tlsdesc code paths from x86) i think consolidation should be separate from the bug fixes, so i plan to commit this patch as is.
On 06/04/2021 10:43, Szabolcs Nagy wrote: > The 04/01/2021 09:57, Adhemerval Zanella wrote: >> On 15/02/2021 08:56, Szabolcs Nagy via Libc-alpha wrote: >>> DL_UNMAP_IS_SPECIAL and DL_UNMAP were not defined. The definitions are >>> now copied from arm, since the same is needed on aarch64. The cleanup >>> of tlsdesc data is handled by the custom _dl_unmap. >>> >>> Fixes bug 27403. >>> --- >>> sysdeps/aarch64/dl-lookupcfg.h | 27 +++++++++++++++++++++++++++ >>> 1 file changed, 27 insertions(+) >>> create mode 100644 sysdeps/aarch64/dl-lookupcfg.h >>> >>> diff --git a/sysdeps/aarch64/dl-lookupcfg.h b/sysdeps/aarch64/dl-lookupcfg.h >>> new file mode 100644 >>> index 0000000000..c1ae676ae1 >>> --- /dev/null >>> +++ b/sysdeps/aarch64/dl-lookupcfg.h >>> @@ -0,0 +1,27 @@ >>> +/* Configuration of lookup functions. >>> + Copyright (C) 2006-2021 Free Software Foundation, Inc. >>> + This file is part of the GNU C Library. >>> + >>> + The GNU C Library is free software; you can redistribute it and/or >>> + modify it under the terms of the GNU Lesser General Public >>> + License as published by the Free Software Foundation; either >>> + version 2.1 of the License, or (at your option) any later version. >>> + >>> + The GNU C Library is distributed in the hope that it will be useful, >>> + but WITHOUT ANY WARRANTY; without even the implied warranty of >>> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >>> + Lesser General Public License for more details. >>> + >>> + You should have received a copy of the GNU Lesser General Public >>> + License along with the GNU C Library. If not, see >>> + <https://www.gnu.org/licenses/>. */ >>> + >>> +#define DL_UNMAP_IS_SPECIAL >>> + >>> +#include_next <dl-lookupcfg.h> >>> + >>> +struct link_map; >>> + >>> +extern void _dl_unmap (struct link_map *map); >>> + >>> +#define DL_UNMAP(map) _dl_unmap (map) >>> >> >> The fix looks ok to me (aarch64 supports tlsdesc, but it not >> calling htab_delete) but _dl_unmap is replicated over aarch64, >> arm, i386, and x86_64 (the architectures that supports tlsdesc). >> I think it would be simpler to add a define on linkmap.h to >> indicate the ABI supports tsldesc and consolidate the _dl_unmap >> code that call htab_delete on _dl_unmap_segments. >> >> It would allow to remove all the tlsdesc.c implementations (and >> dl-lookupcfg.h completely on some architectures) and simplify >> the required code if any other architectures decides to support >> tlsdesc. > > i agree. > > the last few patches allow even more refactoring > (by removing lazy tlsdesc code paths from x86) > > i think consolidation should be separate from the bug > fixes, so i plan to commit this patch as is. Right, but would work on the possible refactor? This should be that complicate and would prevent other architectures to incur in the same aarch64 mistake.
diff --git a/sysdeps/aarch64/dl-lookupcfg.h b/sysdeps/aarch64/dl-lookupcfg.h new file mode 100644 index 0000000000..c1ae676ae1 --- /dev/null +++ b/sysdeps/aarch64/dl-lookupcfg.h @@ -0,0 +1,27 @@ +/* Configuration of lookup functions. + Copyright (C) 2006-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <https://www.gnu.org/licenses/>. */ + +#define DL_UNMAP_IS_SPECIAL + +#include_next <dl-lookupcfg.h> + +struct link_map; + +extern void _dl_unmap (struct link_map *map); + +#define DL_UNMAP(map) _dl_unmap (map)