xref: /onnv-gate/usr/src/cmd/sgs/libconv/common/dynamic.c (revision 9273:9a0603d78ad3)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
51618Srie  * Common Development and Distribution License (the "License").
61618Srie  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
211618Srie 
220Sstevel@tonic-gate /*
23*9273SAli.Bahrami@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate /*
280Sstevel@tonic-gate  * String conversion routine for .dynamic tag entries.
290Sstevel@tonic-gate  */
300Sstevel@tonic-gate #include	<stdio.h>
310Sstevel@tonic-gate #include	<string.h>
320Sstevel@tonic-gate #include	<sys/elf_SPARC.h>
33280Srie #include	"rtld.h"
340Sstevel@tonic-gate #include	"_conv.h"
350Sstevel@tonic-gate #include	"dynamic_msg.h"
360Sstevel@tonic-gate 
373492Sab196087 
383492Sab196087 
39*9273SAli.Bahrami@Sun.COM const Val_desc *
40*9273SAli.Bahrami@Sun.COM conv_dyn_posflag1_strings(Conv_fmt_flags_t fmt_flags)
41*9273SAli.Bahrami@Sun.COM {
422352Sab196087 #define	POSSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
43*9273SAli.Bahrami@Sun.COM 	MSG_DF_P1_LAZYLOAD_CF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
44*9273SAli.Bahrami@Sun.COM 	MSG_DF_P1_GROUPPERM_CF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
45*9273SAli.Bahrami@Sun.COM 	CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
464734Sab196087 
47*9273SAli.Bahrami@Sun.COM 	/*
48*9273SAli.Bahrami@Sun.COM 	 * Ensure that Conv_dyn_posflag1_buf_t is large enough:
49*9273SAli.Bahrami@Sun.COM 	 *
50*9273SAli.Bahrami@Sun.COM 	 * POSSZ is the real minimum size of the buffer required by
51*9273SAli.Bahrami@Sun.COM 	 * conv_dyn_posflag1(). However, Conv_dyn_posflag1_buf_t uses
52*9273SAli.Bahrami@Sun.COM 	 * CONV_DYN_POSFLAG1_BUFSIZE to set the buffer size. We do things
53*9273SAli.Bahrami@Sun.COM 	 * this way because the definition of POSSZ uses
54*9273SAli.Bahrami@Sun.COM 	 * information that is not available in the environment of other
55*9273SAli.Bahrami@Sun.COM 	 * programs that include the conv.h header file.
56*9273SAli.Bahrami@Sun.COM 	 */
575152Sab196087 #if (CONV_DYN_POSFLAG1_BUFSIZE != POSSZ) && !defined(__lint)
585152Sab196087 #define	REPORT_BUFSIZE POSSZ
595152Sab196087 #include "report_bufsize.h"
605152Sab196087 #error "CONV_DYN_POSFLAG1_BUFSIZE does not match POSSZ"
614734Sab196087 #endif
620Sstevel@tonic-gate 
63*9273SAli.Bahrami@Sun.COM 	static const Val_desc vda_def[] = {
64*9273SAli.Bahrami@Sun.COM 		{ DF_P1_LAZYLOAD,	MSG_DF_P1_LAZYLOAD_DEF },
65*9273SAli.Bahrami@Sun.COM 		{ DF_P1_GROUPPERM,	MSG_DF_P1_GROUPPERM_CFNP },
661618Srie 		{ 0,			0 }
671618Srie 	};
68*9273SAli.Bahrami@Sun.COM 	static const Val_desc vda_cf[] = {
69*9273SAli.Bahrami@Sun.COM 		{ DF_P1_LAZYLOAD,	MSG_DF_P1_LAZYLOAD_CF },
70*9273SAli.Bahrami@Sun.COM 		{ DF_P1_GROUPPERM,	MSG_DF_P1_GROUPPERM_CF },
71*9273SAli.Bahrami@Sun.COM 		{ 0,			0 }
72*9273SAli.Bahrami@Sun.COM 	};
73*9273SAli.Bahrami@Sun.COM 	static const Val_desc vda_cfnp[] = {
74*9273SAli.Bahrami@Sun.COM 		{ DF_P1_LAZYLOAD,	MSG_DF_P1_LAZYLOAD_CFNP },
75*9273SAli.Bahrami@Sun.COM 		{ DF_P1_GROUPPERM,	MSG_DF_P1_GROUPPERM_CFNP },
76*9273SAli.Bahrami@Sun.COM 		{ 0,			0 }
77*9273SAli.Bahrami@Sun.COM 	};
78*9273SAli.Bahrami@Sun.COM 	static const Val_desc vda_nf[] = {
79*9273SAli.Bahrami@Sun.COM 		{ DF_P1_LAZYLOAD,	MSG_DF_P1_LAZYLOAD_NF },
80*9273SAli.Bahrami@Sun.COM 		{ DF_P1_GROUPPERM,	MSG_DF_P1_GROUPPERM_NF },
812352Sab196087 		{ 0,			0 }
822352Sab196087 	};
831618Srie 
84*9273SAli.Bahrami@Sun.COM 	switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
85*9273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_DUMP:
86*9273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_CFNP:
87*9273SAli.Bahrami@Sun.COM 		return (vda_cfnp);
88*9273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_CF:
89*9273SAli.Bahrami@Sun.COM 		return (vda_cf);
90*9273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_NF:
91*9273SAli.Bahrami@Sun.COM 		return (vda_nf);
92*9273SAli.Bahrami@Sun.COM 	}
930Sstevel@tonic-gate 
94*9273SAli.Bahrami@Sun.COM 	return (vda_def);
95*9273SAli.Bahrami@Sun.COM }
960Sstevel@tonic-gate 
97*9273SAli.Bahrami@Sun.COM conv_iter_ret_t
98*9273SAli.Bahrami@Sun.COM conv_iter_dyn_posflag1(Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func,
99*9273SAli.Bahrami@Sun.COM     void *uvalue)
100*9273SAli.Bahrami@Sun.COM {
101*9273SAli.Bahrami@Sun.COM 	return (conv_iter_vd(conv_dyn_posflag1_strings(fmt_flags),
102*9273SAli.Bahrami@Sun.COM 	    func, uvalue));
1030Sstevel@tonic-gate }
1040Sstevel@tonic-gate 
105*9273SAli.Bahrami@Sun.COM const Val_desc *
106*9273SAli.Bahrami@Sun.COM conv_dyn_flag_strings(Conv_fmt_flags_t fmt_flags)
107*9273SAli.Bahrami@Sun.COM {
1082352Sab196087 #define	FLAGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
109*9273SAli.Bahrami@Sun.COM 	MSG_DF_ORIGIN_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
110*9273SAli.Bahrami@Sun.COM 	MSG_DF_SYMBOLIC_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
111*9273SAli.Bahrami@Sun.COM 	MSG_DF_TEXTREL_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
112*9273SAli.Bahrami@Sun.COM 	MSG_DF_BIND_NOW_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
113*9273SAli.Bahrami@Sun.COM 	MSG_DF_STATIC_TLS_CF_SIZE 	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
114*9273SAli.Bahrami@Sun.COM 	CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
1154734Sab196087 
116*9273SAli.Bahrami@Sun.COM 	/*
117*9273SAli.Bahrami@Sun.COM 	 * Ensure that Conv_dyn_flag_buf_t is large enough:
118*9273SAli.Bahrami@Sun.COM 	 *
119*9273SAli.Bahrami@Sun.COM 	 * FLAGSZ is the real minimum size of the buffer required by
120*9273SAli.Bahrami@Sun.COM 	 * conv_dyn_flag(). However, Conv_dyn_flag_buf_t uses
121*9273SAli.Bahrami@Sun.COM 	 * CONV_DYN_FLAG_BUFSIZE to set the buffer size. We do things this
122*9273SAli.Bahrami@Sun.COM 	 * way because the definition of FLAGSZ uses information that is not
123*9273SAli.Bahrami@Sun.COM 	 * available in the environment of other programs that include the
124*9273SAli.Bahrami@Sun.COM 	 * conv.h header file.
125*9273SAli.Bahrami@Sun.COM 	 */
1265152Sab196087 #if (CONV_DYN_FLAG_BUFSIZE != FLAGSZ) && !defined(__lint)
1275152Sab196087 #define	REPORT_BUFSIZE FLAGSZ
1285152Sab196087 #include "report_bufsize.h"
1295152Sab196087 #error "CONV_DYN_FLAG_BUFSIZE does not match FLAGSZ"
1304734Sab196087 #endif
131*9273SAli.Bahrami@Sun.COM 
132*9273SAli.Bahrami@Sun.COM 	static const Val_desc vda_cf[] = {
133*9273SAli.Bahrami@Sun.COM 		{ DF_ORIGIN,		MSG_DF_ORIGIN_CF },
134*9273SAli.Bahrami@Sun.COM 		{ DF_SYMBOLIC,		MSG_DF_SYMBOLIC_CF },
135*9273SAli.Bahrami@Sun.COM 		{ DF_TEXTREL,		MSG_DF_TEXTREL_CF },
136*9273SAli.Bahrami@Sun.COM 		{ DF_BIND_NOW,		MSG_DF_BIND_NOW_CF },
137*9273SAli.Bahrami@Sun.COM 		{ DF_STATIC_TLS,	MSG_DF_STATIC_TLS_CF },
138*9273SAli.Bahrami@Sun.COM 		{ 0 }
139*9273SAli.Bahrami@Sun.COM 	};
140*9273SAli.Bahrami@Sun.COM 	static const Val_desc vda_cfnp[] = {
141*9273SAli.Bahrami@Sun.COM 		{ DF_ORIGIN,		MSG_DF_ORIGIN_CFNP },
142*9273SAli.Bahrami@Sun.COM 		{ DF_SYMBOLIC,		MSG_DF_SYMBOLIC_CFNP },
143*9273SAli.Bahrami@Sun.COM 		{ DF_TEXTREL,		MSG_DF_TEXTREL_CFNP },
144*9273SAli.Bahrami@Sun.COM 		{ DF_BIND_NOW,		MSG_DF_BIND_NOW_CFNP },
145*9273SAli.Bahrami@Sun.COM 		{ DF_STATIC_TLS,	MSG_DF_STATIC_TLS_CFNP },
146*9273SAli.Bahrami@Sun.COM 		{ 0 }
1471618Srie 	};
148*9273SAli.Bahrami@Sun.COM 	static const Val_desc vda_nf[] = {
149*9273SAli.Bahrami@Sun.COM 		{ DF_ORIGIN,		MSG_DF_ORIGIN_NF },
150*9273SAli.Bahrami@Sun.COM 		{ DF_SYMBOLIC,		MSG_DF_SYMBOLIC_NF },
151*9273SAli.Bahrami@Sun.COM 		{ DF_TEXTREL,		MSG_DF_TEXTREL_NF },
152*9273SAli.Bahrami@Sun.COM 		{ DF_BIND_NOW,		MSG_DF_BIND_NOW_NF },
153*9273SAli.Bahrami@Sun.COM 		{ DF_STATIC_TLS,	MSG_DF_STATIC_TLS_NF },
154*9273SAli.Bahrami@Sun.COM 		{ 0 }
155*9273SAli.Bahrami@Sun.COM 	};
1560Sstevel@tonic-gate 
157*9273SAli.Bahrami@Sun.COM 	switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
158*9273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_CF:
159*9273SAli.Bahrami@Sun.COM 		return (vda_cf);
160*9273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_NF:
161*9273SAli.Bahrami@Sun.COM 		return (vda_nf);
1622352Sab196087 	}
1630Sstevel@tonic-gate 
164*9273SAli.Bahrami@Sun.COM 	return (vda_cfnp);
1650Sstevel@tonic-gate }
1660Sstevel@tonic-gate 
167*9273SAli.Bahrami@Sun.COM conv_iter_ret_t
168*9273SAli.Bahrami@Sun.COM conv_iter_dyn_flag(Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func,
169*9273SAli.Bahrami@Sun.COM     void *uvalue)
170*9273SAli.Bahrami@Sun.COM {
171*9273SAli.Bahrami@Sun.COM 	return (conv_iter_vd(conv_dyn_flag_strings(fmt_flags), func, uvalue));
172*9273SAli.Bahrami@Sun.COM }
173*9273SAli.Bahrami@Sun.COM 
174*9273SAli.Bahrami@Sun.COM const Val_desc *
175*9273SAli.Bahrami@Sun.COM conv_dyn_flag1_strings(Conv_fmt_flags_t fmt_flags)
176*9273SAli.Bahrami@Sun.COM {
1772352Sab196087 #define	FLAG1SZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
178*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_NOW_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
179*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_GLOBAL_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
180*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_GROUP_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
181*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_NODELETE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
182*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_LOADFLTR_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
183*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_INITFIRST_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
184*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_NOOPEN_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
185*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_ORIGIN_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
186*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_DIRECT_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
187*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_TRANS_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
188*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_INTERPOSE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
189*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_NODEFLIB_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
190*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_NODUMP_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
191*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_CONFALT_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
192*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_ENDFILTEE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
193*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_DISPRELPND_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
194*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_DISPRELDNE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
195*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_NODIRECT_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
196*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_IGNMULDEF_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
197*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_NOKSYMS_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
198*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_NOHDR_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
199*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_NORELOC_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
200*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_SYMINTPOSE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
201*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_GLOBAUDIT_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
202*9273SAli.Bahrami@Sun.COM 	MSG_DF_1_SINGLETON_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
203*9273SAli.Bahrami@Sun.COM 	CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
2044734Sab196087 
205*9273SAli.Bahrami@Sun.COM 	/*
206*9273SAli.Bahrami@Sun.COM 	 * Ensure that Conv_dyn_flag1_buf_t is large enough:
207*9273SAli.Bahrami@Sun.COM 	 *
208*9273SAli.Bahrami@Sun.COM 	 * FLAG1SZ is the real minimum size of the buffer required by
209*9273SAli.Bahrami@Sun.COM 	 * conv_dyn_flag1(). However, Conv_dyn_flag1_buf_t uses
210*9273SAli.Bahrami@Sun.COM 	 * CONV_DYN_FLAG1_BUFSIZE to set the buffer size. We do things this
211*9273SAli.Bahrami@Sun.COM 	 * way because the definition of FLAG1SZ uses information that is not
212*9273SAli.Bahrami@Sun.COM 	 * available in the environment of other programs that include the
213*9273SAli.Bahrami@Sun.COM 	 * conv.h header file.
214*9273SAli.Bahrami@Sun.COM 	 */
2155152Sab196087 #if (CONV_DYN_FLAG1_BUFSIZE != FLAG1SZ) && !defined(__lint)
2165152Sab196087 #define	REPORT_BUFSIZE FLAG1SZ
2175152Sab196087 #include "report_bufsize.h"
2185152Sab196087 #error "CONV_DYN_FLAG1_BUFSIZE does not match FLAG1SZ"
2194734Sab196087 #endif
2200Sstevel@tonic-gate 
221*9273SAli.Bahrami@Sun.COM 	static const Val_desc vda_def[] = {
222*9273SAli.Bahrami@Sun.COM 		{ DF_1_NOW,		MSG_DF_1_NOW_CFNP },
223*9273SAli.Bahrami@Sun.COM 		{ DF_1_GLOBAL,		MSG_DF_1_GLOBAL_CFNP },
224*9273SAli.Bahrami@Sun.COM 		{ DF_1_GROUP,		MSG_DF_1_GROUP_CFNP },
225*9273SAli.Bahrami@Sun.COM 		{ DF_1_NODELETE,	MSG_DF_1_NODELETE_CFNP },
226*9273SAli.Bahrami@Sun.COM 		{ DF_1_LOADFLTR,	MSG_DF_1_LOADFLTR_CFNP },
227*9273SAli.Bahrami@Sun.COM 		{ DF_1_INITFIRST,	MSG_DF_1_INITFIRST_CFNP },
228*9273SAli.Bahrami@Sun.COM 		{ DF_1_NOOPEN,		MSG_DF_1_NOOPEN_CFNP },
229*9273SAli.Bahrami@Sun.COM 		{ DF_1_ORIGIN,		MSG_DF_1_ORIGIN_CFNP },
230*9273SAli.Bahrami@Sun.COM 		{ DF_1_DIRECT,		MSG_DF_1_DIRECT_CFNP },
231*9273SAli.Bahrami@Sun.COM 		{ DF_1_TRANS,		MSG_DF_1_TRANS_CFNP },
232*9273SAli.Bahrami@Sun.COM 		{ DF_1_INTERPOSE,	MSG_DF_1_INTERPOSE_DEF },
233*9273SAli.Bahrami@Sun.COM 		{ DF_1_NODEFLIB,	MSG_DF_1_NODEFLIB_CFNP },
234*9273SAli.Bahrami@Sun.COM 		{ DF_1_NODUMP,		MSG_DF_1_NODUMP_CFNP },
235*9273SAli.Bahrami@Sun.COM 		{ DF_1_CONFALT,		MSG_DF_1_CONFALT_CFNP },
236*9273SAli.Bahrami@Sun.COM 		{ DF_1_ENDFILTEE,	MSG_DF_1_ENDFILTEE_CFNP },
237*9273SAli.Bahrami@Sun.COM 		{ DF_1_DISPRELDNE,	MSG_DF_1_DISPRELDNE_DEF },
238*9273SAli.Bahrami@Sun.COM 		{ DF_1_DISPRELPND,	MSG_DF_1_DISPRELPND_DEF },
239*9273SAli.Bahrami@Sun.COM 		{ DF_1_NODIRECT,	MSG_DF_1_NODIRECT_CFNP },
240*9273SAli.Bahrami@Sun.COM 		{ DF_1_IGNMULDEF,	MSG_DF_1_IGNMULDEF_DEF },
241*9273SAli.Bahrami@Sun.COM 		{ DF_1_NOKSYMS,		MSG_DF_1_NOKSYMS_CFNP },
242*9273SAli.Bahrami@Sun.COM 		{ DF_1_NOHDR,		MSG_DF_1_NOHDR_CFNP },
243*9273SAli.Bahrami@Sun.COM 		{ DF_1_EDITED,		MSG_DF_1_EDITED_CFNP },
244*9273SAli.Bahrami@Sun.COM 		{ DF_1_NORELOC,		MSG_DF_1_NORELOC_CFNP },
245*9273SAli.Bahrami@Sun.COM 		{ DF_1_SYMINTPOSE,	MSG_DF_1_SYMINTPOSE_DEF },
246*9273SAli.Bahrami@Sun.COM 		{ DF_1_GLOBAUDIT,	MSG_DF_1_GLOBAUDIT_DEF },
247*9273SAli.Bahrami@Sun.COM 		{ DF_1_SINGLETON,	MSG_DF_1_SINGLETON_DEF },
248*9273SAli.Bahrami@Sun.COM 		{ 0,			0 }
249*9273SAli.Bahrami@Sun.COM 	};
250*9273SAli.Bahrami@Sun.COM 	static const Val_desc vda_cf[] = {
251*9273SAli.Bahrami@Sun.COM 		{ DF_1_NOW,		MSG_DF_1_NOW_CF },
252*9273SAli.Bahrami@Sun.COM 		{ DF_1_GLOBAL,		MSG_DF_1_GLOBAL_CF },
253*9273SAli.Bahrami@Sun.COM 		{ DF_1_GROUP,		MSG_DF_1_GROUP_CF },
254*9273SAli.Bahrami@Sun.COM 		{ DF_1_NODELETE,	MSG_DF_1_NODELETE_CF },
255*9273SAli.Bahrami@Sun.COM 		{ DF_1_LOADFLTR,	MSG_DF_1_LOADFLTR_CF },
256*9273SAli.Bahrami@Sun.COM 		{ DF_1_INITFIRST,	MSG_DF_1_INITFIRST_CF },
257*9273SAli.Bahrami@Sun.COM 		{ DF_1_NOOPEN,		MSG_DF_1_NOOPEN_CF },
258*9273SAli.Bahrami@Sun.COM 		{ DF_1_ORIGIN,		MSG_DF_1_ORIGIN_CF },
259*9273SAli.Bahrami@Sun.COM 		{ DF_1_DIRECT,		MSG_DF_1_DIRECT_CF },
260*9273SAli.Bahrami@Sun.COM 		{ DF_1_TRANS,		MSG_DF_1_TRANS_CF },
261*9273SAli.Bahrami@Sun.COM 		{ DF_1_INTERPOSE,	MSG_DF_1_INTERPOSE_CF },
262*9273SAli.Bahrami@Sun.COM 		{ DF_1_NODEFLIB,	MSG_DF_1_NODEFLIB_CF },
263*9273SAli.Bahrami@Sun.COM 		{ DF_1_NODUMP,		MSG_DF_1_NODUMP_CF },
264*9273SAli.Bahrami@Sun.COM 		{ DF_1_CONFALT,		MSG_DF_1_CONFALT_CF },
265*9273SAli.Bahrami@Sun.COM 		{ DF_1_ENDFILTEE,	MSG_DF_1_ENDFILTEE_CF },
266*9273SAli.Bahrami@Sun.COM 		{ DF_1_DISPRELDNE,	MSG_DF_1_DISPRELDNE_CF },
267*9273SAli.Bahrami@Sun.COM 		{ DF_1_DISPRELPND,	MSG_DF_1_DISPRELPND_CF },
268*9273SAli.Bahrami@Sun.COM 		{ DF_1_NODIRECT,	MSG_DF_1_NODIRECT_CF },
269*9273SAli.Bahrami@Sun.COM 		{ DF_1_IGNMULDEF,	MSG_DF_1_IGNMULDEF_CF },
270*9273SAli.Bahrami@Sun.COM 		{ DF_1_NOKSYMS,		MSG_DF_1_NOKSYMS_CF },
271*9273SAli.Bahrami@Sun.COM 		{ DF_1_NOHDR,		MSG_DF_1_NOHDR_CF },
272*9273SAli.Bahrami@Sun.COM 		{ DF_1_EDITED,		MSG_DF_1_EDITED_CF },
273*9273SAli.Bahrami@Sun.COM 		{ DF_1_NORELOC,		MSG_DF_1_NORELOC_CF },
274*9273SAli.Bahrami@Sun.COM 		{ DF_1_SYMINTPOSE,	MSG_DF_1_SYMINTPOSE_CF },
275*9273SAli.Bahrami@Sun.COM 		{ DF_1_GLOBAUDIT,	MSG_DF_1_GLOBAUDIT_CF },
276*9273SAli.Bahrami@Sun.COM 		{ DF_1_SINGLETON,	MSG_DF_1_SINGLETON_CF },
2771618Srie 		{ 0,			0 }
2781618Srie 	};
279*9273SAli.Bahrami@Sun.COM 	static const Val_desc vda_cfnp[] = {
280*9273SAli.Bahrami@Sun.COM 		{ DF_1_NOW,		MSG_DF_1_NOW_CFNP },
281*9273SAli.Bahrami@Sun.COM 		{ DF_1_GLOBAL,		MSG_DF_1_GLOBAL_CFNP },
282*9273SAli.Bahrami@Sun.COM 		{ DF_1_GROUP,		MSG_DF_1_GROUP_CFNP },
283*9273SAli.Bahrami@Sun.COM 		{ DF_1_NODELETE,	MSG_DF_1_NODELETE_CFNP },
284*9273SAli.Bahrami@Sun.COM 		{ DF_1_LOADFLTR,	MSG_DF_1_LOADFLTR_CFNP },
285*9273SAli.Bahrami@Sun.COM 		{ DF_1_INITFIRST,	MSG_DF_1_INITFIRST_CFNP },
286*9273SAli.Bahrami@Sun.COM 		{ DF_1_NOOPEN,		MSG_DF_1_NOOPEN_CFNP },
287*9273SAli.Bahrami@Sun.COM 		{ DF_1_ORIGIN,		MSG_DF_1_ORIGIN_CFNP },
288*9273SAli.Bahrami@Sun.COM 		{ DF_1_DIRECT,		MSG_DF_1_DIRECT_CFNP },
289*9273SAli.Bahrami@Sun.COM 		{ DF_1_TRANS,		MSG_DF_1_TRANS_CFNP },
290*9273SAli.Bahrami@Sun.COM 		{ DF_1_INTERPOSE,	MSG_DF_1_INTERPOSE_CFNP },
291*9273SAli.Bahrami@Sun.COM 		{ DF_1_NODEFLIB,	MSG_DF_1_NODEFLIB_CFNP },
292*9273SAli.Bahrami@Sun.COM 		{ DF_1_NODUMP,		MSG_DF_1_NODUMP_CFNP },
293*9273SAli.Bahrami@Sun.COM 		{ DF_1_CONFALT,		MSG_DF_1_CONFALT_CFNP },
294*9273SAli.Bahrami@Sun.COM 		{ DF_1_ENDFILTEE,	MSG_DF_1_ENDFILTEE_CFNP },
295*9273SAli.Bahrami@Sun.COM 		{ DF_1_DISPRELDNE,	MSG_DF_1_DISPRELDNE_CFNP },
296*9273SAli.Bahrami@Sun.COM 		{ DF_1_DISPRELPND,	MSG_DF_1_DISPRELPND_CFNP },
297*9273SAli.Bahrami@Sun.COM 		{ DF_1_NODIRECT,	MSG_DF_1_NODIRECT_CFNP },
298*9273SAli.Bahrami@Sun.COM 		{ DF_1_IGNMULDEF,	MSG_DF_1_IGNMULDEF_CFNP },
299*9273SAli.Bahrami@Sun.COM 		{ DF_1_NOKSYMS,		MSG_DF_1_NOKSYMS_CFNP },
300*9273SAli.Bahrami@Sun.COM 		{ DF_1_NOHDR,		MSG_DF_1_NOHDR_CFNP },
301*9273SAli.Bahrami@Sun.COM 		{ DF_1_EDITED,		MSG_DF_1_EDITED_CFNP },
302*9273SAli.Bahrami@Sun.COM 		{ DF_1_NORELOC,		MSG_DF_1_NORELOC_CFNP },
303*9273SAli.Bahrami@Sun.COM 		{ DF_1_SYMINTPOSE,	MSG_DF_1_SYMINTPOSE_CFNP },
304*9273SAli.Bahrami@Sun.COM 		{ DF_1_GLOBAUDIT,	MSG_DF_1_GLOBAUDIT_CFNP },
305*9273SAli.Bahrami@Sun.COM 		{ DF_1_SINGLETON,	MSG_DF_1_SINGLETON_CFNP },
306*9273SAli.Bahrami@Sun.COM 		{ 0,			0 }
307*9273SAli.Bahrami@Sun.COM 	};
308*9273SAli.Bahrami@Sun.COM 	static const Val_desc vda_nf[] = {
309*9273SAli.Bahrami@Sun.COM 		{ DF_1_NOW,		MSG_DF_1_NOW_NF },
310*9273SAli.Bahrami@Sun.COM 		{ DF_1_GLOBAL,		MSG_DF_1_GLOBAL_NF },
311*9273SAli.Bahrami@Sun.COM 		{ DF_1_GROUP,		MSG_DF_1_GROUP_NF },
312*9273SAli.Bahrami@Sun.COM 		{ DF_1_NODELETE,	MSG_DF_1_NODELETE_NF },
313*9273SAli.Bahrami@Sun.COM 		{ DF_1_LOADFLTR,	MSG_DF_1_LOADFLTR_NF },
314*9273SAli.Bahrami@Sun.COM 		{ DF_1_INITFIRST,	MSG_DF_1_INITFIRST_NF },
315*9273SAli.Bahrami@Sun.COM 		{ DF_1_NOOPEN,		MSG_DF_1_NOOPEN_NF },
316*9273SAli.Bahrami@Sun.COM 		{ DF_1_ORIGIN,		MSG_DF_1_ORIGIN_NF },
317*9273SAli.Bahrami@Sun.COM 		{ DF_1_DIRECT,		MSG_DF_1_DIRECT_NF },
318*9273SAli.Bahrami@Sun.COM 		{ DF_1_TRANS,		MSG_DF_1_TRANS_NF },
319*9273SAli.Bahrami@Sun.COM 		{ DF_1_INTERPOSE,	MSG_DF_1_INTERPOSE_NF },
320*9273SAli.Bahrami@Sun.COM 		{ DF_1_NODEFLIB,	MSG_DF_1_NODEFLIB_NF },
321*9273SAli.Bahrami@Sun.COM 		{ DF_1_NODUMP,		MSG_DF_1_NODUMP_NF },
322*9273SAli.Bahrami@Sun.COM 		{ DF_1_CONFALT,		MSG_DF_1_CONFALT_NF },
323*9273SAli.Bahrami@Sun.COM 		{ DF_1_ENDFILTEE,	MSG_DF_1_ENDFILTEE_NF },
324*9273SAli.Bahrami@Sun.COM 		{ DF_1_DISPRELDNE,	MSG_DF_1_DISPRELDNE_NF },
325*9273SAli.Bahrami@Sun.COM 		{ DF_1_DISPRELPND,	MSG_DF_1_DISPRELPND_NF },
326*9273SAli.Bahrami@Sun.COM 		{ DF_1_NODIRECT,	MSG_DF_1_NODIRECT_NF },
327*9273SAli.Bahrami@Sun.COM 		{ DF_1_IGNMULDEF,	MSG_DF_1_IGNMULDEF_NF },
328*9273SAli.Bahrami@Sun.COM 		{ DF_1_NOKSYMS,		MSG_DF_1_NOKSYMS_NF },
329*9273SAli.Bahrami@Sun.COM 		{ DF_1_NOHDR,		MSG_DF_1_NOHDR_NF },
330*9273SAli.Bahrami@Sun.COM 		{ DF_1_EDITED,		MSG_DF_1_EDITED_NF },
331*9273SAli.Bahrami@Sun.COM 		{ DF_1_NORELOC,		MSG_DF_1_NORELOC_NF },
332*9273SAli.Bahrami@Sun.COM 		{ DF_1_SYMINTPOSE,	MSG_DF_1_SYMINTPOSE_NF },
333*9273SAli.Bahrami@Sun.COM 		{ DF_1_GLOBAUDIT,	MSG_DF_1_GLOBAUDIT_NF },
334*9273SAli.Bahrami@Sun.COM 		{ DF_1_SINGLETON,	MSG_DF_1_SINGLETON_NF },
335*9273SAli.Bahrami@Sun.COM 		{ 0,			0 }
336*9273SAli.Bahrami@Sun.COM 	};
3370Sstevel@tonic-gate 
338*9273SAli.Bahrami@Sun.COM 	switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
339*9273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_CF:
340*9273SAli.Bahrami@Sun.COM 		return (vda_cf);
341*9273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_CFNP:
342*9273SAli.Bahrami@Sun.COM 		return (vda_cfnp);
343*9273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_NF:
344*9273SAli.Bahrami@Sun.COM 		return (vda_nf);
345*9273SAli.Bahrami@Sun.COM 	}
3460Sstevel@tonic-gate 
347*9273SAli.Bahrami@Sun.COM 	return (vda_def);
3480Sstevel@tonic-gate }
3490Sstevel@tonic-gate 
350*9273SAli.Bahrami@Sun.COM conv_iter_ret_t
351*9273SAli.Bahrami@Sun.COM conv_iter_dyn_flag1(Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func,
352*9273SAli.Bahrami@Sun.COM     void *uvalue)
353*9273SAli.Bahrami@Sun.COM {
354*9273SAli.Bahrami@Sun.COM 	return (conv_iter_vd(conv_dyn_flag1_strings(fmt_flags), func, uvalue));
355*9273SAli.Bahrami@Sun.COM }
3564734Sab196087 
357*9273SAli.Bahrami@Sun.COM const Val_desc *
358*9273SAli.Bahrami@Sun.COM conv_dyn_feature1_strings(Conv_fmt_flags_t fmt_flags)
359*9273SAli.Bahrami@Sun.COM {
360*9273SAli.Bahrami@Sun.COM #define	FEATSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
361*9273SAli.Bahrami@Sun.COM 	MSG_DTF_1_PARINIT_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
362*9273SAli.Bahrami@Sun.COM 	MSG_DTF_1_CONFEXP_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
363*9273SAli.Bahrami@Sun.COM 	CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
364*9273SAli.Bahrami@Sun.COM 
365*9273SAli.Bahrami@Sun.COM 	/*
366*9273SAli.Bahrami@Sun.COM 	 * Ensure that Conv_dyn_feature1_buf_t is large enough:
367*9273SAli.Bahrami@Sun.COM 	 *
368*9273SAli.Bahrami@Sun.COM 	 * FEATSZ is the real min size of the buffer required by
369*9273SAli.Bahrami@Sun.COM 	 * conv_dyn_feature1(). However, Conv_dyn_feature1_buf_t uses
370*9273SAli.Bahrami@Sun.COM 	 * CONV_DYN_FEATURE1_BUFSIZE to set the buffer size. We do things
371*9273SAli.Bahrami@Sun.COM 	 * this way because the definition of FEATSZ uses information that
372*9273SAli.Bahrami@Sun.COM 	 * is not available in the environment of other programs that include
373*9273SAli.Bahrami@Sun.COM 	 * the conv.h header file.
374*9273SAli.Bahrami@Sun.COM 	 */
3755152Sab196087 #if (CONV_DYN_FEATURE1_BUFSIZE != FEATSZ) && !defined(__lint)
3765152Sab196087 #define	REPORT_BUFSIZE FEATSZ
3775152Sab196087 #include "report_bufsize.h"
3785152Sab196087 #error "CONV_DYN_FEATURE1_BUFSIZE does not match FEATSZ"
3794734Sab196087 #endif
3800Sstevel@tonic-gate 
381*9273SAli.Bahrami@Sun.COM 	static const Val_desc vda_cf[] = {
382*9273SAli.Bahrami@Sun.COM 		{ DTF_1_PARINIT,	MSG_DTF_1_PARINIT_CF },
383*9273SAli.Bahrami@Sun.COM 		{ DTF_1_CONFEXP,	MSG_DTF_1_CONFEXP_CF },
384*9273SAli.Bahrami@Sun.COM 		{ 0,			0 }
385*9273SAli.Bahrami@Sun.COM 	};
386*9273SAli.Bahrami@Sun.COM 	static const Val_desc vda_cfnp[] = {
387*9273SAli.Bahrami@Sun.COM 		{ DTF_1_PARINIT,	MSG_DTF_1_PARINIT_CFNP },
388*9273SAli.Bahrami@Sun.COM 		{ DTF_1_CONFEXP,	MSG_DTF_1_CONFEXP_CFNP },
3891618Srie 		{ 0,			0 }
3901618Srie 	};
391*9273SAli.Bahrami@Sun.COM 	static const Val_desc vda_nf[] = {
392*9273SAli.Bahrami@Sun.COM 		{ DTF_1_PARINIT,	MSG_DTF_1_PARINIT_NF },
393*9273SAli.Bahrami@Sun.COM 		{ DTF_1_CONFEXP,	MSG_DTF_1_CONFEXP_NF },
394*9273SAli.Bahrami@Sun.COM 		{ 0,			0 }
395*9273SAli.Bahrami@Sun.COM 	};
3960Sstevel@tonic-gate 
397*9273SAli.Bahrami@Sun.COM 	switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
398*9273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_CF:
399*9273SAli.Bahrami@Sun.COM 		return (vda_cf);
400*9273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_NF:
401*9273SAli.Bahrami@Sun.COM 		return (vda_nf);
4022352Sab196087 	}
4030Sstevel@tonic-gate 
404*9273SAli.Bahrami@Sun.COM 	return (vda_cfnp);
4050Sstevel@tonic-gate }
4060Sstevel@tonic-gate 
407*9273SAli.Bahrami@Sun.COM conv_iter_ret_t
408*9273SAli.Bahrami@Sun.COM conv_iter_dyn_feature1(Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func,
409*9273SAli.Bahrami@Sun.COM     void *uvalue)
410*9273SAli.Bahrami@Sun.COM {
411*9273SAli.Bahrami@Sun.COM 	return (conv_iter_vd(conv_dyn_feature1_strings(fmt_flags),
412*9273SAli.Bahrami@Sun.COM 	    func, uvalue));
413*9273SAli.Bahrami@Sun.COM }
414*9273SAli.Bahrami@Sun.COM 
415*9273SAli.Bahrami@Sun.COM const conv_ds_t **
416*9273SAli.Bahrami@Sun.COM conv_dyn_tag_strings(conv_iter_osabi_t osabi, Half mach,
417*9273SAli.Bahrami@Sun.COM     Conv_fmt_flags_t fmt_flags)
4180Sstevel@tonic-gate {
4193492Sab196087 	/*
420*9273SAli.Bahrami@Sun.COM 	 * Maximum # of items that can be in the returned array. Size this
421*9273SAli.Bahrami@Sun.COM 	 * by counting the maximum depth in the switch statement that fills
422*9273SAli.Bahrami@Sun.COM 	 * retarr at the end of this function.
4233492Sab196087 	 */
424*9273SAli.Bahrami@Sun.COM #define	MAX_RET	12
4253492Sab196087 
4263492Sab196087 	/*
4273492Sab196087 	 * Generic dynamic tags:
428*9273SAli.Bahrami@Sun.COM 	 * -	Note hole between DT_FLAGS and DT_PREINIT_ARRAY (tag 32).
429*9273SAli.Bahrami@Sun.COM 	 *	We use a 0, which is the signal for "not defined".
430*9273SAli.Bahrami@Sun.COM 	 * -	This range has alternative names for dump, requiring an
431*9273SAli.Bahrami@Sun.COM 	 *	additional array.
4323492Sab196087 	 */
433*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_null_cf[] = {
434*9273SAli.Bahrami@Sun.COM 		MSG_DT_NULL_CF,			MSG_DT_NEEDED_CF,
435*9273SAli.Bahrami@Sun.COM 		MSG_DT_PLTRELSZ_CF,		MSG_DT_PLTGOT_CF,
436*9273SAli.Bahrami@Sun.COM 		MSG_DT_HASH_CF,			MSG_DT_STRTAB_CF,
437*9273SAli.Bahrami@Sun.COM 		MSG_DT_SYMTAB_CF,		MSG_DT_RELA_CF,
438*9273SAli.Bahrami@Sun.COM 		MSG_DT_RELASZ_CF,		MSG_DT_RELAENT_CF,
439*9273SAli.Bahrami@Sun.COM 		MSG_DT_STRSZ_CF,		MSG_DT_SYMENT_CF,
440*9273SAli.Bahrami@Sun.COM 		MSG_DT_INIT_CF,			MSG_DT_FINI_CF,
441*9273SAli.Bahrami@Sun.COM 		MSG_DT_SONAME_CF,		MSG_DT_RPATH_CF,
442*9273SAli.Bahrami@Sun.COM 		MSG_DT_SYMBOLIC_CF,		MSG_DT_REL_CF,
443*9273SAli.Bahrami@Sun.COM 		MSG_DT_RELSZ_CF,		MSG_DT_RELENT_CF,
444*9273SAli.Bahrami@Sun.COM 		MSG_DT_PLTREL_CF,		MSG_DT_DEBUG_CF,
445*9273SAli.Bahrami@Sun.COM 		MSG_DT_TEXTREL_CF,		MSG_DT_JMPREL_CF,
446*9273SAli.Bahrami@Sun.COM 		MSG_DT_BIND_NOW_CF,		MSG_DT_INIT_ARRAY_CF,
447*9273SAli.Bahrami@Sun.COM 		MSG_DT_FINI_ARRAY_CF,		MSG_DT_INIT_ARRAYSZ_CF,
448*9273SAli.Bahrami@Sun.COM 		MSG_DT_FINI_ARRAYSZ_CF,		MSG_DT_RUNPATH_CF,
449*9273SAli.Bahrami@Sun.COM 		MSG_DT_FLAGS_CF,		0,
450*9273SAli.Bahrami@Sun.COM 		MSG_DT_PREINIT_ARRAY_CF,	MSG_DT_PREINIT_ARRAYSZ_CF
451*9273SAli.Bahrami@Sun.COM 	};
452*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_null_cfnp[] = {
453*9273SAli.Bahrami@Sun.COM 		MSG_DT_NULL_CFNP,		MSG_DT_NEEDED_CFNP,
454*9273SAli.Bahrami@Sun.COM 		MSG_DT_PLTRELSZ_CFNP,		MSG_DT_PLTGOT_CFNP,
455*9273SAli.Bahrami@Sun.COM 		MSG_DT_HASH_CFNP,		MSG_DT_STRTAB_CFNP,
456*9273SAli.Bahrami@Sun.COM 		MSG_DT_SYMTAB_CFNP,		MSG_DT_RELA_CFNP,
457*9273SAli.Bahrami@Sun.COM 		MSG_DT_RELASZ_CFNP,		MSG_DT_RELAENT_CFNP,
458*9273SAli.Bahrami@Sun.COM 		MSG_DT_STRSZ_CFNP,		MSG_DT_SYMENT_CFNP,
459*9273SAli.Bahrami@Sun.COM 		MSG_DT_INIT_CFNP,		MSG_DT_FINI_CFNP,
460*9273SAli.Bahrami@Sun.COM 		MSG_DT_SONAME_CFNP,		MSG_DT_RPATH_CFNP,
461*9273SAli.Bahrami@Sun.COM 		MSG_DT_SYMBOLIC_CFNP,		MSG_DT_REL_CFNP,
462*9273SAli.Bahrami@Sun.COM 		MSG_DT_RELSZ_CFNP,		MSG_DT_RELENT_CFNP,
463*9273SAli.Bahrami@Sun.COM 		MSG_DT_PLTREL_CFNP,		MSG_DT_DEBUG_CFNP,
464*9273SAli.Bahrami@Sun.COM 		MSG_DT_TEXTREL_CFNP,		MSG_DT_JMPREL_CFNP,
465*9273SAli.Bahrami@Sun.COM 		MSG_DT_BIND_NOW_CFNP,		MSG_DT_INIT_ARRAY_CFNP,
466*9273SAli.Bahrami@Sun.COM 		MSG_DT_FINI_ARRAY_CFNP,		MSG_DT_INIT_ARRAYSZ_CFNP,
467*9273SAli.Bahrami@Sun.COM 		MSG_DT_FINI_ARRAYSZ_CFNP,	MSG_DT_RUNPATH_CFNP,
468*9273SAli.Bahrami@Sun.COM 		MSG_DT_FLAGS_CFNP,		0,
469*9273SAli.Bahrami@Sun.COM 		MSG_DT_PREINIT_ARRAY_CFNP,	MSG_DT_PREINIT_ARRAYSZ_CFNP
4701618Srie 	};
471*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_null_nf[] = {
472*9273SAli.Bahrami@Sun.COM 		MSG_DT_NULL_NF,			MSG_DT_NEEDED_NF,
473*9273SAli.Bahrami@Sun.COM 		MSG_DT_PLTRELSZ_NF,		MSG_DT_PLTGOT_NF,
474*9273SAli.Bahrami@Sun.COM 		MSG_DT_HASH_NF,			MSG_DT_STRTAB_NF,
475*9273SAli.Bahrami@Sun.COM 		MSG_DT_SYMTAB_NF,		MSG_DT_RELA_NF,
476*9273SAli.Bahrami@Sun.COM 		MSG_DT_RELASZ_NF,		MSG_DT_RELAENT_NF,
477*9273SAli.Bahrami@Sun.COM 		MSG_DT_STRSZ_NF,		MSG_DT_SYMENT_NF,
478*9273SAli.Bahrami@Sun.COM 		MSG_DT_INIT_NF,			MSG_DT_FINI_NF,
479*9273SAli.Bahrami@Sun.COM 		MSG_DT_SONAME_NF,		MSG_DT_RPATH_NF,
480*9273SAli.Bahrami@Sun.COM 		MSG_DT_SYMBOLIC_NF,		MSG_DT_REL_NF,
481*9273SAli.Bahrami@Sun.COM 		MSG_DT_RELSZ_NF,		MSG_DT_RELENT_NF,
482*9273SAli.Bahrami@Sun.COM 		MSG_DT_PLTREL_NF,		MSG_DT_DEBUG_NF,
483*9273SAli.Bahrami@Sun.COM 		MSG_DT_TEXTREL_NF,		MSG_DT_JMPREL_NF,
484*9273SAli.Bahrami@Sun.COM 		MSG_DT_BIND_NOW_NF,		MSG_DT_INIT_ARRAY_NF,
485*9273SAli.Bahrami@Sun.COM 		MSG_DT_FINI_ARRAY_NF,		MSG_DT_INIT_ARRAYSZ_NF,
486*9273SAli.Bahrami@Sun.COM 		MSG_DT_FINI_ARRAYSZ_NF,		MSG_DT_RUNPATH_NF,
487*9273SAli.Bahrami@Sun.COM 		MSG_DT_FLAGS_NF,		0,
488*9273SAli.Bahrami@Sun.COM 		MSG_DT_PREINIT_ARRAY_NF,	MSG_DT_PREINIT_ARRAYSZ_NF
4893492Sab196087 	};
490*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_null_dmp[] = {
491*9273SAli.Bahrami@Sun.COM 		MSG_DT_NULL_CFNP,		MSG_DT_NEEDED_CFNP,
492*9273SAli.Bahrami@Sun.COM 		MSG_DT_PLTRELSZ_DMP,		MSG_DT_PLTGOT_CFNP,
493*9273SAli.Bahrami@Sun.COM 		MSG_DT_HASH_CFNP,		MSG_DT_STRTAB_CFNP,
494*9273SAli.Bahrami@Sun.COM 		MSG_DT_SYMTAB_CFNP,		MSG_DT_RELA_CFNP,
495*9273SAli.Bahrami@Sun.COM 		MSG_DT_RELASZ_CFNP,		MSG_DT_RELAENT_CFNP,
496*9273SAli.Bahrami@Sun.COM 		MSG_DT_STRSZ_CFNP,		MSG_DT_SYMENT_CFNP,
497*9273SAli.Bahrami@Sun.COM 		MSG_DT_INIT_CFNP,		MSG_DT_FINI_CFNP,
498*9273SAli.Bahrami@Sun.COM 		MSG_DT_SONAME_CFNP,		MSG_DT_RPATH_CFNP,
499*9273SAli.Bahrami@Sun.COM 		MSG_DT_SYMBOLIC_DMP,		MSG_DT_REL_CFNP,
500*9273SAli.Bahrami@Sun.COM 		MSG_DT_RELSZ_CFNP,		MSG_DT_RELENT_CFNP,
501*9273SAli.Bahrami@Sun.COM 		MSG_DT_PLTREL_CFNP,		MSG_DT_DEBUG_CFNP,
502*9273SAli.Bahrami@Sun.COM 		MSG_DT_TEXTREL_CFNP,		MSG_DT_JMPREL_CFNP,
503*9273SAli.Bahrami@Sun.COM 		MSG_DT_BIND_NOW_CFNP,		MSG_DT_INIT_ARRAY_CFNP,
504*9273SAli.Bahrami@Sun.COM 		MSG_DT_FINI_ARRAY_CFNP,		MSG_DT_INIT_ARRAYSZ_CFNP,
505*9273SAli.Bahrami@Sun.COM 		MSG_DT_FINI_ARRAYSZ_CFNP,	MSG_DT_RUNPATH_CFNP,
506*9273SAli.Bahrami@Sun.COM 		MSG_DT_FLAGS_CFNP,		0,
507*9273SAli.Bahrami@Sun.COM 		MSG_DT_PREINIT_ARRAY_CFNP,	MSG_DT_PREINIT_ARRAYSZ_CFNP
5081976Sab196087 	};
509*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_null_cf = {
510*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_NULL, tags_null_cf) };
511*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_null_cfnp = {
512*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_NULL, tags_null_cfnp) };
513*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_null_nf = {
514*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_NULL, tags_null_nf) };
515*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_null_dmp = {
516*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_NULL, tags_null_dmp) };
5170Sstevel@tonic-gate 
5183492Sab196087 	/*
519*9273SAli.Bahrami@Sun.COM 	 * DT_SPARC_REGISTER was originally assigned 0x7000001. It is processor
520*9273SAli.Bahrami@Sun.COM 	 * specific, and should have been in the range DT_LOPROC-DT_HIPROC
521*9273SAli.Bahrami@Sun.COM 	 * instead of here. When the error was fixed,
522*9273SAli.Bahrami@Sun.COM 	 * DT_DEPRECATED_SPARC_REGISTER was created to maintain backward
523*9273SAli.Bahrami@Sun.COM 	 * compatability.
524*9273SAli.Bahrami@Sun.COM 	 */
525*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_sdreg_cf[] = {
526*9273SAli.Bahrami@Sun.COM 	    MSG_DT_DEP_SPARC_REG_CF };
527*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_sdreg_cfnp[] = {
528*9273SAli.Bahrami@Sun.COM 	    MSG_DT_DEP_SPARC_REG_CFNP };
529*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_sdreg_nf[] = {
530*9273SAli.Bahrami@Sun.COM 	    MSG_DT_DEP_SPARC_REG_NF };
531*9273SAli.Bahrami@Sun.COM 
532*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sdreg_cf = {
533*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_DEPRECATED_SPARC_REGISTER, tags_sdreg_cf) };
534*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sdreg_cfnp = {
535*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_DEPRECATED_SPARC_REGISTER, tags_sdreg_cfnp) };
536*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sdreg_nf = {
537*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_DEPRECATED_SPARC_REGISTER, tags_sdreg_nf) };
538*9273SAli.Bahrami@Sun.COM 
539*9273SAli.Bahrami@Sun.COM 
540*9273SAli.Bahrami@Sun.COM 	/*
541*9273SAli.Bahrami@Sun.COM 	 * SUNW: DT_LOOS -> DT_HIOS range. Note holes between DT_SUNW_TLSSORTSZ,
5426206Sab196087 	 * DT_SUNW_STRPAD, and DT_SUNW_LDMACH. We handle the outliers
5436206Sab196087 	 * separately below as single values.
5443492Sab196087 	 */
545*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_sunw_auxiliary_cf[] = {
546*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_AUXILIARY_CF,	MSG_DT_SUNW_RTLDINF_CF,
547*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_FILTER_CF,		MSG_DT_SUNW_CAP_CF,
548*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_SYMTAB_CF,		MSG_DT_SUNW_SYMSZ_CF,
549*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_SORTENT_CF,		MSG_DT_SUNW_SYMSORT_CF,
550*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_SYMSORTSZ_CF,	MSG_DT_SUNW_TLSSORT_CF,
551*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_TLSSORTSZ_CF,	0,
552*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_STRPAD_CF,		0,
553*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_LDMACH_CF
554*9273SAli.Bahrami@Sun.COM 	};
555*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_sunw_auxiliary_cfnp[] = {
556*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_AUXILIARY_CFNP,	MSG_DT_SUNW_RTLDINF_CFNP,
557*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_FILTER_CFNP,	MSG_DT_SUNW_CAP_CFNP,
558*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_SYMTAB_CFNP,	MSG_DT_SUNW_SYMSZ_CFNP,
559*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_SORTENT_CFNP,	MSG_DT_SUNW_SYMSORT_CFNP,
560*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_SYMSORTSZ_CFNP,	MSG_DT_SUNW_TLSSORT_CFNP,
561*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_TLSSORTSZ_CFNP,	0,
562*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_STRPAD_CFNP,	0,
563*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_LDMACH_CFNP
5643492Sab196087 	};
565*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_sunw_auxiliary_nf[] = {
566*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_AUXILIARY_NF,	MSG_DT_SUNW_RTLDINF_NF,
567*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_FILTER_NF,		MSG_DT_SUNW_CAP_NF,
568*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_SYMTAB_NF,		MSG_DT_SUNW_SYMSZ_NF,
569*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_SORTENT_NF,		MSG_DT_SUNW_SYMSORT_NF,
570*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_SYMSORTSZ_NF,	MSG_DT_SUNW_TLSSORT_NF,
571*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_TLSSORTSZ_NF,	0,
572*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_STRPAD_NF,		0,
573*9273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_LDMACH_NF
574*9273SAli.Bahrami@Sun.COM 	};
575*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sunw_auxiliary_cf = {
576*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_SUNW_AUXILIARY, tags_sunw_auxiliary_cf) };
577*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sunw_auxiliary_cfnp = {
578*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_SUNW_AUXILIARY, tags_sunw_auxiliary_cfnp) };
579*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sunw_auxiliary_nf = {
580*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_SUNW_AUXILIARY, tags_sunw_auxiliary_nf) };
581*9273SAli.Bahrami@Sun.COM 
582*9273SAli.Bahrami@Sun.COM 	/*
583*9273SAli.Bahrami@Sun.COM 	 * GNU: (In DT_VALRNGLO section) DT_GNU_PRELINKED - DT_GNU_LIBLISTSZ
584*9273SAli.Bahrami@Sun.COM 	 */
585*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_gnu_prelinked_cf[] = {
586*9273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_PRELINKED_CF,	MSG_DT_GNU_CONFLICTSZ_CF,
587*9273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_LIBLISTSZ_CF
588*9273SAli.Bahrami@Sun.COM 	};
589*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_gnu_prelinked_cfnp[] = {
590*9273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_PRELINKED_CFNP,	MSG_DT_GNU_CONFLICTSZ_CFNP,
591*9273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_LIBLISTSZ_CFNP
592*9273SAli.Bahrami@Sun.COM 	};
593*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_gnu_prelinked_nf[] = {
594*9273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_PRELINKED_NF,	MSG_DT_GNU_CONFLICTSZ_NF,
595*9273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_LIBLISTSZ_NF
596*9273SAli.Bahrami@Sun.COM 	};
597*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_gnu_prelinked_cf = {
598*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_GNU_PRELINKED, tags_gnu_prelinked_cf) };
599*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_gnu_prelinked_cfnp = {
600*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_GNU_PRELINKED, tags_gnu_prelinked_cfnp) };
601*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_gnu_prelinked_nf = {
602*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_GNU_PRELINKED, tags_gnu_prelinked_nf) };
6030Sstevel@tonic-gate 
6043492Sab196087 	/*
6053492Sab196087 	 * SUNW: DT_VALRNGLO - DT_VALRNGHI range.
6063492Sab196087 	 */
607*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_checksum_cf[] = {
608*9273SAli.Bahrami@Sun.COM 		MSG_DT_CHECKSUM_CF,		MSG_DT_PLTPADSZ_CF,
609*9273SAli.Bahrami@Sun.COM 		MSG_DT_MOVEENT_CF,		MSG_DT_MOVESZ_CF,
610*9273SAli.Bahrami@Sun.COM 		MSG_DT_FEATURE_1_CF,		MSG_DT_POSFLAG_1_CF,
611*9273SAli.Bahrami@Sun.COM 		MSG_DT_SYMINSZ_CF,		MSG_DT_SYMINENT_CF
612*9273SAli.Bahrami@Sun.COM 	};
613*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_checksum_cfnp[] = {
614*9273SAli.Bahrami@Sun.COM 		MSG_DT_CHECKSUM_CFNP,		MSG_DT_PLTPADSZ_CFNP,
615*9273SAli.Bahrami@Sun.COM 		MSG_DT_MOVEENT_CFNP,		MSG_DT_MOVESZ_CFNP,
616*9273SAli.Bahrami@Sun.COM 		MSG_DT_FEATURE_1_CFNP,		MSG_DT_POSFLAG_1_CFNP,
617*9273SAli.Bahrami@Sun.COM 		MSG_DT_SYMINSZ_CFNP,		MSG_DT_SYMINENT_CFNP
618*9273SAli.Bahrami@Sun.COM 	};
619*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_checksum_nf[] = {
620*9273SAli.Bahrami@Sun.COM 		MSG_DT_CHECKSUM_NF,		MSG_DT_PLTPADSZ_NF,
621*9273SAli.Bahrami@Sun.COM 		MSG_DT_MOVEENT_NF,		MSG_DT_MOVESZ_NF,
622*9273SAli.Bahrami@Sun.COM 		MSG_DT_FEATURE_1_NF,		MSG_DT_POSFLAG_1_NF,
623*9273SAli.Bahrami@Sun.COM 		MSG_DT_SYMINSZ_NF,		MSG_DT_SYMINENT_NF
6243492Sab196087 	};
625*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_checksum_cf = {
626*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_CHECKSUM, tags_checksum_cf) };
627*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_checksum_cfnp = {
628*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_CHECKSUM, tags_checksum_cfnp) };
629*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_checksum_nf = {
630*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_CHECKSUM, tags_checksum_nf) };
631*9273SAli.Bahrami@Sun.COM 
632*9273SAli.Bahrami@Sun.COM 	/*
633*9273SAli.Bahrami@Sun.COM 	 * GNU: (In DT_ADDRRNGLO section) DT_GNU_HASH - DT_GNU_LIBLIST
634*9273SAli.Bahrami@Sun.COM 	 */
635*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_gnu_hash_cf[] = {
636*9273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_HASH_CF,		MSG_DT_TLSDESC_PLT_CF,
637*9273SAli.Bahrami@Sun.COM 		MSG_DT_TLSDESC_GOT_CF,		MSG_DT_GNU_CONFLICT_CF,
638*9273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_LIBLIST_CF
639*9273SAli.Bahrami@Sun.COM 	};
640*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_gnu_hash_cfnp[] = {
641*9273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_HASH_CFNP,		MSG_DT_TLSDESC_PLT_CFNP,
642*9273SAli.Bahrami@Sun.COM 		MSG_DT_TLSDESC_GOT_CFNP,	MSG_DT_GNU_CONFLICT_CFNP,
643*9273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_LIBLIST_CFNP
644*9273SAli.Bahrami@Sun.COM 	};
645*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_gnu_hash_nf[] = {
646*9273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_HASH_NF,		MSG_DT_TLSDESC_PLT_NF,
647*9273SAli.Bahrami@Sun.COM 		MSG_DT_TLSDESC_GOT_NF,		MSG_DT_GNU_CONFLICT_NF,
648*9273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_LIBLIST_NF
649*9273SAli.Bahrami@Sun.COM 	};
650*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_gnu_hash_cf = {
651*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_GNU_HASH, tags_gnu_hash_cf) };
652*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_gnu_hash_cfnp = {
653*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_GNU_HASH, tags_gnu_hash_cfnp) };
654*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_gnu_hash_nf = {
655*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_GNU_HASH, tags_gnu_hash_nf) };
6563492Sab196087 
6573492Sab196087 	/*
6583492Sab196087 	 * SUNW: DT_ADDRRNGLO - DT_ADDRRNGHI range.
6593492Sab196087 	 */
660*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_config_cf[] = {
661*9273SAli.Bahrami@Sun.COM 		MSG_DT_CONFIG_CF,		MSG_DT_DEPAUDIT_CF,
662*9273SAli.Bahrami@Sun.COM 		MSG_DT_AUDIT_CF,		MSG_DT_PLTPAD_CF,
663*9273SAli.Bahrami@Sun.COM 		MSG_DT_MOVETAB_CF,		MSG_DT_SYMINFO_CF
664*9273SAli.Bahrami@Sun.COM 	};
665*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_config_cfnp[] = {
666*9273SAli.Bahrami@Sun.COM 		MSG_DT_CONFIG_CFNP,		MSG_DT_DEPAUDIT_CFNP,
667*9273SAli.Bahrami@Sun.COM 		MSG_DT_AUDIT_CFNP,		MSG_DT_PLTPAD_CFNP,
668*9273SAli.Bahrami@Sun.COM 		MSG_DT_MOVETAB_CFNP,		MSG_DT_SYMINFO_CFNP
6693492Sab196087 	};
670*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_config_nf[] = {
671*9273SAli.Bahrami@Sun.COM 		MSG_DT_CONFIG_NF,		MSG_DT_DEPAUDIT_NF,
672*9273SAli.Bahrami@Sun.COM 		MSG_DT_AUDIT_NF,		MSG_DT_PLTPAD_NF,
673*9273SAli.Bahrami@Sun.COM 		MSG_DT_MOVETAB_NF,		MSG_DT_SYMINFO_NF
674*9273SAli.Bahrami@Sun.COM 	};
675*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_config_cf = {
676*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_CONFIG, tags_config_cf) };
677*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_config_cfnp = {
678*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_CONFIG, tags_config_cfnp) };
679*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_config_nf = {
680*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_CONFIG, tags_config_nf) };
6810Sstevel@tonic-gate 
6823492Sab196087 	/*
6833492Sab196087 	 * SUNW: generic range. Note hole between DT_VERSYM and DT_RELACOUNT.
6843492Sab196087 	 */
685*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_versym_cf[] = { MSG_DT_VERSYM_CF };
686*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_versym_cfnp[] = { MSG_DT_VERSYM_CFNP };
687*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_versym_nf[] = { MSG_DT_VERSYM_NF };
688*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_versym_cf = {
689*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_VERSYM, tags_versym_cf) };
690*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_versym_cfnp = {
691*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_VERSYM, tags_versym_cfnp) };
692*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_versym_nf = {
693*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_VERSYM, tags_versym_nf) };
694*9273SAli.Bahrami@Sun.COM 
695*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_relacount_cf[] = {
696*9273SAli.Bahrami@Sun.COM 		MSG_DT_RELACOUNT_CF,		MSG_DT_RELCOUNT_CF,
697*9273SAli.Bahrami@Sun.COM 		MSG_DT_FLAGS_1_CF,		MSG_DT_VERDEF_CF,
698*9273SAli.Bahrami@Sun.COM 		MSG_DT_VERDEFNUM_CF,		MSG_DT_VERNEED_CF,
699*9273SAli.Bahrami@Sun.COM 		MSG_DT_VERNEEDNUM_CF
7003492Sab196087 	};
701*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_relacount_cfnp[] = {
702*9273SAli.Bahrami@Sun.COM 		MSG_DT_RELACOUNT_CFNP,		MSG_DT_RELCOUNT_CFNP,
703*9273SAli.Bahrami@Sun.COM 		MSG_DT_FLAGS_1_CFNP,		MSG_DT_VERDEF_CFNP,
704*9273SAli.Bahrami@Sun.COM 		MSG_DT_VERDEFNUM_CFNP,		MSG_DT_VERNEED_CFNP,
705*9273SAli.Bahrami@Sun.COM 		MSG_DT_VERNEEDNUM_CFNP
706*9273SAli.Bahrami@Sun.COM 	};
707*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_relacount_nf[] = {
708*9273SAli.Bahrami@Sun.COM 		MSG_DT_RELACOUNT_NF,		MSG_DT_RELCOUNT_NF,
709*9273SAli.Bahrami@Sun.COM 		MSG_DT_FLAGS_1_NF,		MSG_DT_VERDEF_NF,
710*9273SAli.Bahrami@Sun.COM 		MSG_DT_VERDEFNUM_NF,		MSG_DT_VERNEED_NF,
711*9273SAli.Bahrami@Sun.COM 		MSG_DT_VERNEEDNUM_NF
712*9273SAli.Bahrami@Sun.COM 	};
713*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_relacount_cf = {
714*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_RELACOUNT, tags_relacount_cf) };
715*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_relacount_cfnp = {
716*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_RELACOUNT, tags_relacount_cfnp) };
717*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_relacount_nf = {
718*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_RELACOUNT, tags_relacount_nf) };
7193492Sab196087 
7203492Sab196087 	/*
721*9273SAli.Bahrami@Sun.COM 	 * DT_LOPROC - DT_HIPROC range: solaris/sparc-only
722*9273SAli.Bahrami@Sun.COM 	 */
723*9273SAli.Bahrami@Sun.COM 	static const Msg tags_sparc_reg_cf[] = { MSG_DT_SPARC_REGISTER_CF };
724*9273SAli.Bahrami@Sun.COM 	static const Msg tags_sparc_reg_cfnp[] = { MSG_DT_SPARC_REGISTER_CFNP };
725*9273SAli.Bahrami@Sun.COM 	static const Msg tags_sparc_reg_nf[] = { MSG_DT_SPARC_REGISTER_NF };
726*9273SAli.Bahrami@Sun.COM 	static const Msg tags_sparc_reg_dmp[] = { MSG_DT_SPARC_REGISTER_DMP };
727*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sparc_reg_cf = {
728*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_cf) };
729*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sparc_reg_cfnp = {
730*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_cfnp) };
731*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sparc_reg_nf = {
732*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_nf) };
733*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sparc_reg_dmp = {
734*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_dmp) };
735*9273SAli.Bahrami@Sun.COM 
736*9273SAli.Bahrami@Sun.COM 	/*
737*9273SAli.Bahrami@Sun.COM 	 * DT_LOPROC - DT_HIPROC range: Solaris osabi, all hardware
7383492Sab196087 	 */
739*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_auxiliary_cf[] = {
740*9273SAli.Bahrami@Sun.COM 		MSG_DT_AUXILIARY_CF,	MSG_DT_USED_CF,
741*9273SAli.Bahrami@Sun.COM 		MSG_DT_FILTER_CF
742*9273SAli.Bahrami@Sun.COM 	};
743*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_auxiliary_cfnp[] = {
744*9273SAli.Bahrami@Sun.COM 		MSG_DT_AUXILIARY_CFNP,	MSG_DT_USED_CFNP,
745*9273SAli.Bahrami@Sun.COM 		MSG_DT_FILTER_CFNP
746*9273SAli.Bahrami@Sun.COM 	};
747*9273SAli.Bahrami@Sun.COM 	static const Msg	tags_auxiliary_nf[] = {
748*9273SAli.Bahrami@Sun.COM 		MSG_DT_AUXILIARY_NF,	MSG_DT_USED_NF,
749*9273SAli.Bahrami@Sun.COM 		MSG_DT_FILTER_NF
7503492Sab196087 	};
751*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_auxiliary_cf = {
752*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_AUXILIARY, tags_auxiliary_cf) };
753*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_auxiliary_cfnp = {
754*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_AUXILIARY, tags_auxiliary_cfnp) };
755*9273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_auxiliary_nf = {
756*9273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_AUXILIARY, tags_auxiliary_nf) };
7573492Sab196087 
7583492Sab196087 
759*9273SAli.Bahrami@Sun.COM 	static const conv_ds_t	*retarr[MAX_RET];
760*9273SAli.Bahrami@Sun.COM 
761*9273SAli.Bahrami@Sun.COM 	int	ndx = 0;
762*9273SAli.Bahrami@Sun.COM 	int	fmt_osabi = CONV_TYPE_FMT_ALT(fmt_flags);
763*9273SAli.Bahrami@Sun.COM 	int	mach_sparc, osabi_solaris, osabi_linux;
764*9273SAli.Bahrami@Sun.COM 
7653492Sab196087 
7660Sstevel@tonic-gate 
767*9273SAli.Bahrami@Sun.COM 	osabi_solaris = (osabi == ELFOSABI_NONE) ||
768*9273SAli.Bahrami@Sun.COM 	    (osabi == ELFOSABI_SOLARIS) || (osabi == CONV_OSABI_ALL);
769*9273SAli.Bahrami@Sun.COM 	osabi_linux = (osabi == ELFOSABI_LINUX) || (osabi == CONV_OSABI_ALL);
770*9273SAli.Bahrami@Sun.COM 	mach_sparc = (mach == EM_SPARC) || (mach == EM_SPARCV9) ||
771*9273SAli.Bahrami@Sun.COM 	    (mach == EM_SPARC32PLUS) || (mach == CONV_MACH_ALL);
7720Sstevel@tonic-gate 
7733492Sab196087 	/*
774*9273SAli.Bahrami@Sun.COM 	 * Fill in retarr with the descriptors for the messages that
775*9273SAli.Bahrami@Sun.COM 	 * apply to the current osabi. Note that we order these items such
776*9273SAli.Bahrami@Sun.COM 	 * that the more common are placed at the beginning, and the less
777*9273SAli.Bahrami@Sun.COM 	 * likely at the end. This should speed the common case.
778*9273SAli.Bahrami@Sun.COM 	 *
779*9273SAli.Bahrami@Sun.COM 	 * Note that the CFNP and DMP styles are very similar, so they
780*9273SAli.Bahrami@Sun.COM 	 * are combined in 'default', and fmt_osabi is consulted when there
781*9273SAli.Bahrami@Sun.COM 	 * are differences.
7823492Sab196087 	 */
783*9273SAli.Bahrami@Sun.COM 	switch (fmt_osabi) {
784*9273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_CF:
785*9273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_null_cf);
786*9273SAli.Bahrami@Sun.COM 		if (osabi_solaris)
787*9273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_sunw_auxiliary_cf);
788*9273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_checksum_cf);
789*9273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_config_cf);
790*9273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_versym_cf);
791*9273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_relacount_cf);
792*9273SAli.Bahrami@Sun.COM 		if (osabi_solaris) {
793*9273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_auxiliary_cf);
794*9273SAli.Bahrami@Sun.COM 			if (mach_sparc) {
795*9273SAli.Bahrami@Sun.COM 				retarr[ndx++] = CONV_DS_ADDR(ds_sparc_reg_cf);
796*9273SAli.Bahrami@Sun.COM 				retarr[ndx++] = CONV_DS_ADDR(ds_sdreg_cf);
797*9273SAli.Bahrami@Sun.COM 			}
798*9273SAli.Bahrami@Sun.COM 		}
799*9273SAli.Bahrami@Sun.COM 		if (osabi_linux) {
800*9273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_prelinked_cf);
801*9273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_hash_cf);
802*9273SAli.Bahrami@Sun.COM 		}
803*9273SAli.Bahrami@Sun.COM 		break;
8043492Sab196087 
805*9273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_NF:
806*9273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_null_nf);
807*9273SAli.Bahrami@Sun.COM 		if (osabi_solaris)
808*9273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_sunw_auxiliary_nf);
809*9273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_checksum_nf);
810*9273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_config_nf);
811*9273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_versym_nf);
812*9273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_relacount_nf);
813*9273SAli.Bahrami@Sun.COM 		if (osabi_solaris) {
814*9273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_auxiliary_nf);
815*9273SAli.Bahrami@Sun.COM 			if (mach_sparc) {
816*9273SAli.Bahrami@Sun.COM 				retarr[ndx++] = CONV_DS_ADDR(ds_sparc_reg_nf);
817*9273SAli.Bahrami@Sun.COM 				retarr[ndx++] = CONV_DS_ADDR(ds_sdreg_nf);
818*9273SAli.Bahrami@Sun.COM 			}
819*9273SAli.Bahrami@Sun.COM 		}
820*9273SAli.Bahrami@Sun.COM 		if (osabi_linux) {
821*9273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_prelinked_nf);
822*9273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_hash_nf);
823*9273SAli.Bahrami@Sun.COM 		}
824*9273SAli.Bahrami@Sun.COM 		break;
825*9273SAli.Bahrami@Sun.COM 	default:
826*9273SAli.Bahrami@Sun.COM 		/*
827*9273SAli.Bahrami@Sun.COM 		 * The default style for the generic range is CFNP,
828*9273SAli.Bahrami@Sun.COM 		 * while dump has a couple of different strings.
829*9273SAli.Bahrami@Sun.COM 		 */
8303492Sab196087 
831*9273SAli.Bahrami@Sun.COM 		retarr[ndx++] = (fmt_osabi == CONV_FMT_ALT_DUMP) ?
832*9273SAli.Bahrami@Sun.COM 		    CONV_DS_ADDR(ds_null_dmp) : CONV_DS_ADDR(ds_null_cfnp);
833*9273SAli.Bahrami@Sun.COM 		if (osabi_solaris)
834*9273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_sunw_auxiliary_cfnp);
835*9273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_checksum_cfnp);
836*9273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_config_cfnp);
837*9273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_versym_cfnp);
838*9273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_relacount_cfnp);
839*9273SAli.Bahrami@Sun.COM 		if (osabi_solaris) {
840*9273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_auxiliary_cfnp);
841*9273SAli.Bahrami@Sun.COM 			if (mach_sparc) {
842*9273SAli.Bahrami@Sun.COM 				/*
843*9273SAli.Bahrami@Sun.COM 				 * The default style for DT_SPARC_REGISTER
844*9273SAli.Bahrami@Sun.COM 				 * is the dump style, which omits the 'SPARC_'.
845*9273SAli.Bahrami@Sun.COM 				 * CFNP keeps the prefix.
846*9273SAli.Bahrami@Sun.COM 				 */
847*9273SAli.Bahrami@Sun.COM 				retarr[ndx++] =
848*9273SAli.Bahrami@Sun.COM 				    (fmt_osabi == CONV_FMT_ALT_CFNP) ?
849*9273SAli.Bahrami@Sun.COM 				    CONV_DS_ADDR(ds_sparc_reg_cfnp) :
850*9273SAli.Bahrami@Sun.COM 				    CONV_DS_ADDR(ds_sparc_reg_dmp);
851*9273SAli.Bahrami@Sun.COM 				retarr[ndx++] = CONV_DS_ADDR(ds_sdreg_cfnp);
852*9273SAli.Bahrami@Sun.COM 			}
853*9273SAli.Bahrami@Sun.COM 		}
854*9273SAli.Bahrami@Sun.COM 		if (osabi_linux) {
855*9273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_prelinked_cfnp);
856*9273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_hash_cfnp);
857*9273SAli.Bahrami@Sun.COM 		}
858*9273SAli.Bahrami@Sun.COM 		break;
859*9273SAli.Bahrami@Sun.COM 	}
8603492Sab196087 
861*9273SAli.Bahrami@Sun.COM 	retarr[ndx++] = NULL;
862*9273SAli.Bahrami@Sun.COM 	assert(ndx <= MAX_RET);
863*9273SAli.Bahrami@Sun.COM 	return (retarr);
8640Sstevel@tonic-gate }
865280Srie 
866*9273SAli.Bahrami@Sun.COM conv_iter_ret_t
867*9273SAli.Bahrami@Sun.COM conv_iter_dyn_tag(conv_iter_osabi_t osabi, Half mach,
868*9273SAli.Bahrami@Sun.COM     Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func, void *uvalue)
869*9273SAli.Bahrami@Sun.COM {
870*9273SAli.Bahrami@Sun.COM 	return (conv_iter_ds(osabi, mach,
871*9273SAli.Bahrami@Sun.COM 	    conv_dyn_tag_strings(osabi, mach, fmt_flags), func, uvalue));
872*9273SAli.Bahrami@Sun.COM }
873*9273SAli.Bahrami@Sun.COM 
874*9273SAli.Bahrami@Sun.COM 
875*9273SAli.Bahrami@Sun.COM #define	BINDTSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE +			\
8762352Sab196087 		MSG_BND_NEEDED_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
8772352Sab196087 		MSG_BND_REFER_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
8782352Sab196087 		MSG_BND_FILTER_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
8794734Sab196087 		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
8804734Sab196087 
8814734Sab196087 /*
8824734Sab196087  * Ensure that Conv_bnd_type_buf_t is large enough:
8834734Sab196087  *
8844734Sab196087  * BINDTSZ is the real minimum size of the buffer required by conv_bnd_type().
8854734Sab196087  * However, Conv_bnd_type_buf_t uses CONV_BND_TYPE_BUFSIZE to set the
8864734Sab196087  * buffer size. We do things this way because the definition of BINDTSZ uses
8874734Sab196087  * information that is not available in the environment of other programs
8884734Sab196087  * that include the conv.h header file.
8894734Sab196087  */
8905152Sab196087 #if (CONV_BND_TYPE_BUFSIZE != BINDTSZ) && !defined(__lint)
8915152Sab196087 #define	REPORT_BUFSIZE BINDTSZ
8925152Sab196087 #include "report_bufsize.h"
8935152Sab196087 #error "CONV_BND_TYPE_BUFSIZE does not match BINDTSZ"
8944734Sab196087 #endif
895280Srie 
896280Srie const char *
8974734Sab196087 conv_bnd_type(uint_t flags, Conv_bnd_type_buf_t *bnd_type_buf)
898280Srie {
899*9273SAli.Bahrami@Sun.COM 	static const Val_desc vda[] = {
900*9273SAli.Bahrami@Sun.COM 		{ BND_NEEDED,		MSG_BND_NEEDED },
901*9273SAli.Bahrami@Sun.COM 		{ BND_REFER,		MSG_BND_REFER },
902*9273SAli.Bahrami@Sun.COM 		{ BND_FILTER,		MSG_BND_FILTER },
9031618Srie 		{ 0,			0 }
9041618Srie 	};
9054734Sab196087 	static CONV_EXPN_FIELD_ARG conv_arg = {
906*9273SAli.Bahrami@Sun.COM 	    NULL, sizeof (bnd_type_buf->buf) };
907280Srie 
9081618Srie 	if (flags == 0)
9091618Srie 		return (MSG_ORIG(MSG_STR_EMPTY));
910280Srie 
9114734Sab196087 	conv_arg.buf = bnd_type_buf->buf;
9122352Sab196087 	conv_arg.oflags = conv_arg.rflags = flags;
913*9273SAli.Bahrami@Sun.COM 	(void) conv_expn_field(&conv_arg, vda, 0);
9141618Srie 
9154734Sab196087 	return ((const char *)bnd_type_buf->buf);
916280Srie }
917280Srie 
9181824Srie /*
9191824Srie  * Note, conv_bnd_obj() is called with either:
9201824Srie  *	LML_FLG_OBJADDED (possibly with LML_FLG_OBJREEVAL added), or
9211824Srie  *	LML_FLG_OBJDELETED, or
9221824Srie  *	LML_FLG_ATEXIT.
9231824Srie  */
9242352Sab196087 #define	BINDOSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
9252352Sab196087 		MSG_BND_ADDED_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
9262352Sab196087 		MSG_BND_REEVAL_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
9274734Sab196087 		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
9284734Sab196087 
9294734Sab196087 /*
9304734Sab196087  * Ensure that Conv_bnd_obj_buf_t is large enough:
9314734Sab196087  *
9324734Sab196087  * BINDOSZ is the real minimum size of the buffer required by conv_bnd_obj().
9334734Sab196087  * However, Conv_bnd_obj_buf_t uses CONV_BND_OBJ_BUFSIZE to set the
9344734Sab196087  * buffer size. We do things this way because the definition of BINDOSZ uses
9354734Sab196087  * information that is not available in the environment of other programs
9364734Sab196087  * that include the conv.h header file.
9374734Sab196087  */
9385152Sab196087 #if (CONV_BND_OBJ_BUFSIZE != BINDOSZ) && !defined(__lint)
9395152Sab196087 #define	REPORT_BUFSIZE BINDOSZ
9405152Sab196087 #include "report_bufsize.h"
9415152Sab196087 #error "CONV_BND_OBJ_BUFSIZE does not match BINDOSZ"
9424734Sab196087 #endif
943280Srie 
944280Srie const char *
9454734Sab196087 conv_bnd_obj(uint_t flags, Conv_bnd_obj_buf_t *bnd_obj_buf)
946280Srie {
947*9273SAli.Bahrami@Sun.COM 	static const Val_desc vda[] = {
948*9273SAli.Bahrami@Sun.COM 		{ LML_FLG_OBJADDED,	MSG_BND_ADDED },
949*9273SAli.Bahrami@Sun.COM 		{ LML_FLG_OBJREEVAL,	MSG_BND_REEVAL },
950*9273SAli.Bahrami@Sun.COM 		{ LML_FLG_OBJDELETED,	MSG_BND_DELETED },
951*9273SAli.Bahrami@Sun.COM 		{ LML_FLG_ATEXIT,	MSG_BND_ATEXIT },
9521618Srie 		{ 0,			0 }
9531618Srie 	};
9544734Sab196087 	static CONV_EXPN_FIELD_ARG conv_arg = {
955*9273SAli.Bahrami@Sun.COM 	    NULL, sizeof (bnd_obj_buf->buf) };
9561618Srie 
9571824Srie 	if ((flags & (LML_FLG_OBJADDED | LML_FLG_OBJREEVAL |
9581824Srie 	    LML_FLG_OBJDELETED | LML_FLG_ATEXIT)) == 0)
9591824Srie 		return (MSG_ORIG(MSG_BND_REVISIT));
960280Srie 
961280Srie 	/*
9621618Srie 	 * Note, we're not worried about unknown flags for this family, only
9632352Sab196087 	 * the selected flags are of interest, so we leave conv_arg.rflags
9642352Sab196087 	 * set to 0.
965280Srie 	 */
9664734Sab196087 	conv_arg.buf = bnd_obj_buf->buf;
9672352Sab196087 	conv_arg.oflags = flags;
968*9273SAli.Bahrami@Sun.COM 	(void) conv_expn_field(&conv_arg, vda, 0);
969280Srie 
9704734Sab196087 	return ((const char *)bnd_obj_buf->buf);
971280Srie }
972