Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Apr 2022 20:55:10 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: b602867013cf - stable/13 - mips: Add TLS_DTV_OFFSET to the result of tls_get_addr_common.
Message-ID:  <202204292055.23TKtAq1055289@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by jhb:

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

commit b602867013cfb41b2b884f0fc50748c4f12608d4
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2021-12-09 21:16:19 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-29 20:50:05 +0000

    mips: Add TLS_DTV_OFFSET to the result of tls_get_addr_common.
    
    Previously TLS_DTV_OFFSET was added to the offset passed to
    tls_get_addr_common; however, this approach matches powerpc and RISC-V
    and better matches the intention.
    
    Reviewed by:    kib, jrtc27
    Sponsored by:   The University of Cambridge, Google Inc.
    Differential Revision:  https://reviews.freebsd.org/D33347
    
    (cherry picked from commit 23e0c0e9a3e0c73169c2aa90e26bb5cb35f1aa2f)
---
 libexec/rtld-elf/mips/reloc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libexec/rtld-elf/mips/reloc.c b/libexec/rtld-elf/mips/reloc.c
index d870b8a1952c..a39a96e20b00 100644
--- a/libexec/rtld-elf/mips/reloc.c
+++ b/libexec/rtld-elf/mips/reloc.c
@@ -783,8 +783,7 @@ __tls_get_addr(tls_index* ti)
 	char *p;
 
 	tls = _get_tp();
-	p = tls_get_addr_common(tls, ti->ti_module, ti->ti_offset +
-	    TLS_DTV_OFFSET);
+	p = tls_get_addr_common(tls, ti->ti_module, ti->ti_offset);
 
-	return (p);
+	return (p + TLS_DTV_OFFSET);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202204292055.23TKtAq1055289>