git: 03f6b141068e - main - mips: Rename TLS_DTP_OFFSET to TLS_DTV_OFFSET.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 09 Dec 2021 21:23:38 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=03f6b141068ee7f1004ebfc76242cf951494b7d2
commit 03f6b141068ee7f1004ebfc76242cf951494b7d2
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2021-12-09 21:16:00 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2021-12-09 21:16:00 +0000
mips: Rename TLS_DTP_OFFSET to TLS_DTV_OFFSET.
This is the more standard name for the bias of dtv pointers used on
other platforms. This also fixes a few other places that were using
the wrong bias previously on MIPS such as dlpi_tls_data in struct
dl_phdr_info and the recently added __libc_tls_get_addr().
Reviewed by: kib, jrtc27
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33346
---
libexec/rtld-elf/mips/reloc.c | 4 ++--
libexec/rtld-elf/mips/rtld_machdep.h | 1 -
sys/mips/include/tls.h | 2 +-
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/libexec/rtld-elf/mips/reloc.c b/libexec/rtld-elf/mips/reloc.c
index 44ecbd66a707..d870b8a1952c 100644
--- a/libexec/rtld-elf/mips/reloc.c
+++ b/libexec/rtld-elf/mips/reloc.c
@@ -591,7 +591,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags,
if (!defobj->tls_done && !allocate_tls_offset(obj))
return -1;
- val += (Elf_Addr)def->st_value - TLS_DTP_OFFSET;
+ val += (Elf_Addr)def->st_value - TLS_DTV_OFFSET;
store_ptr(where, val, rlen);
dbg("DTPREL %s in %s %p --> %p in %s",
@@ -784,7 +784,7 @@ __tls_get_addr(tls_index* ti)
tls = _get_tp();
p = tls_get_addr_common(tls, ti->ti_module, ti->ti_offset +
- TLS_DTP_OFFSET);
+ TLS_DTV_OFFSET);
return (p);
}
diff --git a/libexec/rtld-elf/mips/rtld_machdep.h b/libexec/rtld-elf/mips/rtld_machdep.h
index 0cb56290152e..eac122beaa46 100644
--- a/libexec/rtld-elf/mips/rtld_machdep.h
+++ b/libexec/rtld-elf/mips/rtld_machdep.h
@@ -78,6 +78,5 @@ extern void *__tls_get_addr(tls_index *ti);
#define md_abi_variant_hook(x)
#define TLS_VARIANT_I 1
-#define TLS_DTV_OFFSET 0
#endif
diff --git a/sys/mips/include/tls.h b/sys/mips/include/tls.h
index 19743d9a7883..c71507b773b0 100644
--- a/sys/mips/include/tls.h
+++ b/sys/mips/include/tls.h
@@ -39,7 +39,7 @@
*/
#define TLS_TP_OFFSET 0x7000
-#define TLS_DTP_OFFSET 0x8000
+#define TLS_DTV_OFFSET 0x8000
#ifdef __mips_n64
#define TLS_TCB_SIZE 16