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 Add debug code.



details:   https://anonhg.NetBSD.org/src/rev/e503fab040d0
branches:  trunk
changeset: 790671:e503fab040d0
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sat Oct 19 10:14:06 2013 +0000

description:
Add debug code.

diffstat:

 libexec/ld.elf_so/tls.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (49 lines):

diff -r 2dc683b019ec -r e503fab040d0 libexec/ld.elf_so/tls.c
--- a/libexec/ld.elf_so/tls.c   Sat Oct 19 09:31:24 2013 +0000
+++ b/libexec/ld.elf_so/tls.c   Sat Oct 19 10:14:06 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tls.c,v 1.7 2011/04/23 16:40:08 joerg Exp $    */
+/*     $NetBSD: tls.c,v 1.8 2013/10/19 10:14:06 skrll Exp $    */
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,12 +29,13 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: tls.c,v 1.7 2011/04/23 16:40:08 joerg Exp $");
+__RCSID("$NetBSD: tls.c,v 1.8 2013/10/19 10:14:06 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/ucontext.h>
 #include <lwp.h>
 #include <string.h>
+#include "debug.h"
 #include "rtld.h"
 
 #if defined(__HAVE_TLS_VARIANT_I) || defined(__HAVE_TLS_VARIANT_II)
@@ -100,6 +101,7 @@
        _rtld_tls_static_space = roundup2(_rtld_tls_static_space,
            sizeof(void *));
 #endif
+       dbg(("_rtld_tls_static_space %zu", _rtld_tls_static_space));
 
        tcb = _rtld_tls_allocate_locked();
 #ifdef __HAVE___LWP_SETTCB
@@ -132,6 +134,7 @@
        tcb = (struct tls_tcb *)p;
        tcb->tcb_self = tcb;
 #endif
+       dbg(("tcb %p", tcb));
        tcb->tcb_dtv = xcalloc(sizeof(*tcb->tcb_dtv) * (2 + _rtld_tls_max_index));
        ++tcb->tcb_dtv;
        SET_DTV_MAX_INDEX(tcb->tcb_dtv, _rtld_tls_max_index);
@@ -144,6 +147,8 @@
 #else
                        q = p - obj->tlsoffset;
 #endif
+                       dbg(("obj %p dtv %p tlsoffset %zu",
+                           obj, q, obj->tlsoffset));
                        memcpy(q, obj->tlsinit, obj->tlsinitsize);
                        tcb->tcb_dtv[obj->tlsindex] = q;
                }



Home | Main Index | Thread Index | Old Index