From 2feaef06e3ecb28a8fd9bd511539515b1a302362 Mon Sep 17 00:00:00 2001 From: joerg Date: Sun, 27 Mar 2011 13:15:34 +0000 Subject: [PATCH] Add some debug messages for explicit rtld entry points --- libexec/ld.elf_so/rtld.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libexec/ld.elf_so/rtld.c b/libexec/ld.elf_so/rtld.c index 03944e7b3f23..06e505b7075b 100644 --- a/libexec/ld.elf_so/rtld.c +++ b/libexec/ld.elf_so/rtld.c @@ -1,4 +1,4 @@ -/* $NetBSD: rtld.c,v 1.143 2011/03/27 13:14:42 joerg Exp $ */ +/* $NetBSD: rtld.c,v 1.144 2011/03/27 13:15:34 joerg Exp $ */ /* * Copyright 1996 John D. Polstra. @@ -40,7 +40,7 @@ #include #ifndef lint -__RCSID("$NetBSD: rtld.c,v 1.143 2011/03/27 13:14:42 joerg Exp $"); +__RCSID("$NetBSD: rtld.c,v 1.144 2011/03/27 13:15:34 joerg Exp $"); #endif /* not lint */ #include @@ -841,6 +841,7 @@ dlclose(void *handle) { Obj_Entry *root; + dbg(("dlclose of %p", handle)); _rtld_exclusive_enter(); @@ -885,6 +886,8 @@ dlopen(const char *name, int mode) bool nodelete; bool now; + dbg(("dlopen of %s %d", name, mode)); + _rtld_exclusive_enter(); flags |= (mode & RTLD_GLOBAL) ? _RTLD_GLOBAL : 0; @@ -985,6 +988,8 @@ dlsym(void *handle, const char *name) void *retaddr; DoneList donelist; + dbg(("dlsym of %s in %p", name, handle)); + lookup_mutex_enter(); hash = _rtld_elf_hash(name); @@ -1095,6 +1100,8 @@ dladdr(const void *addr, Dl_info *info) void *symbol_addr; unsigned long symoffset; + dbg(("dladdr of %p", addr)); + lookup_mutex_enter(); #ifdef __HAVE_FUNCTION_DESCRIPTORS @@ -1163,6 +1170,8 @@ dlinfo(void *handle, int req, void *v) const Obj_Entry *obj; void *retaddr; + dbg(("dlinfo for %p %d", handle, req)); + _rtld_shared_enter(); if (handle == RTLD_SELF) { @@ -1211,6 +1220,8 @@ dl_iterate_phdr(int (*callback)(struct dl_phdr_info *, size_t, void *), void *pa const Obj_Entry *obj; int error = 0; + dbg(("dl_iterate_phdr")); + _rtld_shared_enter(); for (obj = _rtld_objlist; obj != NULL; obj = obj->next) {