changeset 11696:d5bf02b6c6d2

6914728 Add dl_iterate_phdr() function to ld.so.1 (fix missing file, fix versioning) PSARC/2010/015 dl_iterate_phdr
author Ali Bahrami <Ali.Bahrami@Sun.COM>
date Thu, 18 Feb 2010 15:48:33 -0700
parents 04bf1fc2c3f2
children 46111b6bb577
files usr/src/cmd/sgs/libdl/amd64/mapfile-vers usr/src/cmd/sgs/libdl/common/mapfile-vers usr/src/cmd/sgs/libdl/i386/mapfile-vers usr/src/cmd/sgs/libdl/sparc/mapfile-vers usr/src/cmd/sgs/libdl/sparcv9/mapfile-vers usr/src/cmd/sgs/liblddbg/common/callback.c
diffstat 6 files changed, 99 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/sgs/libdl/amd64/mapfile-vers	Thu Feb 18 21:43:27 2010 +0000
+++ b/usr/src/cmd/sgs/libdl/amd64/mapfile-vers	Thu Feb 18 15:48:33 2010 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # CDDL HEADER START
@@ -36,6 +36,11 @@
 # MAPFILE HEADER END
 #
 
+SUNW_1.6 {
+    global:
+	dl_iterate_phdr = FUNCTION;
+} SUNW_1.5;
+
 SUNW_1.5 {
 	global:
 	dlamd64getunwind = FUNCTION;
--- a/usr/src/cmd/sgs/libdl/common/mapfile-vers	Thu Feb 18 21:43:27 2010 +0000
+++ b/usr/src/cmd/sgs/libdl/common/mapfile-vers	Thu Feb 18 15:48:33 2010 -0700
@@ -38,18 +38,6 @@
 # MAPFILE HEADER END
 #
 
-SUNW_1.6 {
-    global:
-	dl_iterate_phdr = FUNCTION;
-} SUNW_1.5;
-
-
-SUNW_1.5 {
-    global:
-	SUNW_1.5;
-} SUNW_1.4;
-
-
 SUNW_1.4 {
     global:
 	dladdr1 = FUNCTION;
--- a/usr/src/cmd/sgs/libdl/i386/mapfile-vers	Thu Feb 18 21:43:27 2010 +0000
+++ b/usr/src/cmd/sgs/libdl/i386/mapfile-vers	Thu Feb 18 15:48:33 2010 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # CDDL HEADER START
@@ -36,6 +36,11 @@
 # MAPFILE HEADER END
 #
 
+SUNW_1.5 {
+    global:
+	dl_iterate_phdr = FUNCTION;
+} SUNW_1.4;
+
 SUNW_0.8 {
     global:
 	dladdr = FUNCTION;
--- a/usr/src/cmd/sgs/libdl/sparc/mapfile-vers	Thu Feb 18 21:43:27 2010 +0000
+++ b/usr/src/cmd/sgs/libdl/sparc/mapfile-vers	Thu Feb 18 15:48:33 2010 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # CDDL HEADER START
@@ -36,6 +36,11 @@
 # MAPFILE HEADER END
 #
 
+SUNW_1.5 {
+    global:
+	dl_iterate_phdr = FUNCTION;
+} SUNW_1.4;
+
 SUNW_0.8 {
     global:
 	dladdr = FUNCTION;
--- a/usr/src/cmd/sgs/libdl/sparcv9/mapfile-vers	Thu Feb 18 21:43:27 2010 +0000
+++ b/usr/src/cmd/sgs/libdl/sparcv9/mapfile-vers	Thu Feb 18 15:48:33 2010 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # CDDL HEADER START
@@ -36,6 +36,11 @@
 # MAPFILE HEADER END
 #
 
+SUNW_1.5 {
+    global:
+	dl_iterate_phdr = FUNCTION;
+} SUNW_1.4;
+
 SUNW_0.8 {
     global:
 	dladdr = FUNCTION ;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/sgs/liblddbg/common/callback.c	Thu Feb 18 15:48:33 2010 -0700
@@ -0,0 +1,75 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include	"msg.h"
+#include	"_debug.h"
+#include	"libld.h"
+
+void
+Dbg_cb_iphdr_enter(Lm_list *lml, u_longlong_t cnt_map, u_longlong_t cnt_unmap)
+{
+	if (DBG_NOTCLASS(DBG_C_CALLBACK))
+		return;
+
+	Dbg_util_nl(lml, DBG_NL_STD);
+	dbg_print(lml, MSG_INTL(MSG_CB_IPHDR_ENTER));
+	dbg_print(lml, MSG_INTL(MSG_CB_IPHDR_MAPCNT), cnt_map, cnt_unmap);
+}
+
+void
+Dbg_cb_iphdr_callback(Lm_list *lml, struct dl_phdr_info *info)
+{
+	if (DBG_NOTCLASS(DBG_C_CALLBACK))
+		return;
+
+	dbg_print(lml, MSG_INTL(MSG_CB_IPHDR_CALLBACK));
+	dbg_print(lml, MSG_INTL(MSG_CB_IPHDR_NAME), info->dlpi_name);
+	dbg_print(lml, MSG_INTL(MSG_CB_IPHDR_ADDR), EC_ADDR(info->dlpi_addr));
+	dbg_print(lml, MSG_INTL(MSG_CB_IPHDR_PHDR),
+	    EC_ADDR(CAST_PTRINT(Addr, info->dlpi_phdr)),
+	    EC_WORD(info->dlpi_phnum));
+
+}
+
+void
+Dbg_cb_iphdr_mapchange(Lm_list *lml, u_longlong_t cnt_map,
+    u_longlong_t cnt_unmap)
+{
+	if (DBG_NOTCLASS(DBG_C_CALLBACK))
+		return;
+
+	dbg_print(lml, MSG_INTL(MSG_CB_IPHDR_MAPCNG));
+	dbg_print(lml, MSG_INTL(MSG_CB_IPHDR_MAPCNT), cnt_map, cnt_unmap);
+}
+
+void
+Dbg_cb_iphdr_unmap_ret(Lm_list *lml)
+{
+	if (DBG_NOTCLASS(DBG_C_CALLBACK))
+		return;
+
+	dbg_print(lml, MSG_INTL(MSG_CB_IPHDR_UNMAP));
+}