From patchwork Mon Feb 15 12:02:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 42041 X-Patchwork-Delegate: azanella@linux.vnet.ibm.com Return-Path: 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 7080039518A8; Mon, 15 Feb 2021 12:02:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7080039518A8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1613390569; bh=eI1o7CQWu6VbCUXjEL9eC6+LIz+Gs9bGdp06wUTT0qU=; 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=vqfzbrJrIkcdlaHWB2dsSIgz7y14E8yi/HEjEi+sx38TVoW11fupij677OdtMB0XP QZw8OjE44Lg/VyIZN88Zp4Uo0ptiLVlVkW/w4cRh1gtjkdvCCMaQYpkHz8XNw9TZPj B0/Sdzw80SPJ9VJ39e+8WUHTD8EQYx2FTskKDpn4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2059.outbound.protection.outlook.com [40.107.21.59]) by sourceware.org (Postfix) with ESMTPS id 488AF3951015 for ; Mon, 15 Feb 2021 12:02:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 488AF3951015 Received: from AM6P192CA0067.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:82::44) by VI1PR08MB3615.eurprd08.prod.outlook.com (2603:10a6:803:79::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.28; Mon, 15 Feb 2021 12:02:43 +0000 Received: from VE1EUR03FT025.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:82:cafe::1a) by AM6P192CA0067.outlook.office365.com (2603:10a6:209:82::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.26 via Frontend Transport; Mon, 15 Feb 2021 12:02:43 +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 VE1EUR03FT025.mail.protection.outlook.com (10.152.18.74) 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 12:02:43 +0000 Received: ("Tessian outbound 4d8113405d55:v71"); Mon, 15 Feb 2021 12:02:42 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 93817aef04d991a0 X-CR-MTA-TID: 64aa7808 Received: from 03357268e1f5.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E852608F-0F14-465F-8679-BB62297DFFBF.1; Mon, 15 Feb 2021 12:02:36 +0000 Received: from FRA01-MR2-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 03357268e1f5.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 15 Feb 2021 12:02:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lq5objhU8VbVz/vXOWSgNCF0Ln12iXyHmmPJYLA5acB9oUU4rZYwh/1auYKKB1wG08rKOSfLvRYFgnrRKjQHZDLzminqaMHRQvc5W388A+TyKe02qfSLNuYRke2y3U5pkZ2UYZK9bEn8kAQMtCpVGGIKPKX88u8hPfnv35aSLFxDf56KjW/NVEsBQ4+Kxsm12NQLogVEQa1+XaDR5433tpDiby5zVft+Bb0V0SuXb8CnUXWkUgFARYNYjtbcjbSIMfvZYOR0t2PPdQP6IFN3wCXzKf6ZqaxTfKregvDhKl17Sczg2TAJWbvGlW4vwwqKIpq+/1XWctOwFAO9w7JgEg== 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=eI1o7CQWu6VbCUXjEL9eC6+LIz+Gs9bGdp06wUTT0qU=; b=Hr7iM2MJ/HptpdI35XPL8Hko7iMnhY+ueIHBcYbkJj8mear1MNpwo2jlKcxJYvlup2w3ZwAwIjalsY0Jav3IH3P8LVNwLfT9nEkqwUJImc8XskBkmHmm8WnXI2IS334nIyj5K56NuBJOJZeeQbSPK77T7aQXN4M0+BxFBIMH1dDtQKbu8kEVQaYMxSvJRY/tutSUTP27CohiIjCiDBzLkdAcZGuaBvbcwheuMVakIS63bCmNHkF8iy1iQ+5i6cSOSsIibv/UtQniVCIDvQlidK8mH34xTpdUVk9+m2RgChe+l59AsqojSJiN5moYkIHOWxpFEpjs7ZUNBdgRD/sp6w== 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 PR2PR08MB4809.eurprd08.prod.outlook.com (2603:10a6:101:1a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Mon, 15 Feb 2021 12:02:34 +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 12:02:34 +0000 To: libc-alpha@sourceware.org Subject: [PATCH 12/15] i386: Avoid lazy relocation of tlsdesc [BZ #27137] Date: Mon, 15 Feb 2021 12:02:28 +0000 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-Originating-IP: [217.140.106.49] X-ClientProxiedBy: LO4P123CA0472.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a8::9) 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 LO4P123CA0472.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.38 via Frontend Transport; Mon, 15 Feb 2021 12:02:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e246aa04-051a-45ce-8644-08d8d1a999e1 X-MS-TrafficTypeDiagnostic: PR2PR08MB4809:|VI1PR08MB3615: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4714;OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 7AeCRcgrfa/FXvSVXAWZYy3HyG8LC2jCpYjVssuf6jF2BpOZT9vPJQ6LeS9ViTlNx1+cnVdxEBHiGS6UUyeTZ1nZZnYDMgHvWXn+XoMKdL6u1TOP4DEwnd8Gg/Y8cQjpX5QDG46WpGjdE3TfLCVFNA55dgIGc6L5fu27ozmeaZfWF5cDcMZzKMB8ErSBKOiT5fDARmYcu0Zy5k/uO8IRY5lKO7JnE+jhYwjYP/DGtJVOku/DFDLqfY3oSi6yHV/orz74Wknzttczi6Y6se3LfyYgPPLKFSqB0FURFl0oCiTA5PEyjGeVj8zD0VsWN3oeEuLjl85xqFW/ZKVM4EFq2FxGvHAfX4hIYyI2cvxxxWpnlfHNgDP8AgUCd/eST/0ld219oty9X/xFoZfpFPxR/E5527oJRLStpRxklTb5DGUsf6hrVrivk2Pc/95cDCNjb8/sxszXO4E8KlJ7iwvEARNcxYWVrm1lEUMQnXM+1e5Kod78mb84TVI9TFcd3Kdx5AZPDD2NR8q0hvIYKTtJgv4YMAxHz6KzVW9Kyuap9V06VXXPA+ArsaY5T1KwaeNjwvuCyfgf+1EEwnBPnxBHfw== 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)(39850400004)(136003)(376002)(366004)(346002)(44832011)(52116002)(26005)(186003)(83380400001)(5660300002)(316002)(16526019)(956004)(36756003)(6506007)(6916009)(2616005)(66556008)(8936002)(66946007)(6486002)(6512007)(8676002)(478600001)(66476007)(69590400012)(6666004)(2906002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: rIFwAA8Vrq3xHzm+hisbDd/xErUypd/egl4af/Pd7jbpG+A+4R78mhvGTBiKd5MN8mq7gsryvqiRWSRK7n6QTefEWIxwSQnWhRjZEfckRy8EdOQyyRwWt1W20WQQRTvW8zdMDH71WsEsVx0G2C8R6AVzYRAFlIWVyeevTAVys2+FzsIcq1w9mRrPGkid5duPD9ylluENlVOcb99qLEvrJzq3df6yCLxzxjBecH90Pq7zjJgmxiGgGy335KQ8IOC0qH4zjMTE41hdqv1IfgXm7st733PfTgBvsNgCZKnc/qLnzmC7kyUgwQscRzW1WafMVrWX8fzCaRJoiUWHM8nQ7l1M6JitFHYGUPX4OZWvqmJjcOS7XKAurLmus5TMlUhamnfPlzHFUU0NZXKeyBLMC8eCwVGrV7TEKR43EegXxDdlaZF31i4/yOGFP7NodS5ZWiqX/SaPiglGFDgklm0Ejn6GF0pns7HiVMI0momA2GQr0Jc3pLebLaAyFwbM1ZPmpcK9tmwm49p9wbkOWCBXuRjnU60BQ7ukJEusj0qqBxRpm/H+LbsfswBtefSO9jIKrfUWwhU7guQPaUx9fCQT0hbGdc/LcHTilXu47nwSbXX5DAbssVIxL95RErqplrX90sJGuvrOX+P5+MVzO4G7o+Nyi0rxcKOLwo2ScH3el3+WoKLNyGB5zgm0qlMQhnhXWwh9Xyncndy3KpLQXOQJoAmy2r+fb4v5EcGhEM8bG4vSiuAzsbTrwipe5Lsj3EmUtVUI6lkbYhafAG60KhCmTpmOsO9auNiDVy2sa90vQsIbDBpfWn9KdTZXC3CHzsuuxGXxK4JN8psE/ZsLkzZ9AaSW60R9Z5/g5uAgEC8TBktYUypFwue3XbS2v0jIWTWhA8nQVa/cu1FnBVnRgzD7o3Puj0EWRmC2sC1vef54U+QasyBxkxqyZRcPO1ltvpG9S46HBe8hktnsMNWyGf/F/uGCtbzt+QQT4tpKAg04YnSRipuiGakzX6DvmlUq1mWlxKB5HgONHdYHP1PdkDwky3MmX3co7/GoavRmzLKQM4FAiWI3hG1wFTXf3DXhy8rWn/AtepKlWDztPxjyrufjYt9Cq19hHXQHhHG8gbRWF8MgicHgSU3zgWohbi+adokD70I8clJZqEQI1J1oULL4XkrZsmRYWtNTXroT4sYVFlbcfIMHyVvmmCyUvI4iktLi1+go4n7lMDZ8TYdpRZAXOVELDXmFcBSNXcO35fagIunOOMTcK7UD2nRqnqaRdQjGqqmAFjSQ0fO6yyZ4vOWdVlVSybkr1LITpVjfIadJqMKizz3A/YflKbtgK3lbh21Y X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR2PR08MB4809 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: VE1EUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 3ab9a3f1-f717-496b-7d6a-08d8d1a9948b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N4wm+/BP/2ls1BsuubYOmPzjph0Uz4FyNH++VNYgWNqkV/Yd6MgDHQPd5NCaRQoGlUM3Rtrmrb5Ewuj/cxwreQqe30BxsFgXP2ULN3MKrQMF0/6Y1da8ZWd1+LKhv9GmflMhexR/R+9kmRdT/DM3nHvFVay9PzQIdig/nXdC51cPxAXZehmalI5o+qmls24JjHq7XuWm25IjrK++EnzQM/+tuJt60lBDS0ML1NGSX+0MCGGrV/2A/ATMbjGGx0euH7O/wjcyNbqMHWm/s/OipDDHx+sazTaTFbd4bhCg8cr8VWOkMVDH7rpsVKkSremlMmS1xW8xRSU3/XXKf36E5eH0+tYZA6fpu2BGSxnTIu9kSIw5CM25MH/Ycl4LRROOM0g0yiUmK48ppfvLVulr67Fqp0nMU1qPImOQb/Z44RU2nsDcA4mevQJLANObG4WQmEeK6Tvm88mca8q2T+UwJbzRDl4+s7T5FwOTfV/1JDUeiuapQdAGFeDzSZignjESV2/T0aJe60VkmsRrml63twiZllIJZnDQWWAKyy7PygGAgLw07ywQxAAtiV0vCA7YZGAoXuo0baE8isBBjsuzyxxnqQBHvpE12PjB+jMQWqEbHJZBdNWBYR0j1VXxn+Cg+D5q41WytpBIo3OGfkco0hO8oJGM4uVMvxaAsXQKLBbLLZARoa00nx/+fWXtiQlP 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)(39850400004)(376002)(136003)(46966006)(36840700001)(82310400003)(36860700001)(2906002)(26005)(47076005)(186003)(16526019)(478600001)(956004)(2616005)(6506007)(336012)(44832011)(81166007)(5660300002)(82740400003)(8936002)(6512007)(316002)(86362001)(8676002)(36756003)(6486002)(6916009)(70586007)(6666004)(70206006)(83380400001)(356005)(69590400012); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2021 12:02:43.3018 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e246aa04-051a-45ce-8644-08d8d1a999e1 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: VE1EUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3615 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Szabolcs Nagy via Libc-alpha From: Szabolcs Nagy Reply-To: Szabolcs Nagy Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Lazy tlsdesc relocation is racy because the static tls optimization and tlsdesc management operations are done without holding the dlopen lock. This similar to the commit b7cf203b5c17dd6d9878537d41e0c7cc3d270a67 for aarch64, but it fixes a different race: bug 27137. On i386 the code is a bit more complicated than on x86_64 because both rel and rela relocs are supported. --- sysdeps/i386/dl-machine.h | 76 ++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 42 deletions(-) diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h index 23e9cc3bfb..590b41d8d7 100644 --- a/sysdeps/i386/dl-machine.h +++ b/sysdeps/i386/dl-machine.h @@ -688,50 +688,32 @@ elf_machine_lazy_rel (struct link_map *map, } else if (__glibc_likely (r_type == R_386_TLS_DESC)) { - struct tlsdesc volatile * __attribute__((__unused__)) td = - (struct tlsdesc volatile *)reloc_addr; - - /* Handle relocations that reference the local *ABS* in a simple - way, so as to preserve a potential addend. */ - if (ELF32_R_SYM (reloc->r_info) == 0) - td->entry = _dl_tlsdesc_resolve_abs_plus_addend; - /* Given a known-zero addend, we can store a pointer to the - reloc in the arg position. */ - else if (td->arg == 0) - { - td->arg = (void*)reloc; - td->entry = _dl_tlsdesc_resolve_rel; - } - else - { - /* We could handle non-*ABS* relocations with non-zero addends - by allocating dynamically an arg to hold a pointer to the - reloc, but that sounds pointless. */ - const Elf32_Rel *const r = reloc; - /* The code below was borrowed from elf_dynamic_do_rel(). */ - const ElfW(Sym) *const symtab = - (const void *) D_PTR (map, l_info[DT_SYMTAB]); + const Elf32_Rel *const r = reloc; + /* The code below was borrowed from elf_dynamic_do_rel(). */ + const ElfW(Sym) *const symtab = + (const void *) D_PTR (map, l_info[DT_SYMTAB]); + /* Always initialize TLS descriptors completely at load time, in + case static TLS is allocated for it that requires locking. */ # ifdef RTLD_BOOTSTRAP - /* The dynamic linker always uses versioning. */ - assert (map->l_info[VERSYMIDX (DT_VERSYM)] != NULL); + /* The dynamic linker always uses versioning. */ + assert (map->l_info[VERSYMIDX (DT_VERSYM)] != NULL); # else - if (map->l_info[VERSYMIDX (DT_VERSYM)]) + if (map->l_info[VERSYMIDX (DT_VERSYM)]) # endif - { - const ElfW(Half) *const version = - (const void *) D_PTR (map, l_info[VERSYMIDX (DT_VERSYM)]); - ElfW(Half) ndx = version[ELFW(R_SYM) (r->r_info)] & 0x7fff; - elf_machine_rel (map, r, &symtab[ELFW(R_SYM) (r->r_info)], - &map->l_versions[ndx], - (void *) (l_addr + r->r_offset), skip_ifunc); - } + { + const ElfW(Half) *const version = + (const void *) D_PTR (map, l_info[VERSYMIDX (DT_VERSYM)]); + ElfW(Half) ndx = version[ELFW(R_SYM) (r->r_info)] & 0x7fff; + elf_machine_rel (map, r, &symtab[ELFW(R_SYM) (r->r_info)], + &map->l_versions[ndx], + (void *) (l_addr + r->r_offset), skip_ifunc); + } # ifndef RTLD_BOOTSTRAP - else - elf_machine_rel (map, r, &symtab[ELFW(R_SYM) (r->r_info)], NULL, - (void *) (l_addr + r->r_offset), skip_ifunc); + else + elf_machine_rel (map, r, &symtab[ELFW(R_SYM) (r->r_info)], NULL, + (void *) (l_addr + r->r_offset), skip_ifunc); # endif - } } else if (__glibc_unlikely (r_type == R_386_IRELATIVE)) { @@ -758,11 +740,21 @@ elf_machine_lazy_rela (struct link_map *map, ; else if (__glibc_likely (r_type == R_386_TLS_DESC)) { - struct tlsdesc volatile * __attribute__((__unused__)) td = - (struct tlsdesc volatile *)reloc_addr; + const Elf_Symndx symndx = ELFW (R_SYM) (reloc->r_info); + const ElfW (Sym) *symtab = (const void *)D_PTR (map, l_info[DT_SYMTAB]); + const ElfW (Sym) *sym = &symtab[symndx]; + const struct r_found_version *version = NULL; + + if (map->l_info[VERSYMIDX (DT_VERSYM)] != NULL) + { + const ElfW (Half) *vernum = + (const void *)D_PTR (map, l_info[VERSYMIDX (DT_VERSYM)]); + version = &map->l_versions[vernum[symndx] & 0x7fff]; + } - td->arg = (void*)reloc; - td->entry = _dl_tlsdesc_resolve_rela; + /* Always initialize TLS descriptors completely at load time, in + case static TLS is allocated for it that requires locking. */ + elf_machine_rela (map, reloc, sym, version, reloc_addr, skip_ifunc); } else if (__glibc_unlikely (r_type == R_386_IRELATIVE)) {