Date: Thu, 12 Jun 2025 19:31:13 GMT From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: f1830ad9e727 - stable/14 - rtld amd64: extend osrel check to enable tlsbase op on stable/14 Message-ID: <202506121931.55CJVDI1032878@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f1830ad9e727f990d0124e89d9a9f7cd759d42a6 commit f1830ad9e727f990d0124e89d9a9f7cd759d42a6 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2025-06-12 19:29:19 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2025-06-12 19:29:19 +0000 rtld amd64: extend osrel check to enable tlsbase op on stable/14 This is a direct commit to stable/14. Reported by: Mark Millard <marklmi@yahoo.com> Sponsored by: The FreeBSD Foundation --- libexec/rtld-elf/amd64/reloc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c index 74693d35ba1d..e46f6bc2e9b5 100644 --- a/libexec/rtld-elf/amd64/reloc.c +++ b/libexec/rtld-elf/amd64/reloc.c @@ -519,6 +519,8 @@ void allocate_initial_tls(Obj_Entry *objs) { void *addr; + int osrel; + /* * Fix the size of the static TLS block by using the maximum @@ -533,7 +535,9 @@ allocate_initial_tls(Obj_Entry *objs) * This does not use _tcb_set() as it calls amd64_set_tlsbase() * which is an ifunc and rtld must not use ifuncs. */ - if (__getosreldate() >= P_OSREL_TLSBASE) + osrel = __getosreldate(); + if (osrel >= P_OSREL_TLSBASE || + (P_OSREL_MAJOR(osrel) == 14 && osrel >= 1403502)) sysarch(AMD64_SET_TLSBASE, &addr); else if (__getosreldate() >= P_OSREL_WRFSBASE && (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202506121931.55CJVDI1032878>