xref: /onnv-gate/usr/src/cmd/sgs/libconv/common/dynamic.c (revision 12449:a87750d92895)
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*12449SRod.Evans@Sun.COM  * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate /*
270Sstevel@tonic-gate  * String conversion routine for .dynamic tag entries.
280Sstevel@tonic-gate  */
290Sstevel@tonic-gate #include	<stdio.h>
300Sstevel@tonic-gate #include	<string.h>
310Sstevel@tonic-gate #include	<sys/elf_SPARC.h>
32280Srie #include	"rtld.h"
330Sstevel@tonic-gate #include	"_conv.h"
340Sstevel@tonic-gate #include	"dynamic_msg.h"
350Sstevel@tonic-gate 
363492Sab196087 
373492Sab196087 
389273SAli.Bahrami@Sun.COM const Val_desc *
conv_dyn_posflag1_strings(Conv_fmt_flags_t fmt_flags)399273SAli.Bahrami@Sun.COM conv_dyn_posflag1_strings(Conv_fmt_flags_t fmt_flags)
409273SAli.Bahrami@Sun.COM {
412352Sab196087 #define	POSSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
429273SAli.Bahrami@Sun.COM 	MSG_DF_P1_LAZYLOAD_CF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
439273SAli.Bahrami@Sun.COM 	MSG_DF_P1_GROUPPERM_CF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
44*12449SRod.Evans@Sun.COM 	MSG_DF_P1_DEFERRED_CF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
459273SAli.Bahrami@Sun.COM 	CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
464734Sab196087 
479273SAli.Bahrami@Sun.COM 	/*
489273SAli.Bahrami@Sun.COM 	 * Ensure that Conv_dyn_posflag1_buf_t is large enough:
499273SAli.Bahrami@Sun.COM 	 *
509273SAli.Bahrami@Sun.COM 	 * POSSZ is the real minimum size of the buffer required by
519273SAli.Bahrami@Sun.COM 	 * conv_dyn_posflag1(). However, Conv_dyn_posflag1_buf_t uses
529273SAli.Bahrami@Sun.COM 	 * CONV_DYN_POSFLAG1_BUFSIZE to set the buffer size. We do things
539273SAli.Bahrami@Sun.COM 	 * this way because the definition of POSSZ uses
549273SAli.Bahrami@Sun.COM 	 * information that is not available in the environment of other
559273SAli.Bahrami@Sun.COM 	 * programs that include the conv.h header file.
569273SAli.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 
639273SAli.Bahrami@Sun.COM 	static const Val_desc vda_def[] = {
649273SAli.Bahrami@Sun.COM 		{ DF_P1_LAZYLOAD,	MSG_DF_P1_LAZYLOAD_DEF },
65*12449SRod.Evans@Sun.COM 		{ DF_P1_GROUPPERM,	MSG_DF_P1_GROUPPERM_DEF },
66*12449SRod.Evans@Sun.COM 		{ DF_P1_DEFERRED,	MSG_DF_P1_DEFERRED_DEF },
671618Srie 		{ 0,			0 }
681618Srie 	};
699273SAli.Bahrami@Sun.COM 	static const Val_desc vda_cf[] = {
709273SAli.Bahrami@Sun.COM 		{ DF_P1_LAZYLOAD,	MSG_DF_P1_LAZYLOAD_CF },
719273SAli.Bahrami@Sun.COM 		{ DF_P1_GROUPPERM,	MSG_DF_P1_GROUPPERM_CF },
72*12449SRod.Evans@Sun.COM 		{ DF_P1_DEFERRED,	MSG_DF_P1_DEFERRED_CF },
739273SAli.Bahrami@Sun.COM 		{ 0,			0 }
749273SAli.Bahrami@Sun.COM 	};
759273SAli.Bahrami@Sun.COM 	static const Val_desc vda_cfnp[] = {
769273SAli.Bahrami@Sun.COM 		{ DF_P1_LAZYLOAD,	MSG_DF_P1_LAZYLOAD_CFNP },
779273SAli.Bahrami@Sun.COM 		{ DF_P1_GROUPPERM,	MSG_DF_P1_GROUPPERM_CFNP },
78*12449SRod.Evans@Sun.COM 		{ DF_P1_DEFERRED,	MSG_DF_P1_DEFERRED_CFNP },
799273SAli.Bahrami@Sun.COM 		{ 0,			0 }
809273SAli.Bahrami@Sun.COM 	};
819273SAli.Bahrami@Sun.COM 	static const Val_desc vda_nf[] = {
829273SAli.Bahrami@Sun.COM 		{ DF_P1_LAZYLOAD,	MSG_DF_P1_LAZYLOAD_NF },
839273SAli.Bahrami@Sun.COM 		{ DF_P1_GROUPPERM,	MSG_DF_P1_GROUPPERM_NF },
84*12449SRod.Evans@Sun.COM 		{ DF_P1_DEFERRED,	MSG_DF_P1_DEFERRED_NF },
852352Sab196087 		{ 0,			0 }
862352Sab196087 	};
871618Srie 
889273SAli.Bahrami@Sun.COM 	switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
899273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_DUMP:
909273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_CFNP:
919273SAli.Bahrami@Sun.COM 		return (vda_cfnp);
929273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_CF:
939273SAli.Bahrami@Sun.COM 		return (vda_cf);
949273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_NF:
959273SAli.Bahrami@Sun.COM 		return (vda_nf);
969273SAli.Bahrami@Sun.COM 	}
970Sstevel@tonic-gate 
989273SAli.Bahrami@Sun.COM 	return (vda_def);
999273SAli.Bahrami@Sun.COM }
1000Sstevel@tonic-gate 
1019273SAli.Bahrami@Sun.COM conv_iter_ret_t
conv_iter_dyn_posflag1(Conv_fmt_flags_t fmt_flags,conv_iter_cb_t func,void * uvalue)1029273SAli.Bahrami@Sun.COM conv_iter_dyn_posflag1(Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func,
1039273SAli.Bahrami@Sun.COM     void *uvalue)
1049273SAli.Bahrami@Sun.COM {
1059273SAli.Bahrami@Sun.COM 	return (conv_iter_vd(conv_dyn_posflag1_strings(fmt_flags),
1069273SAli.Bahrami@Sun.COM 	    func, uvalue));
1070Sstevel@tonic-gate }
1080Sstevel@tonic-gate 
1099273SAli.Bahrami@Sun.COM const Val_desc *
conv_dyn_flag_strings(Conv_fmt_flags_t fmt_flags)1109273SAli.Bahrami@Sun.COM conv_dyn_flag_strings(Conv_fmt_flags_t fmt_flags)
1119273SAli.Bahrami@Sun.COM {
1122352Sab196087 #define	FLAGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
1139273SAli.Bahrami@Sun.COM 	MSG_DF_ORIGIN_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1149273SAli.Bahrami@Sun.COM 	MSG_DF_SYMBOLIC_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1159273SAli.Bahrami@Sun.COM 	MSG_DF_TEXTREL_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1169273SAli.Bahrami@Sun.COM 	MSG_DF_BIND_NOW_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1179273SAli.Bahrami@Sun.COM 	MSG_DF_STATIC_TLS_CF_SIZE 	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1189273SAli.Bahrami@Sun.COM 	CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
1194734Sab196087 
1209273SAli.Bahrami@Sun.COM 	/*
1219273SAli.Bahrami@Sun.COM 	 * Ensure that Conv_dyn_flag_buf_t is large enough:
1229273SAli.Bahrami@Sun.COM 	 *
1239273SAli.Bahrami@Sun.COM 	 * FLAGSZ is the real minimum size of the buffer required by
1249273SAli.Bahrami@Sun.COM 	 * conv_dyn_flag(). However, Conv_dyn_flag_buf_t uses
1259273SAli.Bahrami@Sun.COM 	 * CONV_DYN_FLAG_BUFSIZE to set the buffer size. We do things this
1269273SAli.Bahrami@Sun.COM 	 * way because the definition of FLAGSZ uses information that is not
1279273SAli.Bahrami@Sun.COM 	 * available in the environment of other programs that include the
1289273SAli.Bahrami@Sun.COM 	 * conv.h header file.
1299273SAli.Bahrami@Sun.COM 	 */
1305152Sab196087 #if (CONV_DYN_FLAG_BUFSIZE != FLAGSZ) && !defined(__lint)
1315152Sab196087 #define	REPORT_BUFSIZE FLAGSZ
1325152Sab196087 #include "report_bufsize.h"
1335152Sab196087 #error "CONV_DYN_FLAG_BUFSIZE does not match FLAGSZ"
1344734Sab196087 #endif
1359273SAli.Bahrami@Sun.COM 
1369273SAli.Bahrami@Sun.COM 	static const Val_desc vda_cf[] = {
1379273SAli.Bahrami@Sun.COM 		{ DF_ORIGIN,		MSG_DF_ORIGIN_CF },
1389273SAli.Bahrami@Sun.COM 		{ DF_SYMBOLIC,		MSG_DF_SYMBOLIC_CF },
1399273SAli.Bahrami@Sun.COM 		{ DF_TEXTREL,		MSG_DF_TEXTREL_CF },
1409273SAli.Bahrami@Sun.COM 		{ DF_BIND_NOW,		MSG_DF_BIND_NOW_CF },
1419273SAli.Bahrami@Sun.COM 		{ DF_STATIC_TLS,	MSG_DF_STATIC_TLS_CF },
1429273SAli.Bahrami@Sun.COM 		{ 0 }
1439273SAli.Bahrami@Sun.COM 	};
1449273SAli.Bahrami@Sun.COM 	static const Val_desc vda_cfnp[] = {
1459273SAli.Bahrami@Sun.COM 		{ DF_ORIGIN,		MSG_DF_ORIGIN_CFNP },
1469273SAli.Bahrami@Sun.COM 		{ DF_SYMBOLIC,		MSG_DF_SYMBOLIC_CFNP },
1479273SAli.Bahrami@Sun.COM 		{ DF_TEXTREL,		MSG_DF_TEXTREL_CFNP },
1489273SAli.Bahrami@Sun.COM 		{ DF_BIND_NOW,		MSG_DF_BIND_NOW_CFNP },
1499273SAli.Bahrami@Sun.COM 		{ DF_STATIC_TLS,	MSG_DF_STATIC_TLS_CFNP },
1509273SAli.Bahrami@Sun.COM 		{ 0 }
1511618Srie 	};
1529273SAli.Bahrami@Sun.COM 	static const Val_desc vda_nf[] = {
1539273SAli.Bahrami@Sun.COM 		{ DF_ORIGIN,		MSG_DF_ORIGIN_NF },
1549273SAli.Bahrami@Sun.COM 		{ DF_SYMBOLIC,		MSG_DF_SYMBOLIC_NF },
1559273SAli.Bahrami@Sun.COM 		{ DF_TEXTREL,		MSG_DF_TEXTREL_NF },
1569273SAli.Bahrami@Sun.COM 		{ DF_BIND_NOW,		MSG_DF_BIND_NOW_NF },
1579273SAli.Bahrami@Sun.COM 		{ DF_STATIC_TLS,	MSG_DF_STATIC_TLS_NF },
1589273SAli.Bahrami@Sun.COM 		{ 0 }
1599273SAli.Bahrami@Sun.COM 	};
1600Sstevel@tonic-gate 
1619273SAli.Bahrami@Sun.COM 	switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
1629273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_CF:
1639273SAli.Bahrami@Sun.COM 		return (vda_cf);
1649273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_NF:
1659273SAli.Bahrami@Sun.COM 		return (vda_nf);
1662352Sab196087 	}
1670Sstevel@tonic-gate 
1689273SAli.Bahrami@Sun.COM 	return (vda_cfnp);
1690Sstevel@tonic-gate }
1700Sstevel@tonic-gate 
1719273SAli.Bahrami@Sun.COM conv_iter_ret_t
conv_iter_dyn_flag(Conv_fmt_flags_t fmt_flags,conv_iter_cb_t func,void * uvalue)1729273SAli.Bahrami@Sun.COM conv_iter_dyn_flag(Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func,
1739273SAli.Bahrami@Sun.COM     void *uvalue)
1749273SAli.Bahrami@Sun.COM {
1759273SAli.Bahrami@Sun.COM 	return (conv_iter_vd(conv_dyn_flag_strings(fmt_flags), func, uvalue));
1769273SAli.Bahrami@Sun.COM }
1779273SAli.Bahrami@Sun.COM 
1789273SAli.Bahrami@Sun.COM const Val_desc *
conv_dyn_flag1_strings(Conv_fmt_flags_t fmt_flags)1799273SAli.Bahrami@Sun.COM conv_dyn_flag1_strings(Conv_fmt_flags_t fmt_flags)
1809273SAli.Bahrami@Sun.COM {
1812352Sab196087 #define	FLAG1SZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
1829273SAli.Bahrami@Sun.COM 	MSG_DF_1_NOW_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1839273SAli.Bahrami@Sun.COM 	MSG_DF_1_GLOBAL_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1849273SAli.Bahrami@Sun.COM 	MSG_DF_1_GROUP_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1859273SAli.Bahrami@Sun.COM 	MSG_DF_1_NODELETE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1869273SAli.Bahrami@Sun.COM 	MSG_DF_1_LOADFLTR_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1879273SAli.Bahrami@Sun.COM 	MSG_DF_1_INITFIRST_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1889273SAli.Bahrami@Sun.COM 	MSG_DF_1_NOOPEN_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1899273SAli.Bahrami@Sun.COM 	MSG_DF_1_ORIGIN_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1909273SAli.Bahrami@Sun.COM 	MSG_DF_1_DIRECT_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1919273SAli.Bahrami@Sun.COM 	MSG_DF_1_TRANS_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1929273SAli.Bahrami@Sun.COM 	MSG_DF_1_INTERPOSE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1939273SAli.Bahrami@Sun.COM 	MSG_DF_1_NODEFLIB_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1949273SAli.Bahrami@Sun.COM 	MSG_DF_1_NODUMP_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1959273SAli.Bahrami@Sun.COM 	MSG_DF_1_CONFALT_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1969273SAli.Bahrami@Sun.COM 	MSG_DF_1_ENDFILTEE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1979273SAli.Bahrami@Sun.COM 	MSG_DF_1_DISPRELPND_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1989273SAli.Bahrami@Sun.COM 	MSG_DF_1_DISPRELDNE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1999273SAli.Bahrami@Sun.COM 	MSG_DF_1_NODIRECT_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2009273SAli.Bahrami@Sun.COM 	MSG_DF_1_IGNMULDEF_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2019273SAli.Bahrami@Sun.COM 	MSG_DF_1_NOKSYMS_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2029273SAli.Bahrami@Sun.COM 	MSG_DF_1_NOHDR_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2039273SAli.Bahrami@Sun.COM 	MSG_DF_1_NORELOC_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2049273SAli.Bahrami@Sun.COM 	MSG_DF_1_SYMINTPOSE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2059273SAli.Bahrami@Sun.COM 	MSG_DF_1_GLOBAUDIT_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2069273SAli.Bahrami@Sun.COM 	MSG_DF_1_SINGLETON_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2079273SAli.Bahrami@Sun.COM 	CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
2084734Sab196087 
2099273SAli.Bahrami@Sun.COM 	/*
2109273SAli.Bahrami@Sun.COM 	 * Ensure that Conv_dyn_flag1_buf_t is large enough:
2119273SAli.Bahrami@Sun.COM 	 *
2129273SAli.Bahrami@Sun.COM 	 * FLAG1SZ is the real minimum size of the buffer required by
2139273SAli.Bahrami@Sun.COM 	 * conv_dyn_flag1(). However, Conv_dyn_flag1_buf_t uses
2149273SAli.Bahrami@Sun.COM 	 * CONV_DYN_FLAG1_BUFSIZE to set the buffer size. We do things this
2159273SAli.Bahrami@Sun.COM 	 * way because the definition of FLAG1SZ uses information that is not
2169273SAli.Bahrami@Sun.COM 	 * available in the environment of other programs that include the
2179273SAli.Bahrami@Sun.COM 	 * conv.h header file.
2189273SAli.Bahrami@Sun.COM 	 */
2195152Sab196087 #if (CONV_DYN_FLAG1_BUFSIZE != FLAG1SZ) && !defined(__lint)
2205152Sab196087 #define	REPORT_BUFSIZE FLAG1SZ
2215152Sab196087 #include "report_bufsize.h"
2225152Sab196087 #error "CONV_DYN_FLAG1_BUFSIZE does not match FLAG1SZ"
2234734Sab196087 #endif
2240Sstevel@tonic-gate 
2259273SAli.Bahrami@Sun.COM 	static const Val_desc vda_def[] = {
2269273SAli.Bahrami@Sun.COM 		{ DF_1_NOW,		MSG_DF_1_NOW_CFNP },
2279273SAli.Bahrami@Sun.COM 		{ DF_1_GLOBAL,		MSG_DF_1_GLOBAL_CFNP },
2289273SAli.Bahrami@Sun.COM 		{ DF_1_GROUP,		MSG_DF_1_GROUP_CFNP },
2299273SAli.Bahrami@Sun.COM 		{ DF_1_NODELETE,	MSG_DF_1_NODELETE_CFNP },
2309273SAli.Bahrami@Sun.COM 		{ DF_1_LOADFLTR,	MSG_DF_1_LOADFLTR_CFNP },
2319273SAli.Bahrami@Sun.COM 		{ DF_1_INITFIRST,	MSG_DF_1_INITFIRST_CFNP },
2329273SAli.Bahrami@Sun.COM 		{ DF_1_NOOPEN,		MSG_DF_1_NOOPEN_CFNP },
2339273SAli.Bahrami@Sun.COM 		{ DF_1_ORIGIN,		MSG_DF_1_ORIGIN_CFNP },
2349273SAli.Bahrami@Sun.COM 		{ DF_1_DIRECT,		MSG_DF_1_DIRECT_CFNP },
2359273SAli.Bahrami@Sun.COM 		{ DF_1_TRANS,		MSG_DF_1_TRANS_CFNP },
2369273SAli.Bahrami@Sun.COM 		{ DF_1_INTERPOSE,	MSG_DF_1_INTERPOSE_DEF },
2379273SAli.Bahrami@Sun.COM 		{ DF_1_NODEFLIB,	MSG_DF_1_NODEFLIB_CFNP },
2389273SAli.Bahrami@Sun.COM 		{ DF_1_NODUMP,		MSG_DF_1_NODUMP_CFNP },
2399273SAli.Bahrami@Sun.COM 		{ DF_1_CONFALT,		MSG_DF_1_CONFALT_CFNP },
2409273SAli.Bahrami@Sun.COM 		{ DF_1_ENDFILTEE,	MSG_DF_1_ENDFILTEE_CFNP },
2419273SAli.Bahrami@Sun.COM 		{ DF_1_DISPRELDNE,	MSG_DF_1_DISPRELDNE_DEF },
2429273SAli.Bahrami@Sun.COM 		{ DF_1_DISPRELPND,	MSG_DF_1_DISPRELPND_DEF },
2439273SAli.Bahrami@Sun.COM 		{ DF_1_NODIRECT,	MSG_DF_1_NODIRECT_CFNP },
2449273SAli.Bahrami@Sun.COM 		{ DF_1_IGNMULDEF,	MSG_DF_1_IGNMULDEF_DEF },
2459273SAli.Bahrami@Sun.COM 		{ DF_1_NOKSYMS,		MSG_DF_1_NOKSYMS_CFNP },
2469273SAli.Bahrami@Sun.COM 		{ DF_1_NOHDR,		MSG_DF_1_NOHDR_CFNP },
2479273SAli.Bahrami@Sun.COM 		{ DF_1_EDITED,		MSG_DF_1_EDITED_CFNP },
2489273SAli.Bahrami@Sun.COM 		{ DF_1_NORELOC,		MSG_DF_1_NORELOC_CFNP },
2499273SAli.Bahrami@Sun.COM 		{ DF_1_SYMINTPOSE,	MSG_DF_1_SYMINTPOSE_DEF },
2509273SAli.Bahrami@Sun.COM 		{ DF_1_GLOBAUDIT,	MSG_DF_1_GLOBAUDIT_DEF },
2519273SAli.Bahrami@Sun.COM 		{ DF_1_SINGLETON,	MSG_DF_1_SINGLETON_DEF },
2529273SAli.Bahrami@Sun.COM 		{ 0,			0 }
2539273SAli.Bahrami@Sun.COM 	};
2549273SAli.Bahrami@Sun.COM 	static const Val_desc vda_cf[] = {
2559273SAli.Bahrami@Sun.COM 		{ DF_1_NOW,		MSG_DF_1_NOW_CF },
2569273SAli.Bahrami@Sun.COM 		{ DF_1_GLOBAL,		MSG_DF_1_GLOBAL_CF },
2579273SAli.Bahrami@Sun.COM 		{ DF_1_GROUP,		MSG_DF_1_GROUP_CF },
2589273SAli.Bahrami@Sun.COM 		{ DF_1_NODELETE,	MSG_DF_1_NODELETE_CF },
2599273SAli.Bahrami@Sun.COM 		{ DF_1_LOADFLTR,	MSG_DF_1_LOADFLTR_CF },
2609273SAli.Bahrami@Sun.COM 		{ DF_1_INITFIRST,	MSG_DF_1_INITFIRST_CF },
2619273SAli.Bahrami@Sun.COM 		{ DF_1_NOOPEN,		MSG_DF_1_NOOPEN_CF },
2629273SAli.Bahrami@Sun.COM 		{ DF_1_ORIGIN,		MSG_DF_1_ORIGIN_CF },
2639273SAli.Bahrami@Sun.COM 		{ DF_1_DIRECT,		MSG_DF_1_DIRECT_CF },
2649273SAli.Bahrami@Sun.COM 		{ DF_1_TRANS,		MSG_DF_1_TRANS_CF },
2659273SAli.Bahrami@Sun.COM 		{ DF_1_INTERPOSE,	MSG_DF_1_INTERPOSE_CF },
2669273SAli.Bahrami@Sun.COM 		{ DF_1_NODEFLIB,	MSG_DF_1_NODEFLIB_CF },
2679273SAli.Bahrami@Sun.COM 		{ DF_1_NODUMP,		MSG_DF_1_NODUMP_CF },
2689273SAli.Bahrami@Sun.COM 		{ DF_1_CONFALT,		MSG_DF_1_CONFALT_CF },
2699273SAli.Bahrami@Sun.COM 		{ DF_1_ENDFILTEE,	MSG_DF_1_ENDFILTEE_CF },
2709273SAli.Bahrami@Sun.COM 		{ DF_1_DISPRELDNE,	MSG_DF_1_DISPRELDNE_CF },
2719273SAli.Bahrami@Sun.COM 		{ DF_1_DISPRELPND,	MSG_DF_1_DISPRELPND_CF },
2729273SAli.Bahrami@Sun.COM 		{ DF_1_NODIRECT,	MSG_DF_1_NODIRECT_CF },
2739273SAli.Bahrami@Sun.COM 		{ DF_1_IGNMULDEF,	MSG_DF_1_IGNMULDEF_CF },
2749273SAli.Bahrami@Sun.COM 		{ DF_1_NOKSYMS,		MSG_DF_1_NOKSYMS_CF },
2759273SAli.Bahrami@Sun.COM 		{ DF_1_NOHDR,		MSG_DF_1_NOHDR_CF },
2769273SAli.Bahrami@Sun.COM 		{ DF_1_EDITED,		MSG_DF_1_EDITED_CF },
2779273SAli.Bahrami@Sun.COM 		{ DF_1_NORELOC,		MSG_DF_1_NORELOC_CF },
2789273SAli.Bahrami@Sun.COM 		{ DF_1_SYMINTPOSE,	MSG_DF_1_SYMINTPOSE_CF },
2799273SAli.Bahrami@Sun.COM 		{ DF_1_GLOBAUDIT,	MSG_DF_1_GLOBAUDIT_CF },
2809273SAli.Bahrami@Sun.COM 		{ DF_1_SINGLETON,	MSG_DF_1_SINGLETON_CF },
2811618Srie 		{ 0,			0 }
2821618Srie 	};
2839273SAli.Bahrami@Sun.COM 	static const Val_desc vda_cfnp[] = {
2849273SAli.Bahrami@Sun.COM 		{ DF_1_NOW,		MSG_DF_1_NOW_CFNP },
2859273SAli.Bahrami@Sun.COM 		{ DF_1_GLOBAL,		MSG_DF_1_GLOBAL_CFNP },
2869273SAli.Bahrami@Sun.COM 		{ DF_1_GROUP,		MSG_DF_1_GROUP_CFNP },
2879273SAli.Bahrami@Sun.COM 		{ DF_1_NODELETE,	MSG_DF_1_NODELETE_CFNP },
2889273SAli.Bahrami@Sun.COM 		{ DF_1_LOADFLTR,	MSG_DF_1_LOADFLTR_CFNP },
2899273SAli.Bahrami@Sun.COM 		{ DF_1_INITFIRST,	MSG_DF_1_INITFIRST_CFNP },
2909273SAli.Bahrami@Sun.COM 		{ DF_1_NOOPEN,		MSG_DF_1_NOOPEN_CFNP },
2919273SAli.Bahrami@Sun.COM 		{ DF_1_ORIGIN,		MSG_DF_1_ORIGIN_CFNP },
2929273SAli.Bahrami@Sun.COM 		{ DF_1_DIRECT,		MSG_DF_1_DIRECT_CFNP },
2939273SAli.Bahrami@Sun.COM 		{ DF_1_TRANS,		MSG_DF_1_TRANS_CFNP },
2949273SAli.Bahrami@Sun.COM 		{ DF_1_INTERPOSE,	MSG_DF_1_INTERPOSE_CFNP },
2959273SAli.Bahrami@Sun.COM 		{ DF_1_NODEFLIB,	MSG_DF_1_NODEFLIB_CFNP },
2969273SAli.Bahrami@Sun.COM 		{ DF_1_NODUMP,		MSG_DF_1_NODUMP_CFNP },
2979273SAli.Bahrami@Sun.COM 		{ DF_1_CONFALT,		MSG_DF_1_CONFALT_CFNP },
2989273SAli.Bahrami@Sun.COM 		{ DF_1_ENDFILTEE,	MSG_DF_1_ENDFILTEE_CFNP },
2999273SAli.Bahrami@Sun.COM 		{ DF_1_DISPRELDNE,	MSG_DF_1_DISPRELDNE_CFNP },
3009273SAli.Bahrami@Sun.COM 		{ DF_1_DISPRELPND,	MSG_DF_1_DISPRELPND_CFNP },
3019273SAli.Bahrami@Sun.COM 		{ DF_1_NODIRECT,	MSG_DF_1_NODIRECT_CFNP },
3029273SAli.Bahrami@Sun.COM 		{ DF_1_IGNMULDEF,	MSG_DF_1_IGNMULDEF_CFNP },
3039273SAli.Bahrami@Sun.COM 		{ DF_1_NOKSYMS,		MSG_DF_1_NOKSYMS_CFNP },
3049273SAli.Bahrami@Sun.COM 		{ DF_1_NOHDR,		MSG_DF_1_NOHDR_CFNP },
3059273SAli.Bahrami@Sun.COM 		{ DF_1_EDITED,		MSG_DF_1_EDITED_CFNP },
3069273SAli.Bahrami@Sun.COM 		{ DF_1_NORELOC,		MSG_DF_1_NORELOC_CFNP },
3079273SAli.Bahrami@Sun.COM 		{ DF_1_SYMINTPOSE,	MSG_DF_1_SYMINTPOSE_CFNP },
3089273SAli.Bahrami@Sun.COM 		{ DF_1_GLOBAUDIT,	MSG_DF_1_GLOBAUDIT_CFNP },
3099273SAli.Bahrami@Sun.COM 		{ DF_1_SINGLETON,	MSG_DF_1_SINGLETON_CFNP },
3109273SAli.Bahrami@Sun.COM 		{ 0,			0 }
3119273SAli.Bahrami@Sun.COM 	};
3129273SAli.Bahrami@Sun.COM 	static const Val_desc vda_nf[] = {
3139273SAli.Bahrami@Sun.COM 		{ DF_1_NOW,		MSG_DF_1_NOW_NF },
3149273SAli.Bahrami@Sun.COM 		{ DF_1_GLOBAL,		MSG_DF_1_GLOBAL_NF },
3159273SAli.Bahrami@Sun.COM 		{ DF_1_GROUP,		MSG_DF_1_GROUP_NF },
3169273SAli.Bahrami@Sun.COM 		{ DF_1_NODELETE,	MSG_DF_1_NODELETE_NF },
3179273SAli.Bahrami@Sun.COM 		{ DF_1_LOADFLTR,	MSG_DF_1_LOADFLTR_NF },
3189273SAli.Bahrami@Sun.COM 		{ DF_1_INITFIRST,	MSG_DF_1_INITFIRST_NF },
3199273SAli.Bahrami@Sun.COM 		{ DF_1_NOOPEN,		MSG_DF_1_NOOPEN_NF },
3209273SAli.Bahrami@Sun.COM 		{ DF_1_ORIGIN,		MSG_DF_1_ORIGIN_NF },
3219273SAli.Bahrami@Sun.COM 		{ DF_1_DIRECT,		MSG_DF_1_DIRECT_NF },
3229273SAli.Bahrami@Sun.COM 		{ DF_1_TRANS,		MSG_DF_1_TRANS_NF },
3239273SAli.Bahrami@Sun.COM 		{ DF_1_INTERPOSE,	MSG_DF_1_INTERPOSE_NF },
3249273SAli.Bahrami@Sun.COM 		{ DF_1_NODEFLIB,	MSG_DF_1_NODEFLIB_NF },
3259273SAli.Bahrami@Sun.COM 		{ DF_1_NODUMP,		MSG_DF_1_NODUMP_NF },
3269273SAli.Bahrami@Sun.COM 		{ DF_1_CONFALT,		MSG_DF_1_CONFALT_NF },
3279273SAli.Bahrami@Sun.COM 		{ DF_1_ENDFILTEE,	MSG_DF_1_ENDFILTEE_NF },
3289273SAli.Bahrami@Sun.COM 		{ DF_1_DISPRELDNE,	MSG_DF_1_DISPRELDNE_NF },
3299273SAli.Bahrami@Sun.COM 		{ DF_1_DISPRELPND,	MSG_DF_1_DISPRELPND_NF },
3309273SAli.Bahrami@Sun.COM 		{ DF_1_NODIRECT,	MSG_DF_1_NODIRECT_NF },
3319273SAli.Bahrami@Sun.COM 		{ DF_1_IGNMULDEF,	MSG_DF_1_IGNMULDEF_NF },
3329273SAli.Bahrami@Sun.COM 		{ DF_1_NOKSYMS,		MSG_DF_1_NOKSYMS_NF },
3339273SAli.Bahrami@Sun.COM 		{ DF_1_NOHDR,		MSG_DF_1_NOHDR_NF },
3349273SAli.Bahrami@Sun.COM 		{ DF_1_EDITED,		MSG_DF_1_EDITED_NF },
3359273SAli.Bahrami@Sun.COM 		{ DF_1_NORELOC,		MSG_DF_1_NORELOC_NF },
3369273SAli.Bahrami@Sun.COM 		{ DF_1_SYMINTPOSE,	MSG_DF_1_SYMINTPOSE_NF },
3379273SAli.Bahrami@Sun.COM 		{ DF_1_GLOBAUDIT,	MSG_DF_1_GLOBAUDIT_NF },
3389273SAli.Bahrami@Sun.COM 		{ DF_1_SINGLETON,	MSG_DF_1_SINGLETON_NF },
3399273SAli.Bahrami@Sun.COM 		{ 0,			0 }
3409273SAli.Bahrami@Sun.COM 	};
3410Sstevel@tonic-gate 
3429273SAli.Bahrami@Sun.COM 	switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
3439273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_CF:
3449273SAli.Bahrami@Sun.COM 		return (vda_cf);
3459273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_CFNP:
3469273SAli.Bahrami@Sun.COM 		return (vda_cfnp);
3479273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_NF:
3489273SAli.Bahrami@Sun.COM 		return (vda_nf);
3499273SAli.Bahrami@Sun.COM 	}
3500Sstevel@tonic-gate 
3519273SAli.Bahrami@Sun.COM 	return (vda_def);
3520Sstevel@tonic-gate }
3530Sstevel@tonic-gate 
3549273SAli.Bahrami@Sun.COM conv_iter_ret_t
conv_iter_dyn_flag1(Conv_fmt_flags_t fmt_flags,conv_iter_cb_t func,void * uvalue)3559273SAli.Bahrami@Sun.COM conv_iter_dyn_flag1(Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func,
3569273SAli.Bahrami@Sun.COM     void *uvalue)
3579273SAli.Bahrami@Sun.COM {
3589273SAli.Bahrami@Sun.COM 	return (conv_iter_vd(conv_dyn_flag1_strings(fmt_flags), func, uvalue));
3599273SAli.Bahrami@Sun.COM }
3604734Sab196087 
3619273SAli.Bahrami@Sun.COM const Val_desc *
conv_dyn_feature1_strings(Conv_fmt_flags_t fmt_flags)3629273SAli.Bahrami@Sun.COM conv_dyn_feature1_strings(Conv_fmt_flags_t fmt_flags)
3639273SAli.Bahrami@Sun.COM {
3649273SAli.Bahrami@Sun.COM #define	FEATSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
3659273SAli.Bahrami@Sun.COM 	MSG_DTF_1_PARINIT_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
3669273SAli.Bahrami@Sun.COM 	MSG_DTF_1_CONFEXP_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
3679273SAli.Bahrami@Sun.COM 	CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
3689273SAli.Bahrami@Sun.COM 
3699273SAli.Bahrami@Sun.COM 	/*
3709273SAli.Bahrami@Sun.COM 	 * Ensure that Conv_dyn_feature1_buf_t is large enough:
3719273SAli.Bahrami@Sun.COM 	 *
3729273SAli.Bahrami@Sun.COM 	 * FEATSZ is the real min size of the buffer required by
3739273SAli.Bahrami@Sun.COM 	 * conv_dyn_feature1(). However, Conv_dyn_feature1_buf_t uses
3749273SAli.Bahrami@Sun.COM 	 * CONV_DYN_FEATURE1_BUFSIZE to set the buffer size. We do things
3759273SAli.Bahrami@Sun.COM 	 * this way because the definition of FEATSZ uses information that
3769273SAli.Bahrami@Sun.COM 	 * is not available in the environment of other programs that include
3779273SAli.Bahrami@Sun.COM 	 * the conv.h header file.
3789273SAli.Bahrami@Sun.COM 	 */
3795152Sab196087 #if (CONV_DYN_FEATURE1_BUFSIZE != FEATSZ) && !defined(__lint)
3805152Sab196087 #define	REPORT_BUFSIZE FEATSZ
3815152Sab196087 #include "report_bufsize.h"
3825152Sab196087 #error "CONV_DYN_FEATURE1_BUFSIZE does not match FEATSZ"
3834734Sab196087 #endif
3840Sstevel@tonic-gate 
3859273SAli.Bahrami@Sun.COM 	static const Val_desc vda_cf[] = {
3869273SAli.Bahrami@Sun.COM 		{ DTF_1_PARINIT,	MSG_DTF_1_PARINIT_CF },
3879273SAli.Bahrami@Sun.COM 		{ DTF_1_CONFEXP,	MSG_DTF_1_CONFEXP_CF },
3889273SAli.Bahrami@Sun.COM 		{ 0,			0 }
3899273SAli.Bahrami@Sun.COM 	};
3909273SAli.Bahrami@Sun.COM 	static const Val_desc vda_cfnp[] = {
3919273SAli.Bahrami@Sun.COM 		{ DTF_1_PARINIT,	MSG_DTF_1_PARINIT_CFNP },
3929273SAli.Bahrami@Sun.COM 		{ DTF_1_CONFEXP,	MSG_DTF_1_CONFEXP_CFNP },
3931618Srie 		{ 0,			0 }
3941618Srie 	};
3959273SAli.Bahrami@Sun.COM 	static const Val_desc vda_nf[] = {
3969273SAli.Bahrami@Sun.COM 		{ DTF_1_PARINIT,	MSG_DTF_1_PARINIT_NF },
3979273SAli.Bahrami@Sun.COM 		{ DTF_1_CONFEXP,	MSG_DTF_1_CONFEXP_NF },
3989273SAli.Bahrami@Sun.COM 		{ 0,			0 }
3999273SAli.Bahrami@Sun.COM 	};
4000Sstevel@tonic-gate 
4019273SAli.Bahrami@Sun.COM 	switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
4029273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_CF:
4039273SAli.Bahrami@Sun.COM 		return (vda_cf);
4049273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_NF:
4059273SAli.Bahrami@Sun.COM 		return (vda_nf);
4062352Sab196087 	}
4070Sstevel@tonic-gate 
4089273SAli.Bahrami@Sun.COM 	return (vda_cfnp);
4090Sstevel@tonic-gate }
4100Sstevel@tonic-gate 
4119273SAli.Bahrami@Sun.COM conv_iter_ret_t
conv_iter_dyn_feature1(Conv_fmt_flags_t fmt_flags,conv_iter_cb_t func,void * uvalue)4129273SAli.Bahrami@Sun.COM conv_iter_dyn_feature1(Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func,
4139273SAli.Bahrami@Sun.COM     void *uvalue)
4149273SAli.Bahrami@Sun.COM {
4159273SAli.Bahrami@Sun.COM 	return (conv_iter_vd(conv_dyn_feature1_strings(fmt_flags),
4169273SAli.Bahrami@Sun.COM 	    func, uvalue));
4179273SAli.Bahrami@Sun.COM }
4189273SAli.Bahrami@Sun.COM 
4199273SAli.Bahrami@Sun.COM const conv_ds_t **
conv_dyn_tag_strings(conv_iter_osabi_t osabi,Half mach,Conv_fmt_flags_t fmt_flags)4209273SAli.Bahrami@Sun.COM conv_dyn_tag_strings(conv_iter_osabi_t osabi, Half mach,
4219273SAli.Bahrami@Sun.COM     Conv_fmt_flags_t fmt_flags)
4220Sstevel@tonic-gate {
4233492Sab196087 	/*
4249273SAli.Bahrami@Sun.COM 	 * Maximum # of items that can be in the returned array. Size this
4259273SAli.Bahrami@Sun.COM 	 * by counting the maximum depth in the switch statement that fills
4269273SAli.Bahrami@Sun.COM 	 * retarr at the end of this function.
4273492Sab196087 	 */
4289273SAli.Bahrami@Sun.COM #define	MAX_RET	12
4293492Sab196087 
4303492Sab196087 	/*
4313492Sab196087 	 * Generic dynamic tags:
4329273SAli.Bahrami@Sun.COM 	 * -	Note hole between DT_FLAGS and DT_PREINIT_ARRAY (tag 32).
4339273SAli.Bahrami@Sun.COM 	 *	We use a 0, which is the signal for "not defined".
4349273SAli.Bahrami@Sun.COM 	 * -	This range has alternative names for dump, requiring an
4359273SAli.Bahrami@Sun.COM 	 *	additional array.
4363492Sab196087 	 */
4379273SAli.Bahrami@Sun.COM 	static const Msg	tags_null_cf[] = {
4389273SAli.Bahrami@Sun.COM 		MSG_DT_NULL_CF,			MSG_DT_NEEDED_CF,
4399273SAli.Bahrami@Sun.COM 		MSG_DT_PLTRELSZ_CF,		MSG_DT_PLTGOT_CF,
4409273SAli.Bahrami@Sun.COM 		MSG_DT_HASH_CF,			MSG_DT_STRTAB_CF,
4419273SAli.Bahrami@Sun.COM 		MSG_DT_SYMTAB_CF,		MSG_DT_RELA_CF,
4429273SAli.Bahrami@Sun.COM 		MSG_DT_RELASZ_CF,		MSG_DT_RELAENT_CF,
4439273SAli.Bahrami@Sun.COM 		MSG_DT_STRSZ_CF,		MSG_DT_SYMENT_CF,
4449273SAli.Bahrami@Sun.COM 		MSG_DT_INIT_CF,			MSG_DT_FINI_CF,
4459273SAli.Bahrami@Sun.COM 		MSG_DT_SONAME_CF,		MSG_DT_RPATH_CF,
4469273SAli.Bahrami@Sun.COM 		MSG_DT_SYMBOLIC_CF,		MSG_DT_REL_CF,
4479273SAli.Bahrami@Sun.COM 		MSG_DT_RELSZ_CF,		MSG_DT_RELENT_CF,
4489273SAli.Bahrami@Sun.COM 		MSG_DT_PLTREL_CF,		MSG_DT_DEBUG_CF,
4499273SAli.Bahrami@Sun.COM 		MSG_DT_TEXTREL_CF,		MSG_DT_JMPREL_CF,
4509273SAli.Bahrami@Sun.COM 		MSG_DT_BIND_NOW_CF,		MSG_DT_INIT_ARRAY_CF,
4519273SAli.Bahrami@Sun.COM 		MSG_DT_FINI_ARRAY_CF,		MSG_DT_INIT_ARRAYSZ_CF,
4529273SAli.Bahrami@Sun.COM 		MSG_DT_FINI_ARRAYSZ_CF,		MSG_DT_RUNPATH_CF,
4539273SAli.Bahrami@Sun.COM 		MSG_DT_FLAGS_CF,		0,
4549273SAli.Bahrami@Sun.COM 		MSG_DT_PREINIT_ARRAY_CF,	MSG_DT_PREINIT_ARRAYSZ_CF
4559273SAli.Bahrami@Sun.COM 	};
4569273SAli.Bahrami@Sun.COM 	static const Msg	tags_null_cfnp[] = {
4579273SAli.Bahrami@Sun.COM 		MSG_DT_NULL_CFNP,		MSG_DT_NEEDED_CFNP,
4589273SAli.Bahrami@Sun.COM 		MSG_DT_PLTRELSZ_CFNP,		MSG_DT_PLTGOT_CFNP,
4599273SAli.Bahrami@Sun.COM 		MSG_DT_HASH_CFNP,		MSG_DT_STRTAB_CFNP,
4609273SAli.Bahrami@Sun.COM 		MSG_DT_SYMTAB_CFNP,		MSG_DT_RELA_CFNP,
4619273SAli.Bahrami@Sun.COM 		MSG_DT_RELASZ_CFNP,		MSG_DT_RELAENT_CFNP,
4629273SAli.Bahrami@Sun.COM 		MSG_DT_STRSZ_CFNP,		MSG_DT_SYMENT_CFNP,
4639273SAli.Bahrami@Sun.COM 		MSG_DT_INIT_CFNP,		MSG_DT_FINI_CFNP,
4649273SAli.Bahrami@Sun.COM 		MSG_DT_SONAME_CFNP,		MSG_DT_RPATH_CFNP,
4659273SAli.Bahrami@Sun.COM 		MSG_DT_SYMBOLIC_CFNP,		MSG_DT_REL_CFNP,
4669273SAli.Bahrami@Sun.COM 		MSG_DT_RELSZ_CFNP,		MSG_DT_RELENT_CFNP,
4679273SAli.Bahrami@Sun.COM 		MSG_DT_PLTREL_CFNP,		MSG_DT_DEBUG_CFNP,
4689273SAli.Bahrami@Sun.COM 		MSG_DT_TEXTREL_CFNP,		MSG_DT_JMPREL_CFNP,
4699273SAli.Bahrami@Sun.COM 		MSG_DT_BIND_NOW_CFNP,		MSG_DT_INIT_ARRAY_CFNP,
4709273SAli.Bahrami@Sun.COM 		MSG_DT_FINI_ARRAY_CFNP,		MSG_DT_INIT_ARRAYSZ_CFNP,
4719273SAli.Bahrami@Sun.COM 		MSG_DT_FINI_ARRAYSZ_CFNP,	MSG_DT_RUNPATH_CFNP,
4729273SAli.Bahrami@Sun.COM 		MSG_DT_FLAGS_CFNP,		0,
4739273SAli.Bahrami@Sun.COM 		MSG_DT_PREINIT_ARRAY_CFNP,	MSG_DT_PREINIT_ARRAYSZ_CFNP
4741618Srie 	};
4759273SAli.Bahrami@Sun.COM 	static const Msg	tags_null_nf[] = {
4769273SAli.Bahrami@Sun.COM 		MSG_DT_NULL_NF,			MSG_DT_NEEDED_NF,
4779273SAli.Bahrami@Sun.COM 		MSG_DT_PLTRELSZ_NF,		MSG_DT_PLTGOT_NF,
4789273SAli.Bahrami@Sun.COM 		MSG_DT_HASH_NF,			MSG_DT_STRTAB_NF,
4799273SAli.Bahrami@Sun.COM 		MSG_DT_SYMTAB_NF,		MSG_DT_RELA_NF,
4809273SAli.Bahrami@Sun.COM 		MSG_DT_RELASZ_NF,		MSG_DT_RELAENT_NF,
4819273SAli.Bahrami@Sun.COM 		MSG_DT_STRSZ_NF,		MSG_DT_SYMENT_NF,
4829273SAli.Bahrami@Sun.COM 		MSG_DT_INIT_NF,			MSG_DT_FINI_NF,
4839273SAli.Bahrami@Sun.COM 		MSG_DT_SONAME_NF,		MSG_DT_RPATH_NF,
4849273SAli.Bahrami@Sun.COM 		MSG_DT_SYMBOLIC_NF,		MSG_DT_REL_NF,
4859273SAli.Bahrami@Sun.COM 		MSG_DT_RELSZ_NF,		MSG_DT_RELENT_NF,
4869273SAli.Bahrami@Sun.COM 		MSG_DT_PLTREL_NF,		MSG_DT_DEBUG_NF,
4879273SAli.Bahrami@Sun.COM 		MSG_DT_TEXTREL_NF,		MSG_DT_JMPREL_NF,
4889273SAli.Bahrami@Sun.COM 		MSG_DT_BIND_NOW_NF,		MSG_DT_INIT_ARRAY_NF,
4899273SAli.Bahrami@Sun.COM 		MSG_DT_FINI_ARRAY_NF,		MSG_DT_INIT_ARRAYSZ_NF,
4909273SAli.Bahrami@Sun.COM 		MSG_DT_FINI_ARRAYSZ_NF,		MSG_DT_RUNPATH_NF,
4919273SAli.Bahrami@Sun.COM 		MSG_DT_FLAGS_NF,		0,
4929273SAli.Bahrami@Sun.COM 		MSG_DT_PREINIT_ARRAY_NF,	MSG_DT_PREINIT_ARRAYSZ_NF
4933492Sab196087 	};
4949273SAli.Bahrami@Sun.COM 	static const Msg	tags_null_dmp[] = {
4959273SAli.Bahrami@Sun.COM 		MSG_DT_NULL_CFNP,		MSG_DT_NEEDED_CFNP,
4969273SAli.Bahrami@Sun.COM 		MSG_DT_PLTRELSZ_DMP,		MSG_DT_PLTGOT_CFNP,
4979273SAli.Bahrami@Sun.COM 		MSG_DT_HASH_CFNP,		MSG_DT_STRTAB_CFNP,
4989273SAli.Bahrami@Sun.COM 		MSG_DT_SYMTAB_CFNP,		MSG_DT_RELA_CFNP,
4999273SAli.Bahrami@Sun.COM 		MSG_DT_RELASZ_CFNP,		MSG_DT_RELAENT_CFNP,
5009273SAli.Bahrami@Sun.COM 		MSG_DT_STRSZ_CFNP,		MSG_DT_SYMENT_CFNP,
5019273SAli.Bahrami@Sun.COM 		MSG_DT_INIT_CFNP,		MSG_DT_FINI_CFNP,
5029273SAli.Bahrami@Sun.COM 		MSG_DT_SONAME_CFNP,		MSG_DT_RPATH_CFNP,
5039273SAli.Bahrami@Sun.COM 		MSG_DT_SYMBOLIC_DMP,		MSG_DT_REL_CFNP,
5049273SAli.Bahrami@Sun.COM 		MSG_DT_RELSZ_CFNP,		MSG_DT_RELENT_CFNP,
5059273SAli.Bahrami@Sun.COM 		MSG_DT_PLTREL_CFNP,		MSG_DT_DEBUG_CFNP,
5069273SAli.Bahrami@Sun.COM 		MSG_DT_TEXTREL_CFNP,		MSG_DT_JMPREL_CFNP,
5079273SAli.Bahrami@Sun.COM 		MSG_DT_BIND_NOW_CFNP,		MSG_DT_INIT_ARRAY_CFNP,
5089273SAli.Bahrami@Sun.COM 		MSG_DT_FINI_ARRAY_CFNP,		MSG_DT_INIT_ARRAYSZ_CFNP,
5099273SAli.Bahrami@Sun.COM 		MSG_DT_FINI_ARRAYSZ_CFNP,	MSG_DT_RUNPATH_CFNP,
5109273SAli.Bahrami@Sun.COM 		MSG_DT_FLAGS_CFNP,		0,
5119273SAli.Bahrami@Sun.COM 		MSG_DT_PREINIT_ARRAY_CFNP,	MSG_DT_PREINIT_ARRAYSZ_CFNP
5121976Sab196087 	};
5139273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_null_cf = {
5149273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_NULL, tags_null_cf) };
5159273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_null_cfnp = {
5169273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_NULL, tags_null_cfnp) };
5179273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_null_nf = {
5189273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_NULL, tags_null_nf) };
5199273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_null_dmp = {
5209273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_NULL, tags_null_dmp) };
5210Sstevel@tonic-gate 
5223492Sab196087 	/*
5239273SAli.Bahrami@Sun.COM 	 * DT_SPARC_REGISTER was originally assigned 0x7000001. It is processor
5249273SAli.Bahrami@Sun.COM 	 * specific, and should have been in the range DT_LOPROC-DT_HIPROC
5259273SAli.Bahrami@Sun.COM 	 * instead of here. When the error was fixed,
5269273SAli.Bahrami@Sun.COM 	 * DT_DEPRECATED_SPARC_REGISTER was created to maintain backward
5279273SAli.Bahrami@Sun.COM 	 * compatability.
5289273SAli.Bahrami@Sun.COM 	 */
5299273SAli.Bahrami@Sun.COM 	static const Msg	tags_sdreg_cf[] = {
5309273SAli.Bahrami@Sun.COM 	    MSG_DT_DEP_SPARC_REG_CF };
5319273SAli.Bahrami@Sun.COM 	static const Msg	tags_sdreg_cfnp[] = {
5329273SAli.Bahrami@Sun.COM 	    MSG_DT_DEP_SPARC_REG_CFNP };
5339273SAli.Bahrami@Sun.COM 	static const Msg	tags_sdreg_nf[] = {
5349273SAli.Bahrami@Sun.COM 	    MSG_DT_DEP_SPARC_REG_NF };
5359273SAli.Bahrami@Sun.COM 
5369273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sdreg_cf = {
5379273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_DEPRECATED_SPARC_REGISTER, tags_sdreg_cf) };
5389273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sdreg_cfnp = {
5399273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_DEPRECATED_SPARC_REGISTER, tags_sdreg_cfnp) };
5409273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sdreg_nf = {
5419273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_DEPRECATED_SPARC_REGISTER, tags_sdreg_nf) };
5429273SAli.Bahrami@Sun.COM 
5439273SAli.Bahrami@Sun.COM 
5449273SAli.Bahrami@Sun.COM 	/*
5459273SAli.Bahrami@Sun.COM 	 * SUNW: DT_LOOS -> DT_HIOS range. Note holes between DT_SUNW_TLSSORTSZ,
5466206Sab196087 	 * DT_SUNW_STRPAD, and DT_SUNW_LDMACH. We handle the outliers
5476206Sab196087 	 * separately below as single values.
5483492Sab196087 	 */
5499273SAli.Bahrami@Sun.COM 	static const Msg	tags_sunw_auxiliary_cf[] = {
5509273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_AUXILIARY_CF,	MSG_DT_SUNW_RTLDINF_CF,
5519273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_FILTER_CF,		MSG_DT_SUNW_CAP_CF,
5529273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_SYMTAB_CF,		MSG_DT_SUNW_SYMSZ_CF,
5539273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_SORTENT_CF,		MSG_DT_SUNW_SYMSORT_CF,
5549273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_SYMSORTSZ_CF,	MSG_DT_SUNW_TLSSORT_CF,
55511827SRod.Evans@Sun.COM 		MSG_DT_SUNW_TLSSORTSZ_CF,	MSG_DT_SUNW_CAPINFO_CF,
55611827SRod.Evans@Sun.COM 		MSG_DT_SUNW_STRPAD_CF,		MSG_DT_SUNW_CAPCHAIN_CF,
55711827SRod.Evans@Sun.COM 		MSG_DT_SUNW_LDMACH_CF,		0,
55811827SRod.Evans@Sun.COM 		MSG_DT_SUNW_CAPCHAINENT_CF,	0,
55911827SRod.Evans@Sun.COM 		MSG_DT_SUNW_CAPCHAINSZ_CF
5609273SAli.Bahrami@Sun.COM 	};
5619273SAli.Bahrami@Sun.COM 	static const Msg	tags_sunw_auxiliary_cfnp[] = {
5629273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_AUXILIARY_CFNP,	MSG_DT_SUNW_RTLDINF_CFNP,
5639273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_FILTER_CFNP,	MSG_DT_SUNW_CAP_CFNP,
5649273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_SYMTAB_CFNP,	MSG_DT_SUNW_SYMSZ_CFNP,
5659273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_SORTENT_CFNP,	MSG_DT_SUNW_SYMSORT_CFNP,
5669273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_SYMSORTSZ_CFNP,	MSG_DT_SUNW_TLSSORT_CFNP,
56711827SRod.Evans@Sun.COM 		MSG_DT_SUNW_TLSSORTSZ_CFNP,	MSG_DT_SUNW_CAPINFO_CFNP,
56811827SRod.Evans@Sun.COM 		MSG_DT_SUNW_STRPAD_CFNP,	MSG_DT_SUNW_CAPCHAIN_CFNP,
56911827SRod.Evans@Sun.COM 		MSG_DT_SUNW_LDMACH_CFNP,	0,
57011827SRod.Evans@Sun.COM 		MSG_DT_SUNW_CAPCHAINENT_CFNP,	0,
57111827SRod.Evans@Sun.COM 		MSG_DT_SUNW_CAPCHAINSZ_CFNP
5723492Sab196087 	};
5739273SAli.Bahrami@Sun.COM 	static const Msg	tags_sunw_auxiliary_nf[] = {
5749273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_AUXILIARY_NF,	MSG_DT_SUNW_RTLDINF_NF,
5759273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_FILTER_NF,		MSG_DT_SUNW_CAP_NF,
5769273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_SYMTAB_NF,		MSG_DT_SUNW_SYMSZ_NF,
5779273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_SORTENT_NF,		MSG_DT_SUNW_SYMSORT_NF,
5789273SAli.Bahrami@Sun.COM 		MSG_DT_SUNW_SYMSORTSZ_NF,	MSG_DT_SUNW_TLSSORT_NF,
57911827SRod.Evans@Sun.COM 		MSG_DT_SUNW_TLSSORTSZ_NF,	MSG_DT_SUNW_CAPINFO_NF,
58011827SRod.Evans@Sun.COM 		MSG_DT_SUNW_STRPAD_NF,		MSG_DT_SUNW_CAPCHAIN_NF,
58111827SRod.Evans@Sun.COM 		MSG_DT_SUNW_LDMACH_NF,		0,
58211827SRod.Evans@Sun.COM 		MSG_DT_SUNW_CAPCHAINENT_NF,	0,
58311827SRod.Evans@Sun.COM 		MSG_DT_SUNW_CAPCHAINSZ_NF
5849273SAli.Bahrami@Sun.COM 	};
5859273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sunw_auxiliary_cf = {
5869273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_SUNW_AUXILIARY, tags_sunw_auxiliary_cf) };
5879273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sunw_auxiliary_cfnp = {
5889273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_SUNW_AUXILIARY, tags_sunw_auxiliary_cfnp) };
5899273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sunw_auxiliary_nf = {
5909273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_SUNW_AUXILIARY, tags_sunw_auxiliary_nf) };
5919273SAli.Bahrami@Sun.COM 
5929273SAli.Bahrami@Sun.COM 	/*
5939273SAli.Bahrami@Sun.COM 	 * GNU: (In DT_VALRNGLO section) DT_GNU_PRELINKED - DT_GNU_LIBLISTSZ
5949273SAli.Bahrami@Sun.COM 	 */
5959273SAli.Bahrami@Sun.COM 	static const Msg	tags_gnu_prelinked_cf[] = {
5969273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_PRELINKED_CF,	MSG_DT_GNU_CONFLICTSZ_CF,
5979273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_LIBLISTSZ_CF
5989273SAli.Bahrami@Sun.COM 	};
5999273SAli.Bahrami@Sun.COM 	static const Msg	tags_gnu_prelinked_cfnp[] = {
6009273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_PRELINKED_CFNP,	MSG_DT_GNU_CONFLICTSZ_CFNP,
6019273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_LIBLISTSZ_CFNP
6029273SAli.Bahrami@Sun.COM 	};
6039273SAli.Bahrami@Sun.COM 	static const Msg	tags_gnu_prelinked_nf[] = {
6049273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_PRELINKED_NF,	MSG_DT_GNU_CONFLICTSZ_NF,
6059273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_LIBLISTSZ_NF
6069273SAli.Bahrami@Sun.COM 	};
6079273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_gnu_prelinked_cf = {
6089273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_GNU_PRELINKED, tags_gnu_prelinked_cf) };
6099273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_gnu_prelinked_cfnp = {
6109273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_GNU_PRELINKED, tags_gnu_prelinked_cfnp) };
6119273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_gnu_prelinked_nf = {
6129273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_GNU_PRELINKED, tags_gnu_prelinked_nf) };
6130Sstevel@tonic-gate 
6143492Sab196087 	/*
6153492Sab196087 	 * SUNW: DT_VALRNGLO - DT_VALRNGHI range.
6163492Sab196087 	 */
6179273SAli.Bahrami@Sun.COM 	static const Msg	tags_checksum_cf[] = {
6189273SAli.Bahrami@Sun.COM 		MSG_DT_CHECKSUM_CF,		MSG_DT_PLTPADSZ_CF,
6199273SAli.Bahrami@Sun.COM 		MSG_DT_MOVEENT_CF,		MSG_DT_MOVESZ_CF,
6209273SAli.Bahrami@Sun.COM 		MSG_DT_FEATURE_1_CF,		MSG_DT_POSFLAG_1_CF,
6219273SAli.Bahrami@Sun.COM 		MSG_DT_SYMINSZ_CF,		MSG_DT_SYMINENT_CF
6229273SAli.Bahrami@Sun.COM 	};
6239273SAli.Bahrami@Sun.COM 	static const Msg	tags_checksum_cfnp[] = {
6249273SAli.Bahrami@Sun.COM 		MSG_DT_CHECKSUM_CFNP,		MSG_DT_PLTPADSZ_CFNP,
6259273SAli.Bahrami@Sun.COM 		MSG_DT_MOVEENT_CFNP,		MSG_DT_MOVESZ_CFNP,
6269273SAli.Bahrami@Sun.COM 		MSG_DT_FEATURE_1_CFNP,		MSG_DT_POSFLAG_1_CFNP,
6279273SAli.Bahrami@Sun.COM 		MSG_DT_SYMINSZ_CFNP,		MSG_DT_SYMINENT_CFNP
6289273SAli.Bahrami@Sun.COM 	};
6299273SAli.Bahrami@Sun.COM 	static const Msg	tags_checksum_nf[] = {
6309273SAli.Bahrami@Sun.COM 		MSG_DT_CHECKSUM_NF,		MSG_DT_PLTPADSZ_NF,
6319273SAli.Bahrami@Sun.COM 		MSG_DT_MOVEENT_NF,		MSG_DT_MOVESZ_NF,
6329273SAli.Bahrami@Sun.COM 		MSG_DT_FEATURE_1_NF,		MSG_DT_POSFLAG_1_NF,
6339273SAli.Bahrami@Sun.COM 		MSG_DT_SYMINSZ_NF,		MSG_DT_SYMINENT_NF
6343492Sab196087 	};
6359273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_checksum_cf = {
6369273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_CHECKSUM, tags_checksum_cf) };
6379273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_checksum_cfnp = {
6389273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_CHECKSUM, tags_checksum_cfnp) };
6399273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_checksum_nf = {
6409273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_CHECKSUM, tags_checksum_nf) };
6419273SAli.Bahrami@Sun.COM 
6429273SAli.Bahrami@Sun.COM 	/*
6439273SAli.Bahrami@Sun.COM 	 * GNU: (In DT_ADDRRNGLO section) DT_GNU_HASH - DT_GNU_LIBLIST
6449273SAli.Bahrami@Sun.COM 	 */
6459273SAli.Bahrami@Sun.COM 	static const Msg	tags_gnu_hash_cf[] = {
6469273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_HASH_CF,		MSG_DT_TLSDESC_PLT_CF,
6479273SAli.Bahrami@Sun.COM 		MSG_DT_TLSDESC_GOT_CF,		MSG_DT_GNU_CONFLICT_CF,
6489273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_LIBLIST_CF
6499273SAli.Bahrami@Sun.COM 	};
6509273SAli.Bahrami@Sun.COM 	static const Msg	tags_gnu_hash_cfnp[] = {
6519273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_HASH_CFNP,		MSG_DT_TLSDESC_PLT_CFNP,
6529273SAli.Bahrami@Sun.COM 		MSG_DT_TLSDESC_GOT_CFNP,	MSG_DT_GNU_CONFLICT_CFNP,
6539273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_LIBLIST_CFNP
6549273SAli.Bahrami@Sun.COM 	};
6559273SAli.Bahrami@Sun.COM 	static const Msg	tags_gnu_hash_nf[] = {
6569273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_HASH_NF,		MSG_DT_TLSDESC_PLT_NF,
6579273SAli.Bahrami@Sun.COM 		MSG_DT_TLSDESC_GOT_NF,		MSG_DT_GNU_CONFLICT_NF,
6589273SAli.Bahrami@Sun.COM 		MSG_DT_GNU_LIBLIST_NF
6599273SAli.Bahrami@Sun.COM 	};
6609273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_gnu_hash_cf = {
6619273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_GNU_HASH, tags_gnu_hash_cf) };
6629273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_gnu_hash_cfnp = {
6639273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_GNU_HASH, tags_gnu_hash_cfnp) };
6649273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_gnu_hash_nf = {
6659273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_GNU_HASH, tags_gnu_hash_nf) };
6663492Sab196087 
6673492Sab196087 	/*
6683492Sab196087 	 * SUNW: DT_ADDRRNGLO - DT_ADDRRNGHI range.
6693492Sab196087 	 */
6709273SAli.Bahrami@Sun.COM 	static const Msg	tags_config_cf[] = {
6719273SAli.Bahrami@Sun.COM 		MSG_DT_CONFIG_CF,		MSG_DT_DEPAUDIT_CF,
6729273SAli.Bahrami@Sun.COM 		MSG_DT_AUDIT_CF,		MSG_DT_PLTPAD_CF,
6739273SAli.Bahrami@Sun.COM 		MSG_DT_MOVETAB_CF,		MSG_DT_SYMINFO_CF
6749273SAli.Bahrami@Sun.COM 	};
6759273SAli.Bahrami@Sun.COM 	static const Msg	tags_config_cfnp[] = {
6769273SAli.Bahrami@Sun.COM 		MSG_DT_CONFIG_CFNP,		MSG_DT_DEPAUDIT_CFNP,
6779273SAli.Bahrami@Sun.COM 		MSG_DT_AUDIT_CFNP,		MSG_DT_PLTPAD_CFNP,
6789273SAli.Bahrami@Sun.COM 		MSG_DT_MOVETAB_CFNP,		MSG_DT_SYMINFO_CFNP
6793492Sab196087 	};
6809273SAli.Bahrami@Sun.COM 	static const Msg	tags_config_nf[] = {
6819273SAli.Bahrami@Sun.COM 		MSG_DT_CONFIG_NF,		MSG_DT_DEPAUDIT_NF,
6829273SAli.Bahrami@Sun.COM 		MSG_DT_AUDIT_NF,		MSG_DT_PLTPAD_NF,
6839273SAli.Bahrami@Sun.COM 		MSG_DT_MOVETAB_NF,		MSG_DT_SYMINFO_NF
6849273SAli.Bahrami@Sun.COM 	};
6859273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_config_cf = {
6869273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_CONFIG, tags_config_cf) };
6879273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_config_cfnp = {
6889273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_CONFIG, tags_config_cfnp) };
6899273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_config_nf = {
6909273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_CONFIG, tags_config_nf) };
6910Sstevel@tonic-gate 
6923492Sab196087 	/*
6933492Sab196087 	 * SUNW: generic range. Note hole between DT_VERSYM and DT_RELACOUNT.
6943492Sab196087 	 */
6959273SAli.Bahrami@Sun.COM 	static const Msg	tags_versym_cf[] = { MSG_DT_VERSYM_CF };
6969273SAli.Bahrami@Sun.COM 	static const Msg	tags_versym_cfnp[] = { MSG_DT_VERSYM_CFNP };
6979273SAli.Bahrami@Sun.COM 	static const Msg	tags_versym_nf[] = { MSG_DT_VERSYM_NF };
6989273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_versym_cf = {
6999273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_VERSYM, tags_versym_cf) };
7009273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_versym_cfnp = {
7019273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_VERSYM, tags_versym_cfnp) };
7029273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_versym_nf = {
7039273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_VERSYM, tags_versym_nf) };
7049273SAli.Bahrami@Sun.COM 
7059273SAli.Bahrami@Sun.COM 	static const Msg	tags_relacount_cf[] = {
7069273SAli.Bahrami@Sun.COM 		MSG_DT_RELACOUNT_CF,		MSG_DT_RELCOUNT_CF,
7079273SAli.Bahrami@Sun.COM 		MSG_DT_FLAGS_1_CF,		MSG_DT_VERDEF_CF,
7089273SAli.Bahrami@Sun.COM 		MSG_DT_VERDEFNUM_CF,		MSG_DT_VERNEED_CF,
7099273SAli.Bahrami@Sun.COM 		MSG_DT_VERNEEDNUM_CF
7103492Sab196087 	};
7119273SAli.Bahrami@Sun.COM 	static const Msg	tags_relacount_cfnp[] = {
7129273SAli.Bahrami@Sun.COM 		MSG_DT_RELACOUNT_CFNP,		MSG_DT_RELCOUNT_CFNP,
7139273SAli.Bahrami@Sun.COM 		MSG_DT_FLAGS_1_CFNP,		MSG_DT_VERDEF_CFNP,
7149273SAli.Bahrami@Sun.COM 		MSG_DT_VERDEFNUM_CFNP,		MSG_DT_VERNEED_CFNP,
7159273SAli.Bahrami@Sun.COM 		MSG_DT_VERNEEDNUM_CFNP
7169273SAli.Bahrami@Sun.COM 	};
7179273SAli.Bahrami@Sun.COM 	static const Msg	tags_relacount_nf[] = {
7189273SAli.Bahrami@Sun.COM 		MSG_DT_RELACOUNT_NF,		MSG_DT_RELCOUNT_NF,
7199273SAli.Bahrami@Sun.COM 		MSG_DT_FLAGS_1_NF,		MSG_DT_VERDEF_NF,
7209273SAli.Bahrami@Sun.COM 		MSG_DT_VERDEFNUM_NF,		MSG_DT_VERNEED_NF,
7219273SAli.Bahrami@Sun.COM 		MSG_DT_VERNEEDNUM_NF
7229273SAli.Bahrami@Sun.COM 	};
7239273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_relacount_cf = {
7249273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_RELACOUNT, tags_relacount_cf) };
7259273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_relacount_cfnp = {
7269273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_RELACOUNT, tags_relacount_cfnp) };
7279273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_relacount_nf = {
7289273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_RELACOUNT, tags_relacount_nf) };
7293492Sab196087 
7303492Sab196087 	/*
7319273SAli.Bahrami@Sun.COM 	 * DT_LOPROC - DT_HIPROC range: solaris/sparc-only
7329273SAli.Bahrami@Sun.COM 	 */
7339273SAli.Bahrami@Sun.COM 	static const Msg tags_sparc_reg_cf[] = { MSG_DT_SPARC_REGISTER_CF };
7349273SAli.Bahrami@Sun.COM 	static const Msg tags_sparc_reg_cfnp[] = { MSG_DT_SPARC_REGISTER_CFNP };
7359273SAli.Bahrami@Sun.COM 	static const Msg tags_sparc_reg_nf[] = { MSG_DT_SPARC_REGISTER_NF };
7369273SAli.Bahrami@Sun.COM 	static const Msg tags_sparc_reg_dmp[] = { MSG_DT_SPARC_REGISTER_DMP };
7379273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sparc_reg_cf = {
7389273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_cf) };
7399273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sparc_reg_cfnp = {
7409273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_cfnp) };
7419273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sparc_reg_nf = {
7429273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_nf) };
7439273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_sparc_reg_dmp = {
7449273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_dmp) };
7459273SAli.Bahrami@Sun.COM 
7469273SAli.Bahrami@Sun.COM 	/*
7479273SAli.Bahrami@Sun.COM 	 * DT_LOPROC - DT_HIPROC range: Solaris osabi, all hardware
7483492Sab196087 	 */
7499273SAli.Bahrami@Sun.COM 	static const Msg	tags_auxiliary_cf[] = {
7509273SAli.Bahrami@Sun.COM 		MSG_DT_AUXILIARY_CF,	MSG_DT_USED_CF,
7519273SAli.Bahrami@Sun.COM 		MSG_DT_FILTER_CF
7529273SAli.Bahrami@Sun.COM 	};
7539273SAli.Bahrami@Sun.COM 	static const Msg	tags_auxiliary_cfnp[] = {
7549273SAli.Bahrami@Sun.COM 		MSG_DT_AUXILIARY_CFNP,	MSG_DT_USED_CFNP,
7559273SAli.Bahrami@Sun.COM 		MSG_DT_FILTER_CFNP
7569273SAli.Bahrami@Sun.COM 	};
7579273SAli.Bahrami@Sun.COM 	static const Msg	tags_auxiliary_nf[] = {
7589273SAli.Bahrami@Sun.COM 		MSG_DT_AUXILIARY_NF,	MSG_DT_USED_NF,
7599273SAli.Bahrami@Sun.COM 		MSG_DT_FILTER_NF
7603492Sab196087 	};
7619273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_auxiliary_cf = {
7629273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_AUXILIARY, tags_auxiliary_cf) };
7639273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_auxiliary_cfnp = {
7649273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_AUXILIARY, tags_auxiliary_cfnp) };
7659273SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_auxiliary_nf = {
7669273SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(DT_AUXILIARY, tags_auxiliary_nf) };
7673492Sab196087 
7683492Sab196087 
7699273SAli.Bahrami@Sun.COM 	static const conv_ds_t	*retarr[MAX_RET];
7709273SAli.Bahrami@Sun.COM 
7719273SAli.Bahrami@Sun.COM 	int	ndx = 0;
7729273SAli.Bahrami@Sun.COM 	int	fmt_osabi = CONV_TYPE_FMT_ALT(fmt_flags);
7739273SAli.Bahrami@Sun.COM 	int	mach_sparc, osabi_solaris, osabi_linux;
7749273SAli.Bahrami@Sun.COM 
7753492Sab196087 
7760Sstevel@tonic-gate 
7779273SAli.Bahrami@Sun.COM 	osabi_solaris = (osabi == ELFOSABI_NONE) ||
7789273SAli.Bahrami@Sun.COM 	    (osabi == ELFOSABI_SOLARIS) || (osabi == CONV_OSABI_ALL);
7799273SAli.Bahrami@Sun.COM 	osabi_linux = (osabi == ELFOSABI_LINUX) || (osabi == CONV_OSABI_ALL);
7809273SAli.Bahrami@Sun.COM 	mach_sparc = (mach == EM_SPARC) || (mach == EM_SPARCV9) ||
7819273SAli.Bahrami@Sun.COM 	    (mach == EM_SPARC32PLUS) || (mach == CONV_MACH_ALL);
7820Sstevel@tonic-gate 
7833492Sab196087 	/*
7849273SAli.Bahrami@Sun.COM 	 * Fill in retarr with the descriptors for the messages that
7859273SAli.Bahrami@Sun.COM 	 * apply to the current osabi. Note that we order these items such
7869273SAli.Bahrami@Sun.COM 	 * that the more common are placed at the beginning, and the less
7879273SAli.Bahrami@Sun.COM 	 * likely at the end. This should speed the common case.
7889273SAli.Bahrami@Sun.COM 	 *
7899273SAli.Bahrami@Sun.COM 	 * Note that the CFNP and DMP styles are very similar, so they
7909273SAli.Bahrami@Sun.COM 	 * are combined in 'default', and fmt_osabi is consulted when there
7919273SAli.Bahrami@Sun.COM 	 * are differences.
7923492Sab196087 	 */
7939273SAli.Bahrami@Sun.COM 	switch (fmt_osabi) {
7949273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_CF:
7959273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_null_cf);
7969273SAli.Bahrami@Sun.COM 		if (osabi_solaris)
7979273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_sunw_auxiliary_cf);
7989273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_checksum_cf);
7999273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_config_cf);
8009273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_versym_cf);
8019273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_relacount_cf);
8029273SAli.Bahrami@Sun.COM 		if (osabi_solaris) {
8039273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_auxiliary_cf);
8049273SAli.Bahrami@Sun.COM 			if (mach_sparc) {
8059273SAli.Bahrami@Sun.COM 				retarr[ndx++] = CONV_DS_ADDR(ds_sparc_reg_cf);
8069273SAli.Bahrami@Sun.COM 				retarr[ndx++] = CONV_DS_ADDR(ds_sdreg_cf);
8079273SAli.Bahrami@Sun.COM 			}
8089273SAli.Bahrami@Sun.COM 		}
8099273SAli.Bahrami@Sun.COM 		if (osabi_linux) {
8109273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_prelinked_cf);
8119273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_hash_cf);
8129273SAli.Bahrami@Sun.COM 		}
8139273SAli.Bahrami@Sun.COM 		break;
8143492Sab196087 
8159273SAli.Bahrami@Sun.COM 	case CONV_FMT_ALT_NF:
8169273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_null_nf);
8179273SAli.Bahrami@Sun.COM 		if (osabi_solaris)
8189273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_sunw_auxiliary_nf);
8199273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_checksum_nf);
8209273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_config_nf);
8219273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_versym_nf);
8229273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_relacount_nf);
8239273SAli.Bahrami@Sun.COM 		if (osabi_solaris) {
8249273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_auxiliary_nf);
8259273SAli.Bahrami@Sun.COM 			if (mach_sparc) {
8269273SAli.Bahrami@Sun.COM 				retarr[ndx++] = CONV_DS_ADDR(ds_sparc_reg_nf);
8279273SAli.Bahrami@Sun.COM 				retarr[ndx++] = CONV_DS_ADDR(ds_sdreg_nf);
8289273SAli.Bahrami@Sun.COM 			}
8299273SAli.Bahrami@Sun.COM 		}
8309273SAli.Bahrami@Sun.COM 		if (osabi_linux) {
8319273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_prelinked_nf);
8329273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_hash_nf);
8339273SAli.Bahrami@Sun.COM 		}
8349273SAli.Bahrami@Sun.COM 		break;
8359273SAli.Bahrami@Sun.COM 	default:
8369273SAli.Bahrami@Sun.COM 		/*
8379273SAli.Bahrami@Sun.COM 		 * The default style for the generic range is CFNP,
8389273SAli.Bahrami@Sun.COM 		 * while dump has a couple of different strings.
8399273SAli.Bahrami@Sun.COM 		 */
8403492Sab196087 
8419273SAli.Bahrami@Sun.COM 		retarr[ndx++] = (fmt_osabi == CONV_FMT_ALT_DUMP) ?
8429273SAli.Bahrami@Sun.COM 		    CONV_DS_ADDR(ds_null_dmp) : CONV_DS_ADDR(ds_null_cfnp);
8439273SAli.Bahrami@Sun.COM 		if (osabi_solaris)
8449273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_sunw_auxiliary_cfnp);
8459273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_checksum_cfnp);
8469273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_config_cfnp);
8479273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_versym_cfnp);
8489273SAli.Bahrami@Sun.COM 		retarr[ndx++] = CONV_DS_ADDR(ds_relacount_cfnp);
8499273SAli.Bahrami@Sun.COM 		if (osabi_solaris) {
8509273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_auxiliary_cfnp);
8519273SAli.Bahrami@Sun.COM 			if (mach_sparc) {
8529273SAli.Bahrami@Sun.COM 				/*
8539273SAli.Bahrami@Sun.COM 				 * The default style for DT_SPARC_REGISTER
8549273SAli.Bahrami@Sun.COM 				 * is the dump style, which omits the 'SPARC_'.
8559273SAli.Bahrami@Sun.COM 				 * CFNP keeps the prefix.
8569273SAli.Bahrami@Sun.COM 				 */
8579273SAli.Bahrami@Sun.COM 				retarr[ndx++] =
8589273SAli.Bahrami@Sun.COM 				    (fmt_osabi == CONV_FMT_ALT_CFNP) ?
8599273SAli.Bahrami@Sun.COM 				    CONV_DS_ADDR(ds_sparc_reg_cfnp) :
8609273SAli.Bahrami@Sun.COM 				    CONV_DS_ADDR(ds_sparc_reg_dmp);
8619273SAli.Bahrami@Sun.COM 				retarr[ndx++] = CONV_DS_ADDR(ds_sdreg_cfnp);
8629273SAli.Bahrami@Sun.COM 			}
8639273SAli.Bahrami@Sun.COM 		}
8649273SAli.Bahrami@Sun.COM 		if (osabi_linux) {
8659273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_prelinked_cfnp);
8669273SAli.Bahrami@Sun.COM 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_hash_cfnp);
8679273SAli.Bahrami@Sun.COM 		}
8689273SAli.Bahrami@Sun.COM 		break;
8699273SAli.Bahrami@Sun.COM 	}
8703492Sab196087 
8719273SAli.Bahrami@Sun.COM 	retarr[ndx++] = NULL;
8729273SAli.Bahrami@Sun.COM 	assert(ndx <= MAX_RET);
8739273SAli.Bahrami@Sun.COM 	return (retarr);
8740Sstevel@tonic-gate }
875280Srie 
8769273SAli.Bahrami@Sun.COM conv_iter_ret_t
conv_iter_dyn_tag(conv_iter_osabi_t osabi,Half mach,Conv_fmt_flags_t fmt_flags,conv_iter_cb_t func,void * uvalue)8779273SAli.Bahrami@Sun.COM conv_iter_dyn_tag(conv_iter_osabi_t osabi, Half mach,
8789273SAli.Bahrami@Sun.COM     Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func, void *uvalue)
8799273SAli.Bahrami@Sun.COM {
8809273SAli.Bahrami@Sun.COM 	return (conv_iter_ds(osabi, mach,
8819273SAli.Bahrami@Sun.COM 	    conv_dyn_tag_strings(osabi, mach, fmt_flags), func, uvalue));
8829273SAli.Bahrami@Sun.COM }
8839273SAli.Bahrami@Sun.COM 
8849273SAli.Bahrami@Sun.COM 
8859273SAli.Bahrami@Sun.COM #define	BINDTSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE +			\
8862352Sab196087 		MSG_BND_NEEDED_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
8872352Sab196087 		MSG_BND_REFER_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
8882352Sab196087 		MSG_BND_FILTER_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
8894734Sab196087 		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
8904734Sab196087 
8914734Sab196087 /*
8924734Sab196087  * Ensure that Conv_bnd_type_buf_t is large enough:
8934734Sab196087  *
8944734Sab196087  * BINDTSZ is the real minimum size of the buffer required by conv_bnd_type().
8954734Sab196087  * However, Conv_bnd_type_buf_t uses CONV_BND_TYPE_BUFSIZE to set the
8964734Sab196087  * buffer size. We do things this way because the definition of BINDTSZ uses
8974734Sab196087  * information that is not available in the environment of other programs
8984734Sab196087  * that include the conv.h header file.
8994734Sab196087  */
9005152Sab196087 #if (CONV_BND_TYPE_BUFSIZE != BINDTSZ) && !defined(__lint)
9015152Sab196087 #define	REPORT_BUFSIZE BINDTSZ
9025152Sab196087 #include "report_bufsize.h"
9035152Sab196087 #error "CONV_BND_TYPE_BUFSIZE does not match BINDTSZ"
9044734Sab196087 #endif
905280Srie 
906280Srie const char *
conv_bnd_type(uint_t flags,Conv_bnd_type_buf_t * bnd_type_buf)9074734Sab196087 conv_bnd_type(uint_t flags, Conv_bnd_type_buf_t *bnd_type_buf)
908280Srie {
9099273SAli.Bahrami@Sun.COM 	static const Val_desc vda[] = {
9109273SAli.Bahrami@Sun.COM 		{ BND_NEEDED,		MSG_BND_NEEDED },
9119273SAli.Bahrami@Sun.COM 		{ BND_REFER,		MSG_BND_REFER },
9129273SAli.Bahrami@Sun.COM 		{ BND_FILTER,		MSG_BND_FILTER },
9131618Srie 		{ 0,			0 }
9141618Srie 	};
9154734Sab196087 	static CONV_EXPN_FIELD_ARG conv_arg = {
9169273SAli.Bahrami@Sun.COM 	    NULL, sizeof (bnd_type_buf->buf) };
917280Srie 
9181618Srie 	if (flags == 0)
9191618Srie 		return (MSG_ORIG(MSG_STR_EMPTY));
920280Srie 
9214734Sab196087 	conv_arg.buf = bnd_type_buf->buf;
9222352Sab196087 	conv_arg.oflags = conv_arg.rflags = flags;
9239273SAli.Bahrami@Sun.COM 	(void) conv_expn_field(&conv_arg, vda, 0);
9241618Srie 
9254734Sab196087 	return ((const char *)bnd_type_buf->buf);
926280Srie }
927280Srie 
9281824Srie /*
9291824Srie  * Note, conv_bnd_obj() is called with either:
9301824Srie  *	LML_FLG_OBJADDED (possibly with LML_FLG_OBJREEVAL added), or
9311824Srie  *	LML_FLG_OBJDELETED, or
9321824Srie  *	LML_FLG_ATEXIT.
9331824Srie  */
9342352Sab196087 #define	BINDOSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
9352352Sab196087 		MSG_BND_ADDED_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
9362352Sab196087 		MSG_BND_REEVAL_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
9374734Sab196087 		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
9384734Sab196087 
9394734Sab196087 /*
9404734Sab196087  * Ensure that Conv_bnd_obj_buf_t is large enough:
9414734Sab196087  *
9424734Sab196087  * BINDOSZ is the real minimum size of the buffer required by conv_bnd_obj().
9434734Sab196087  * However, Conv_bnd_obj_buf_t uses CONV_BND_OBJ_BUFSIZE to set the
9444734Sab196087  * buffer size. We do things this way because the definition of BINDOSZ uses
9454734Sab196087  * information that is not available in the environment of other programs
9464734Sab196087  * that include the conv.h header file.
9474734Sab196087  */
9485152Sab196087 #if (CONV_BND_OBJ_BUFSIZE != BINDOSZ) && !defined(__lint)
9495152Sab196087 #define	REPORT_BUFSIZE BINDOSZ
9505152Sab196087 #include "report_bufsize.h"
9515152Sab196087 #error "CONV_BND_OBJ_BUFSIZE does not match BINDOSZ"
9524734Sab196087 #endif
953280Srie 
954280Srie const char *
conv_bnd_obj(uint_t flags,Conv_bnd_obj_buf_t * bnd_obj_buf)9554734Sab196087 conv_bnd_obj(uint_t flags, Conv_bnd_obj_buf_t *bnd_obj_buf)
956280Srie {
9579273SAli.Bahrami@Sun.COM 	static const Val_desc vda[] = {
9589273SAli.Bahrami@Sun.COM 		{ LML_FLG_OBJADDED,	MSG_BND_ADDED },
9599273SAli.Bahrami@Sun.COM 		{ LML_FLG_OBJREEVAL,	MSG_BND_REEVAL },
9609273SAli.Bahrami@Sun.COM 		{ LML_FLG_OBJDELETED,	MSG_BND_DELETED },
9619273SAli.Bahrami@Sun.COM 		{ LML_FLG_ATEXIT,	MSG_BND_ATEXIT },
9621618Srie 		{ 0,			0 }
9631618Srie 	};
9644734Sab196087 	static CONV_EXPN_FIELD_ARG conv_arg = {
9659273SAli.Bahrami@Sun.COM 	    NULL, sizeof (bnd_obj_buf->buf) };
9661618Srie 
9671824Srie 	if ((flags & (LML_FLG_OBJADDED | LML_FLG_OBJREEVAL |
9681824Srie 	    LML_FLG_OBJDELETED | LML_FLG_ATEXIT)) == 0)
9691824Srie 		return (MSG_ORIG(MSG_BND_REVISIT));
970280Srie 
971280Srie 	/*
9721618Srie 	 * Note, we're not worried about unknown flags for this family, only
9732352Sab196087 	 * the selected flags are of interest, so we leave conv_arg.rflags
9742352Sab196087 	 * set to 0.
975280Srie 	 */
9764734Sab196087 	conv_arg.buf = bnd_obj_buf->buf;
9772352Sab196087 	conv_arg.oflags = flags;
9789273SAli.Bahrami@Sun.COM 	(void) conv_expn_field(&conv_arg, vda, 0);
979280Srie 
9804734Sab196087 	return ((const char *)bnd_obj_buf->buf);
981280Srie }
982