Re: [PATCH] riscv: Implement TLS Descriptors

"Andreas K. Huettel" <[email protected]>
Newsgroups gmane.comp.lib.glibc.alpha
Organization Gentoo Linux
Message-ID <[email protected]>
Hi Luke, 

> Oh, sorry for not noticing it happens to be the code freeze period, it's my first time 
> contributing to glibc :) 

No problem at all, no worries.

> That's not in an urgent feature so I can wait till the next 
> development window. May I ask is that just leave the patch as it is, and ping later? 

Keep developing the patch as usual, posting to the list and getting
reviews. Just the final push should wait until after the release.

Cheers,
Andreas


> I'll keep track on the releasing process and go back to it after it's done.
> Thank you very much!
> Best,
> Luke Zhuang
> ------------------------------------------------------------------
> From:Andreas K. Huettel <[email protected]>
> Send Time:Wed, Jul 15, 2026, 09:57
> To:"libc-alpha"<[email protected]>
> CC:"adhemerval.zanella"<[email protected]>; fweimer<[email protected]>; schwab<[email protected]>; palmer<[email protected]>; andrew<[email protected]>; rui314<[email protected]>; ruiu<[email protected]>; Luke Zhuang<[email protected]>; Tatsuyuki Ishi<[email protected]>
> Subject:Re: [PATCH] riscv: Implement TLS Descriptors
> Am Dienstag, 14. Juli 2026, 23:30:42 Japanische Normalzeit schrieb Luke Zhuang:
> > From: "Luke Zhuang" <[email protected]>
> > 
> > Implement TLS Descriptors (TLSDESC) for RISC-V, as specified by the
> > RISC-V psABI TLSDESC extension [1].
> > 
> That's post-release material.
> > This adds the RISC-V TLSDESC relocation handling and the three resolver
> > entry points used by the dynamic loader:
> > 
> > _dl_tlsdesc_undefweak
> > _dl_tlsdesc_return
> > _dl_tlsdesc_dynamic
> > 
> > The dynamic resolver implements the usual fast path by checking the DTV
> > generation counter, and falls back to __tls_get_addr on the slow path.
> > 
> > This work is based on Tatsuyuki Ishi's original patch series [2], and
> > is being relanded with his authorization. The reland includes the
> > following updates:
> > 
> > * Do not save and restore vector registers in _dl_tlsdesc_dynamic.
> > The RISC-V psABI now defines vector registers and vector CSRs as
> > caller-clobbered across TLSDESC calls [3], so preserving live vector
> > state is the compiler's responsibility.
> > 
> > * Call HIDDEN_JUMPTARGET(__tls_get_addr) from ld.so, avoiding a PLT
> > reference to __tls_get_addr.
> > 
> > * Publish TLSDESC entries in elf_machine_rela in arg-before-entry
> > order, and use a volatile tlsdesc pointer, matching the ordering
> > used by other architectures.
> > 
> > * Add sysdeps/riscv/tst-gnu2-tls2.h to test that the RISC-V TLSDESC
> > resolver preserves the required caller-saved GPR and FPR state
> > across the slow path.
> > 
> > Basic GCC and binutils support for RISC-V TLSDESC relocations is already
> > upstream [4][5]. Linker relaxation support is on the way but should not
> > be a blocker.
> > 
> > [1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/373 <https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/373 >
> > [2] https://inbox.sourceware.org/libc-alpha/[email protected]/T/#u <https://inbox.sourceware.org/libc-alpha/[email protected]/T/#u >
> > [3] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/496 <https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/496 >
> > [4] https://gcc.gnu.org/cgit/gcc/commit/?id=97069657c4e40b209c7b774e12faaca13812a86c <https://gcc.gnu.org/cgit/gcc/commit/?id=97069657c4e40b209c7b774e12faaca13812a86c >
> > [5] https://sourceware.org/git/?p=binutils-gdb.git <https://sourceware.org/git/?p=binutils-gdb.git >;a=commitdiff;h=159afbb7617d2c8a9cd3f3350374711f37f60442
> > 
> > Co-authored-by: Tatsuyuki Ishi <[email protected]>
> > Signed-off-by: Luke Zhuang <[email protected]>
> > ---
> > sysdeps/riscv/Makefile | 10 ++
> > sysdeps/riscv/dl-lookupcfg.h | 27 +++++
> > sysdeps/riscv/dl-machine.h | 54 ++++++++-
> > sysdeps/riscv/dl-tlsdesc.S | 221 ++++++++++++++++++++++++++++++++++
> > sysdeps/riscv/dl-tlsdesc.h | 48 ++++++++
> > sysdeps/riscv/linkmap.h | 1 +
> > sysdeps/riscv/preconfigure | 1 +
> > sysdeps/riscv/tlsdesc.c | 38 ++++++
> > sysdeps/riscv/tlsdesc.sym | 19 +++
> > sysdeps/riscv/tst-gnu2-tls2.h | 201 +++++++++++++++++++++++++++++++
> > 10 files changed, 619 insertions(+), 1 deletion(-)
> > create mode 100644 sysdeps/riscv/dl-lookupcfg.h
> > create mode 100644 sysdeps/riscv/dl-tlsdesc.S
> > create mode 100644 sysdeps/riscv/dl-tlsdesc.h
> > create mode 100644 sysdeps/riscv/tlsdesc.c
> > create mode 100644 sysdeps/riscv/tlsdesc.sym
> > create mode 100644 sysdeps/riscv/tst-gnu2-tls2.h
> > 

-- 
PD Dr. Andreas K. Hüttel
[email protected]
Gentoo Linux developer 
(council, comrel, toolchain, base-system, perl, libreoffice)
https://wiki.gentoo.org/wiki/User:Dilfridge
signature.asc (application/pgp-signature, 870 B)
-----BEGIN PGP SIGNATURE-----

iQJPBAABCAA5FiEE/Rnm0xsZLuTcY+rT3CsWIV7VQSoFAmpXbsUbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMiwyAAoJENwrFiFe1UEqGF0P/3pL9IQzS16tjF29XAZv
YLqwBsvjp1Sl1kq+GdRkKj9GtRiHLRRuzkyMIJWRZS095UYkaC11U66jemZFljoJ
JJc+e/ood0ZIP/gc0DnyygoqxEXWlLVMZnPHPKlPrPEpU0kZMruJPdEk0Wp3RcHS
CY3kP8UosD7CSwfcE3eZfR2YAqsZRhthoThATye6p3IKUJQNNBc3I6DeC6xxu7s3
GaVsLcy+TnmuA+8qBsbol+6HQIQ6dMlfJQBcNPkp+x0AkW3oqoPGIqnhPHksevXL
L1C3b2l34LCTvnKB9WUnP4Y/yVQqZwhOOEA+pMWPzxs6WBk6JZysZ0Y3mXq+wvFy
dm3fR/Glx0z6v+lAA/G616oX2rCQ+eVBDcDuIxnXvFUJgtsxJVmOvhegDubqpDR7
TuOxtgdHAk5q8gZzlw8aSecgnXPnKTD+w4Bhn397uGDkxFO6uFmUv9snPsF8KScF
RsLp1QnxAOMJyz5iBGQAN0/5Z7yWZmGahZXnm7FY75X5MLQwxdDWFiBEQMav4TSI
qZV4SQeVVhGdXH/fCQz4EgDYyffcoCByX3vCqnhdyAdoGtBYnuDLCU1mfG328qub
VB6EzBlzZR6xF/zgs3CGie3fopy+foR+WCkU/xP6NspaL05k/h29VT6wpXKvXKUj
oNLH8yasYihBrcp/BYCpIimX
=cJT2
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.