The branch stable/14 has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f1830ad9e727f990d0124e89d9a9f7cd759d42a6

commit f1830ad9e727f990d0124e89d9a9f7cd759d42a6
Author:     Konstantin Belousov <k...@freebsd.org>
AuthorDate: 2025-06-12 19:29:19 +0000
Commit:     Konstantin Belousov <k...@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 <mark...@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)

Reply via email to