From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12olkn2058.outbound.protection.outlook.com [40.92.22.58]) by sourceware.org (Postfix) with ESMTPS id 769373854826 for ; Fri, 18 Aug 2023 07:20:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 769373854826 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=maskray.me Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=maskray.me ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HM4DMZe7R7bIO3O/sTD35vANrvsKmaUBBcWyBf/Rg1WiEEDG3giWGznOtVKmgveUAk4elUMU27cCAwx0XZ/+AfGH/cLI0abE2pumYwEwjYhHA8ekbxjxIycFkRK3ldQ4JeabL3nb64gFnL7Gwhv7gBmG+sEGuX8m7bt0MTzg1Fdo6UVFbVaj7ouPOoblghB3Ag5NRcS2VGxBjOEe689ZtOL08JSrzgEubEhpj0u0jlT6EH+nkNbaYaVEQDcHOQl4c7EI6IK4JGTHlU0tAXNLTulVQ8blM/EjA8XQcyb8dEaa/ciYVoT3NCPQJiHbwlN4YSFX/xg8qCvtZuJ9AQVt6A== 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=dr54Lydd34mNY7pb61FTeWVtrHNE1XHhHyS9Iu2gQFA=; b=hAwC7ovGlLuLGjS2m3GI0cLjVIfzSoKKx7s7HVpfkDOPg3D/Q4bhvGkGFnlBF+AzGqRwSL05dV5OftOVB2Wabt1dn1J7rHzXdlTJGd+hFhmLhUmGOoW0Zx+QUBhPqLNThuKBCL7QGkGraSs6SZkph/hgsePQ257MDaMSLJbch5bsl6ZDWO5Q62HN2bC0X7NxvVY6/1ckTjM9fl5l+a4vphqgfJQC88I5hb3wQzsDWLFVSQye07sYqNuoYg3OONhcUTjA4A4InPt5cR8PVl898/68HUmzQ1xo56Vjr7TiMjS36ALL0DhWRQeDLv7nNxUT0bPHeefYETqdTsKLAcZeSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from DS7PR12MB5765.namprd12.prod.outlook.com (2603:10b6:8:74::19) by MW4PR12MB6951.namprd12.prod.outlook.com (2603:10b6:303:209::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.31; Fri, 18 Aug 2023 07:20:42 +0000 Received: from DS7PR12MB5765.namprd12.prod.outlook.com ([fe80::1cd:f8ec:5a6b:23b8]) by DS7PR12MB5765.namprd12.prod.outlook.com ([fe80::1cd:f8ec:5a6b:23b8%7]) with mapi id 15.20.6678.029; Fri, 18 Aug 2023 07:20:42 +0000 X-Gm-Message-State: AOJu0YxnYPmUt+2GbR8o8Y0NQgjLafqJzSCIbUBH4Wnz9vkLYVOIZBN8 DsIuXVxfyAA1P9THlopcd6AzRDH2iPvZB+x3vKQ= X-Google-Smtp-Source: AGHT+IFifB4ci8eyw7K3uCmZ7+XtYlThntGMu8thRMHePKwGWAmV03cgV7DRd8UgeRkhs14+Q8N0OVv7GOJJkFKxVnI= X-Received: by 2002:a1f:bd10:0:b0:487:8009:3445 with SMTP id n16-20020a1fbd10000000b0048780093445mr2243331vkf.13.1692342815638; Fri, 18 Aug 2023 00:13:35 -0700 (PDT) References: <20230817180852.121628-2-ishitatsuyuki@gmail.com> In-Reply-To: From: Fangrui Song Date: Fri, 18 Aug 2023 00:13:24 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/4] RISC-V: Implement TLS Descriptors. To: Tatsuyuki Ishi Cc: Nelson Chu , binutils@sourceware.org, rui314@gmail.com, ruiu@bluewhale.systems Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-TMN: [SarfWN5qFFZmuJmW/6VExIDASFwHPgzx] X-ClientProxiedBy: SN4PR0501CA0005.namprd05.prod.outlook.com (2603:10b6:803:40::18) To DS7PR12MB5765.namprd12.prod.outlook.com (2603:10b6:8:74::19) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR12MB5765:EE_|MW4PR12MB6951:EE_ X-MS-Office365-Filtering-Correlation-Id: f6a438c8-d032-4bc8-36af-08db9fbba1ba X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dkmFaJ9WUTCgOu2ceMyDO3hDOcVnYj1nfRUg5S3rNtxT921cyvgUkE3tunKbQ+gXwU87UXg5pgI9sscCQtNSrFaRfLmTzo1mdTiWug5BNnI/WrwZc71siX7FaGmFHjfrp1mP2gJg56vi1a1mVJAc/pV3BFnOhTbyg6RILAz2/NNAofstYm4G3TR7to/Ymde++jrwXkhge3Q3Pn8iDTi6AtUGMtp2WZHd3AhCNk0hcWF8SaHrpoMZKymxRQpKYHu7yxrTSUS95oge8maw4lPdGHTjQIvn3G5n2bMp33LiIBs5ne7Phdeis5ZMzjivRiIi89aLTYSm+UlCsVyhHs7j0gGViDAiASwh2EmsK/bSdkXtWG8AAFHaWupWXzqeiDVRlOsj69nStd7t0u7V0uXFxN/fp/KB8OrRkFYaTBgMg+NJojN2hzo2aSKqUDd6dpWUpON4f+V1fgpaQqGAgPhA4PEDytD6dR3QFPs9B+/VelESgw8GEBpUCBE026Oonigakdby03aQ3rLzSa9hUn72CTw6T4qLygPFOw+/G+A+33Q= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?K0x3Z29lYklldHBQNGNxekpCOW1uTGdwOU1ZNmJIWG5CSGdFa0JwNkRCdzY3?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WHg4Nkd6VFFx?= =?utf-8?B?Wkl6ekFBUXN2ckVDdENzUFlDR1FLb0ZpTVdWeHA0cWNiUDJlVFh0SWY2UjEv?= =?utf-8?B?ZlZJQW50MzVQNXdkajVlR0ozMy9rQkQ0Vkl5Q2VDZUVPZU9ETllncHRRUk13?= =?utf-8?B?cjJrRytlK0dNaDAvVGpidWtBdTdZNEpOQXFaLytWUHRMNFFOVlFEdUxvSXcv?= =?utf-8?B?NVZaWFJKMWRRRGFPQlhYNXM2Qnh3UU5LcUhXQkx4aUtJTjdQT3E1TXdWazND?= =?utf-8?B?UXlrM2pUSm1mYnVCNllhc1BpUGxIVFlTcG5kTmV0YWZuUUJhd2IwcHhIKzc4?= =?utf-8?B?VnVIc09mMStRQVpXYnVqSXd5clBjclNoc0lrVGFtZ3p5RDc2SGh6anl3dUVj?= =?utf-8?B?NlpJRjhFOG02Z0Y3U3ovcWxmVFpRQ1hHYStWcUFmSnkyRTVLQmZDckR0cStG?= =?utf-8?B?WkdIZDUwZ1I4VVllRm5IYnJ3ZTd4M0NCcWhwblVCbDk0ZFFuSmR0d093WUdE?= =?utf-8?B?R2VRZk5TaU1tUU5OdVF0bFJvWll1c2FqSmw4YXRYaUtUR05ZZ1RVYUd3bExQ?= =?utf-8?B?SlQwc3pXSTJCamJUSnJuamNZRTFhT1VFQng2N0Fibmc5RjdjS2Z6SU5RbWFo?= =?utf-8?Q?zsfJG5ZPlxbKbZA3NUxSmwvVgEi/TJrp6LSa9Ou1bNgq4y?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-5183d.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: f6a438c8-d032-4bc8-36af-08db9fbba1ba X-MS-Exchange-CrossTenant-AuthSource: DS7PR12MB5765.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2023 07:20:42.7267 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6951 X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00,FORGED_SPF_HELO,KAM_DMARC_STATUS,KAM_INFOUSMEBIZ,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_SOFTFAIL,TXREP 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: On Thu, Aug 17, 2023 at 5:22=E2=80=AFPM Nelson Chu wr= ote: > > Hi, > > Before the reviewing, I think you still should have test cases for each > patch to make sure everything is correct in the binutils, and helps peopl= e > understand what the patches try to resolve what problem or support what > features. In general, the regressions in binutils, gcc and glibc are > seperate. Besides, each patch should at least have the ChangLogs in the > commit message. > > Thanks > Nelson A relocatable object file can contain both TLSDESC and TLS GD relocations (e.g. relocatable output). The GOT use cases are different. It will be nice to have such a test. We need tests for at least (a) -shared and (b) -no-pie or -pie (I prefer just -no-pie). Perhaps you have done this (as the glibc patch suggests), but I want to make sure that the GOT entries are placed in .rela.dyn, not .rela.plt (https://sourceware.org/bugzilla/show_bug.cgi?id=3D28387 ld: Move R_*_TLSDESC to .rela.dyn) sysdeps/{aarch64,x86_64}/dl-machine.h unfortunately have to handle TLSDESC in elf_machine_lazy_rel for compatibility. > [PATCH 4/4] RISC-V: Initial ld.bfd support for TLSDESC. > + /* TLSDESC needs one dynamic reloc and four GOT slots. * Why is there 4? Other ports reserve 2 GOT slots for one symbol. > On Fri, Aug 18, 2023 at 2:10=E2=80=AFAM Tatsuyuki Ishi via Binutils < > binutils@sourceware.org> wrote: > > > This patchset implements TLS Descriptors (TLSDESC) for RISC-V targets, = per > > the specification draft at [1]. > > > > This patchset is based on top of [2]. > > > > No regression in binutils and gcc tests for rv64gc, tested alongside th= e > > gcc and glibc implementation (will be posted shortly). > > > > This contribution is made on behalf of Blue Whale Systems, which has > > copyright assignment on file with the FSF. > > > > [1]: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/373 > > [2]: https://sourceware.org/pipermail/binutils/2023-August/129075.html > > > > Tatsuyuki Ishi (4): > > RISC-V: Add TLSDESC reloc definitions. > > RISC-V: Add assembly support for TLSDESC. > > RISC-V: Define and use GOT entry size constants for TLS. > > RISC-V: Initial ld.bfd support for TLSDESC. > > > > bfd/bfd-in2.h | 4 + > > bfd/elfnn-riscv.c | 105 ++++++++++++++++++--- > > bfd/elfxx-riscv.c | 75 ++++++++++++++- > > bfd/libbfd.h | 4 + > > bfd/reloc.c | 8 ++ > > gas/config/tc-riscv.c | 18 +++- > > include/elf/riscv.h | 5 + > > > > > > ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp | 2 + > > > > This doesn't work, seems still not adding any test cases. > > > > opcodes/riscv-opc.c | 1 + > > 9 files changed, 201 insertions(+), 21 deletions(-) > > > > -- > > 2.41.0 > > > >