Date: Mon, 15 Dec 2025 17:00:27 +0000 From: Jessica Clarke <jrtc27@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: acf47e5d105e - stable/14 - rtld-elf/riscv: Don't allocate static TLS for dynamic TLS relocations Message-ID: <69403eab.e419.5d04c434@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=acf47e5d105ef05ea25b635672417a294a933e13 commit acf47e5d105ef05ea25b635672417a294a933e13 Author: Jessica Clarke <jrtc27@FreeBSD.org> AuthorDate: 2025-05-28 20:22:15 +0000 Commit: Jessica Clarke <jrtc27@FreeBSD.org> CommitDate: 2025-12-15 16:58:45 +0000 rtld-elf/riscv: Don't allocate static TLS for dynamic TLS relocations Provided you don't run out of extra static TLS space this should work, but it's wholly unnecessary and not how things are supposed to be done. Only static TLS relocations should allocate static TLS. Reviewed by: kib Fixes: 4b1859c0e943 ("Add support for RISC-V architecture.") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50563 (cherry picked from commit 03801d449a3731cb643a51625c8c4d5d07b2e54c) --- libexec/rtld-elf/riscv/reloc.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/libexec/rtld-elf/riscv/reloc.c b/libexec/rtld-elf/riscv/reloc.c index 8dd225e5a920..03d3c2d0c9ba 100644 --- a/libexec/rtld-elf/riscv/reloc.c +++ b/libexec/rtld-elf/riscv/reloc.c @@ -405,23 +405,6 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, lockstate); if (def == NULL) return (-1); - /* - * We lazily allocate offsets for static TLS as we - * see the first relocation that references the - * TLS block. This allows us to support (small - * amounts of) static TLS in dynamically loaded - * modules. If we run out of space, we generate an - * error. - */ - if (!defobj->tls_static) { - if (!allocate_tls_offset( - __DECONST(Obj_Entry *, defobj))) { - _rtld_error( - "%s: No space available for static " - "Thread Local Storage", obj->path); - return (-1); - } - } *where += (Elf_Addr)(def->st_value + rela->r_addend - TLS_DTV_OFFSET);help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69403eab.e419.5d04c434>
