17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
55aefb655Srie  * Common Development and Distribution License (the "License").
65aefb655Srie  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
215aefb655Srie 
227c478bd9Sstevel@tonic-gate /*
23*69112eddSAli Bahrami  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
245aefb655Srie  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #include	"msg.h"
287c478bd9Sstevel@tonic-gate #include	"_debug.h"
297c478bd9Sstevel@tonic-gate #include	"libld.h"
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate /*
327c478bd9Sstevel@tonic-gate  * Print out a single `entry descriptor' entry.
337c478bd9Sstevel@tonic-gate  */
347c478bd9Sstevel@tonic-gate void
Dbg_ent_entry(Lm_list * lml,uchar_t osabi,Half mach,Ent_desc * enp)354f680cc6SAli Bahrami Dbg_ent_entry(Lm_list *lml, uchar_t osabi, Half mach, Ent_desc *enp)
367c478bd9Sstevel@tonic-gate {
37*69112eddSAli Bahrami 	union {
38*69112eddSAli Bahrami 		Conv_inv_buf_t			inv;
39*69112eddSAli Bahrami 		Conv_sec_flags_buf_t		sec_flags;
40*69112eddSAli Bahrami 		Conv_ent_flags_buf_t		ent_flags;
41*69112eddSAli Bahrami 		Conv_ent_files_flags_buf_t	ent_files_flags;
42*69112eddSAli Bahrami 	} buf;
4357ef7aa9SRod Evans 	Aliste			idx;
44*69112eddSAli Bahrami 	Ent_desc_file		*edfp;
457c478bd9Sstevel@tonic-gate 
46*69112eddSAli Bahrami 	if (enp->ec_name != NULL)
47*69112eddSAli Bahrami 		dbg_print(lml, MSG_ORIG(MSG_ECR_NAME), enp->ec_name);
48*69112eddSAli Bahrami 
49*69112eddSAli Bahrami 	dbg_print(lml, MSG_ORIG(MSG_ECR_FLAGS),
50*69112eddSAli Bahrami 	    conv_ent_flags(enp->ec_flags, &buf.ent_flags));
51*69112eddSAli Bahrami 
52*69112eddSAli Bahrami 	dbg_print(lml, MSG_ORIG(MSG_ECR_IS_NAME),
53*69112eddSAli Bahrami 	    (enp->ec_is_name ? enp->ec_is_name : MSG_INTL(MSG_STR_NULL)),
54*69112eddSAli Bahrami 	    conv_sec_flags(osabi, mach, enp->ec_attrmask, 0, &buf.sec_flags));
557c478bd9Sstevel@tonic-gate 
565aefb655Srie 	dbg_print(lml, MSG_ORIG(MSG_ECR_SEGMENT),
577c478bd9Sstevel@tonic-gate 	    (enp->ec_segment->sg_name ? enp->ec_segment->sg_name :
58de777a60Sab 	    MSG_INTL(MSG_STR_NULL)),
59*69112eddSAli Bahrami 	    conv_sec_flags(osabi, mach, enp->ec_attrbits, 0, &buf.sec_flags));
607c478bd9Sstevel@tonic-gate 
6157ef7aa9SRod Evans 	dbg_print(lml, MSG_ORIG(MSG_ECR_NDX), EC_WORD(enp->ec_ordndx),
62*69112eddSAli Bahrami 	    conv_sec_type(osabi, mach, enp->ec_type, 0, &buf.inv));
637c478bd9Sstevel@tonic-gate 
6457ef7aa9SRod Evans 	if (enp->ec_files) {
655aefb655Srie 		dbg_print(lml, MSG_ORIG(MSG_ECR_FILES));
66*69112eddSAli Bahrami 		for (ALIST_TRAVERSE(enp->ec_files, idx, edfp))
67*69112eddSAli Bahrami 			dbg_print(lml, MSG_ORIG(MSG_ECR_FILE),
68*69112eddSAli Bahrami 			    conv_ent_files_flags(edfp->edf_flags, 0,
69*69112eddSAli Bahrami 			    &buf.ent_files_flags), edfp->edf_name);
707c478bd9Sstevel@tonic-gate 	}
717c478bd9Sstevel@tonic-gate }
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate /*
747c478bd9Sstevel@tonic-gate  * Print out all `entrance descriptor' entries.
757c478bd9Sstevel@tonic-gate  */
767c478bd9Sstevel@tonic-gate void
Dbg_ent_print(Lm_list * lml,uchar_t osabi,Half mach,APlist * alp)77*69112eddSAli Bahrami Dbg_ent_print(Lm_list *lml, uchar_t osabi, Half mach, APlist *alp)
787c478bd9Sstevel@tonic-gate {
797c478bd9Sstevel@tonic-gate 	Ent_desc	*enp;
8057ef7aa9SRod Evans 	Aliste		ndx;
817c478bd9Sstevel@tonic-gate 
825aefb655Srie 	if (DBG_NOTCLASS(DBG_C_ENTRY))
837c478bd9Sstevel@tonic-gate 		return;
847c478bd9Sstevel@tonic-gate 
855aefb655Srie 	Dbg_util_nl(lml, DBG_NL_STD);
86*69112eddSAli Bahrami 	dbg_print(lml, MSG_INTL(MSG_ECR_TITLE));
877c478bd9Sstevel@tonic-gate 
88*69112eddSAli Bahrami 	for (APLIST_TRAVERSE(alp, ndx, enp)) {
8957ef7aa9SRod Evans 		dbg_print(lml, MSG_INTL(MSG_ECR_DESC), EC_WORD(ndx));
904f680cc6SAli Bahrami 		Dbg_ent_entry(lml, osabi, mach, enp);
917c478bd9Sstevel@tonic-gate 	}
927c478bd9Sstevel@tonic-gate }
93