From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by sourceware.org (Postfix) with ESMTPS id 218B13870921 for ; Tue, 5 Dec 2023 16:44:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 218B13870921 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 218B13870921 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::52c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701794667; cv=none; b=GnK6QzFIazJ5CvlSXMj1Q8bSrY8R2Z+Tgx6Hr4dPINWkaZwSG6dJINsRh/HtcnrSUfCVAGb3dXZlJxqel2YWdlhvSkzzVmQWYP/85LNlLZGNVHxUqLFGplOSzUE3DAbBM9WYyfszpl8+lIJT63Pxm4KSQ88ykarYtIwnOdcAPiA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701794667; c=relaxed/simple; bh=a4bN+B1S0omUl6chYgGBHyNIBC1VAbz7++mRs9wvU+Y=; h=DKIM-Signature:Mime-Version:Subject:From:Date:Message-Id:To; b=pqWU0bRLLS8AUqUHegwmwj5C2R7NFfcK5ng34O1VW4a5kbmq+vkDIIvg89rDl2O+QSZQZ1VJyEkSBtCXI0XY5nx/lxwR9FBXds2urTI2hlDn37dfieZOEt3sOwOltRuGEeLrcoRKo5z0MJ4cBhUrLfbXkT9629rAsy4/hDrRCXc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-5a0dc313058so791451a12.0 for ; Tue, 05 Dec 2023 08:44:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701794663; x=1702399463; darn=sourceware.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=rVYUIJQ7IUxkmDI/yi//Vs+BOjSiF1TK6vVG26WulVc=; b=Ypg7da6t3wel1JthrJo7R8K4iVMbN7w1NcbgJwe0sfvnfVzt8mAVlHTn7jLA9JzVUb iHw7g3YBtcjfr+xJqmaQrKACeCIr1aL5pQGiVmj8q2OWI2en+MuBQbUhYA+lvchQ4rkA v7uh7Ludm/KsfeXMQ7IAJY7qIolrxuY2i1KCAkCAANNfYA5eMmWFKPU8gwxeLtXkNci1 1R9WGKrfQ1HDCYRIuEI1w7VvfzGVKXpZM+kreQogZdrt8mxhdOppxdaJs7KAlVKXetbl fieLrN2J89wo2KOPK+A5J6da5jvQC6gaNt30x3PUzumYGyYD4MvbnYJqTmilhoHEdSUJ Ii+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701794663; x=1702399463; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rVYUIJQ7IUxkmDI/yi//Vs+BOjSiF1TK6vVG26WulVc=; b=MBI2jHzRgp2kR192MsLWpWsQbGR0CMZUabJ3roXE+SymH52xAGTi7w8iyoZBYy/K4A LPU2DSb7uSgStEQm1ts/Zibt1BRHXRfAc66t8ELxW6eedMfCBsMwtWrzkeqbPM6QeHVw 2O6/Htkdps7OERsugHMv6LMH1r9dayB6PBesj5Xn8rr6/6xlhwF94K5ctrVnrhM7aZf0 PpVE9Gljdshq5uR6XYle0p8SyETPjfvDA96R8EEr6i6ALb9NLTJz7hrPeoavS3+Odyyp t1ZG4X+SgkJBHgKIyiPpRxYPU9pxx1Ga4qWSbI0KLVon2fVj92a5aUC/Bv3JLDf1d/SK sH4g== X-Gm-Message-State: AOJu0YwidPmjRBli5qGcz5rgftum7Niik7A0wAcwST+vG0t1x/IoVdfb A0HC3k3JaaeB6FLkg+Cy+R4JGForVrg2PY57 X-Google-Smtp-Source: AGHT+IHYipK9llUzw3Y+wkXyaZB4Pj9/fXslfWn2Fxrnb99IxWear4yGnrybdsmZbzhEGqOprJcU5A== X-Received: by 2002:a05:6a21:a590:b0:18b:2020:8cd1 with SMTP id gd16-20020a056a21a59000b0018b20208cd1mr46156439pzc.3.1701794662914; Tue, 05 Dec 2023 08:44:22 -0800 (PST) Received: from smtpclient.apple (zz20184013906F627101.userreverse.dion.ne.jp. [111.98.113.1]) by smtp.gmail.com with ESMTPSA id 4-20020a630804000000b005b856fab5e9sm9366815pgi.18.2023.12.05.08.44.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2023 08:44:22 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.200.91.1.1\)) Subject: Re: [PATCH v3 0/9] RISC-V: Implement TLS Descriptors. From: Tatsuyuki Ishi In-Reply-To: <20231128085109.28422-1-ishitatsuyuki@gmail.com> Date: Wed, 6 Dec 2023 01:44:09 +0900 Cc: i@maskray.me, nelson@rivosinc.com, Rui Ueyama , Rui Ueyama Content-Transfer-Encoding: 7bit Message-Id: <6EED9B8A-17DB-4963-B0DB-F83BCF72DD9B@gmail.com> References: <20230817180852.121628-2-ishitatsuyuki@gmail.com> <20231128085109.28422-1-ishitatsuyuki@gmail.com> To: binutils@sourceware.org X-Mailer: Apple Mail (2.3774.200.91.1.1) X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Nov 28, 2023, at 17:51, Tatsuyuki Ishi wrote: > > This patchset implements TLS Descriptors (TLSDESC) for RISC-V targets, per > the specification (merged) at [1]. > > Tested on rv64gc for: > - No regression (& passing new tests) in binutils > - No regression in gcc > - No regression in glibc for subdirs=elf > With both -mtls-dialect=desc and trad. > > 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 > > v2: Add changelogs and tests. Minor fixes described in patch messages. > v3: Add relaxation support. This fixes tst-tls1-static in glibc. Would anyone like to review this? This is a prerequisite for the GCC-side implementation to be useful (especially the gas part). I can split up the series into bug fix / refactors and actual changes if desired. > Tatsuyuki Ishi (9): > RISC-V: Fix local GOT and reloc size calculation for TLS. > 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. > RISC-V: Move STATIC_TLS handling into record_tls_type. > RISC-V: Unify TLS handling in check_relocs. > RISC-V: Add elf_link_hash_entry to relax_func args. > RISC-V: Introduce TLSDESC relaxation. > > bfd/bfd-in2.h | 4 + > bfd/elfnn-riscv.c | 341 ++++++++++++++++++--- > bfd/elfxx-riscv.c | 130 +++++++- > bfd/libbfd.h | 4 + > bfd/reloc.c | 8 + > gas/config/tc-riscv.c | 18 +- > gas/testsuite/gas/riscv/tlsdesc.d | 22 ++ > gas/testsuite/gas/riscv/tlsdesc.s | 24 ++ > include/elf/riscv.h | 21 +- > include/opcode/riscv.h | 1 + > ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp | 8 + > ld/testsuite/ld-riscv-elf/tls.d | 17 + > ld/testsuite/ld-riscv-elf/tls.s | 42 +++ > ld/testsuite/ld-riscv-elf/tlsbin.d | 7 + > ld/testsuite/ld-riscv-elf/tlslib.s | 6 + > opcodes/riscv-opc.c | 1 + > 16 files changed, 601 insertions(+), 53 deletions(-) > create mode 100644 gas/testsuite/gas/riscv/tlsdesc.d > create mode 100644 gas/testsuite/gas/riscv/tlsdesc.s > create mode 100644 ld/testsuite/ld-riscv-elf/tls.d > create mode 100644 ld/testsuite/ld-riscv-elf/tls.s > create mode 100644 ld/testsuite/ld-riscv-elf/tlsbin.d > create mode 100644 ld/testsuite/ld-riscv-elf/tlslib.s > > -- > 2.43.0 >