Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/ld.elf_so ld.elf_so: Sprinkle tls debug messages.



details:   https://anonhg.NetBSD.org/src/rev/d3eaef198da3
branches:  trunk
changeset: 376086:d3eaef198da3
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed May 31 18:44:39 2023 +0000

description:
ld.elf_so: Sprinkle tls debug messages.

XXX pullup-10

diffstat:

 libexec/ld.elf_so/map_object.c |  12 +++++++++---
 libexec/ld.elf_so/tls.c        |   6 ++++--
 2 files changed, 13 insertions(+), 5 deletions(-)

diffs (68 lines):

diff -r aa5fd928ccb0 -r d3eaef198da3 libexec/ld.elf_so/map_object.c
--- a/libexec/ld.elf_so/map_object.c    Wed May 31 18:04:00 2023 +0000
+++ b/libexec/ld.elf_so/map_object.c    Wed May 31 18:44:39 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: map_object.c,v 1.65 2023/01/12 19:17:11 christos Exp $  */
+/*     $NetBSD: map_object.c,v 1.66 2023/05/31 18:44:39 riastradh Exp $         */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: map_object.c,v 1.65 2023/01/12 19:17:11 christos Exp $");
+__RCSID("$NetBSD: map_object.c,v 1.66 2023/05/31 18:44:39 riastradh Exp $");
 #endif /* not lint */
 
 #include <errno.h>
@@ -310,6 +310,9 @@ Obj_Entry *
                obj->tlsalign = phtls->p_align;
                obj->tlsinitsize = phtls->p_filesz;
                tls_vaddr = phtls->p_vaddr;
+               dbg(("%s: tls index %zu size %zu align %zu initsize %zu",
+                   obj->path, obj->tlsindex, obj->tlssize, obj->tlsalign,
+                   obj->tlsinitsize));
        }
 #endif
 
@@ -437,8 +440,11 @@ Obj_Entry *
        }
 
 #if defined(__HAVE_TLS_VARIANT_I) || defined(__HAVE_TLS_VARIANT_II)
-       if (phtls != NULL)
+       if (phtls != NULL) {
                obj->tlsinit = mapbase + tls_vaddr;
+               dbg(("%s: tls init = %p + %"PRImemsz" = %p", obj->path,
+                   mapbase, tls_vaddr, obj->tlsinit));
+       }
 #endif
 
        obj->mapbase = mapbase;
diff -r aa5fd928ccb0 -r d3eaef198da3 libexec/ld.elf_so/tls.c
--- a/libexec/ld.elf_so/tls.c   Wed May 31 18:04:00 2023 +0000
+++ b/libexec/ld.elf_so/tls.c   Wed May 31 18:44:39 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tls.c,v 1.15 2023/02/10 08:12:48 skrll Exp $   */
+/*     $NetBSD: tls.c,v 1.16 2023/05/31 18:44:39 riastradh Exp $       */
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: tls.c,v 1.15 2023/02/10 08:12:48 skrll Exp $");
+__RCSID("$NetBSD: tls.c,v 1.16 2023/05/31 18:44:39 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/ucontext.h>
@@ -261,6 +261,8 @@ int
                }
        }
        obj->tlsoffset = offset;
+       dbg(("%s: static tls offset 0x%zx size %zu\n",
+           obj->path, obj->tlsoffset, obj->tlssize));
        _rtld_tls_static_offset = next_offset;
        obj->tls_done = 1;
 



Home | Main Index | Thread Index | Old Index