17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
55aefb655Srie  * Common Development and Distribution License (the "License").
65aefb655Srie  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
215aefb655Srie 
227c478bd9Sstevel@tonic-gate /*
23*08278a5eSRod Evans  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate /*
287c478bd9Sstevel@tonic-gate  * String conversion routine for .dynamic tag entries.
297c478bd9Sstevel@tonic-gate  */
307c478bd9Sstevel@tonic-gate #include	<stdio.h>
317c478bd9Sstevel@tonic-gate #include	<string.h>
327c478bd9Sstevel@tonic-gate #include	<sys/elf_SPARC.h>
33dffec89cSrie #include	"rtld.h"
347c478bd9Sstevel@tonic-gate #include	"_conv.h"
357c478bd9Sstevel@tonic-gate #include	"dynamic_msg.h"
367c478bd9Sstevel@tonic-gate 
37d579eb63Sab 
38d579eb63Sab 
394f680cc6SAli Bahrami const Val_desc *
404f680cc6SAli Bahrami conv_dyn_posflag1_strings(Conv_fmt_flags_t fmt_flags)
414f680cc6SAli Bahrami {
42ba4e3c84Sab #define	POSSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
434f680cc6SAli Bahrami 	MSG_DF_P1_LAZYLOAD_CF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
444f680cc6SAli Bahrami 	MSG_DF_P1_GROUPPERM_CF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
454f680cc6SAli Bahrami 	CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
46de777a60Sab 
474f680cc6SAli Bahrami 	/*
484f680cc6SAli Bahrami 	 * Ensure that Conv_dyn_posflag1_buf_t is large enough:
494f680cc6SAli Bahrami 	 *
504f680cc6SAli Bahrami 	 * POSSZ is the real minimum size of the buffer required by
514f680cc6SAli Bahrami 	 * conv_dyn_posflag1(). However, Conv_dyn_posflag1_buf_t uses
524f680cc6SAli Bahrami 	 * CONV_DYN_POSFLAG1_BUFSIZE to set the buffer size. We do things
534f680cc6SAli Bahrami 	 * this way because the definition of POSSZ uses
544f680cc6SAli Bahrami 	 * information that is not available in the environment of other
554f680cc6SAli Bahrami 	 * programs that include the conv.h header file.
564f680cc6SAli Bahrami 	 */
576a074c93Sab #if (CONV_DYN_POSFLAG1_BUFSIZE != POSSZ) && !defined(__lint)
586a074c93Sab #define	REPORT_BUFSIZE POSSZ
596a074c93Sab #include "report_bufsize.h"
606a074c93Sab #error "CONV_DYN_POSFLAG1_BUFSIZE does not match POSSZ"
61de777a60Sab #endif
627c478bd9Sstevel@tonic-gate 
634f680cc6SAli Bahrami 	static const Val_desc vda_def[] = {
644f680cc6SAli Bahrami 		{ DF_P1_LAZYLOAD,	MSG_DF_P1_LAZYLOAD_DEF },
654f680cc6SAli Bahrami 		{ DF_P1_GROUPPERM,	MSG_DF_P1_GROUPPERM_CFNP },
665aefb655Srie 		{ 0,			0 }
675aefb655Srie 	};
684f680cc6SAli Bahrami 	static const Val_desc vda_cf[] = {
694f680cc6SAli Bahrami 		{ DF_P1_LAZYLOAD,	MSG_DF_P1_LAZYLOAD_CF },
704f680cc6SAli Bahrami 		{ DF_P1_GROUPPERM,	MSG_DF_P1_GROUPPERM_CF },
714f680cc6SAli Bahrami 		{ 0,			0 }
724f680cc6SAli Bahrami 	};
734f680cc6SAli Bahrami 	static const Val_desc vda_cfnp[] = {
744f680cc6SAli Bahrami 		{ DF_P1_LAZYLOAD,	MSG_DF_P1_LAZYLOAD_CFNP },
754f680cc6SAli Bahrami 		{ DF_P1_GROUPPERM,	MSG_DF_P1_GROUPPERM_CFNP },
764f680cc6SAli Bahrami 		{ 0,			0 }
774f680cc6SAli Bahrami 	};
784f680cc6SAli Bahrami 	static const Val_desc vda_nf[] = {
794f680cc6SAli Bahrami 		{ DF_P1_LAZYLOAD,	MSG_DF_P1_LAZYLOAD_NF },
804f680cc6SAli Bahrami 		{ DF_P1_GROUPPERM,	MSG_DF_P1_GROUPPERM_NF },
81ba4e3c84Sab 		{ 0,			0 }
82ba4e3c84Sab 	};
835aefb655Srie 
844f680cc6SAli Bahrami 	switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
854f680cc6SAli Bahrami 	case CONV_FMT_ALT_DUMP:
864f680cc6SAli Bahrami 	case CONV_FMT_ALT_CFNP:
874f680cc6SAli Bahrami 		return (vda_cfnp);
884f680cc6SAli Bahrami 	case CONV_FMT_ALT_CF:
894f680cc6SAli Bahrami 		return (vda_cf);
904f680cc6SAli Bahrami 	case CONV_FMT_ALT_NF:
914f680cc6SAli Bahrami 		return (vda_nf);
924f680cc6SAli Bahrami 	}
937c478bd9Sstevel@tonic-gate 
944f680cc6SAli Bahrami 	return (vda_def);
954f680cc6SAli Bahrami }
967c478bd9Sstevel@tonic-gate 
974f680cc6SAli Bahrami conv_iter_ret_t
984f680cc6SAli Bahrami conv_iter_dyn_posflag1(Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func,
994f680cc6SAli Bahrami     void *uvalue)
1004f680cc6SAli Bahrami {
1014f680cc6SAli Bahrami 	return (conv_iter_vd(conv_dyn_posflag1_strings(fmt_flags),
1024f680cc6SAli Bahrami 	    func, uvalue));
1037c478bd9Sstevel@tonic-gate }
1047c478bd9Sstevel@tonic-gate 
1054f680cc6SAli Bahrami const Val_desc *
1064f680cc6SAli Bahrami conv_dyn_flag_strings(Conv_fmt_flags_t fmt_flags)
1074f680cc6SAli Bahrami {
108ba4e3c84Sab #define	FLAGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
1094f680cc6SAli Bahrami 	MSG_DF_ORIGIN_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1104f680cc6SAli Bahrami 	MSG_DF_SYMBOLIC_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1114f680cc6SAli Bahrami 	MSG_DF_TEXTREL_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1124f680cc6SAli Bahrami 	MSG_DF_BIND_NOW_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1134f680cc6SAli Bahrami 	MSG_DF_STATIC_TLS_CF_SIZE 	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1144f680cc6SAli Bahrami 	CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
115de777a60Sab 
1164f680cc6SAli Bahrami 	/*
1174f680cc6SAli Bahrami 	 * Ensure that Conv_dyn_flag_buf_t is large enough:
1184f680cc6SAli Bahrami 	 *
1194f680cc6SAli Bahrami 	 * FLAGSZ is the real minimum size of the buffer required by
1204f680cc6SAli Bahrami 	 * conv_dyn_flag(). However, Conv_dyn_flag_buf_t uses
1214f680cc6SAli Bahrami 	 * CONV_DYN_FLAG_BUFSIZE to set the buffer size. We do things this
1224f680cc6SAli Bahrami 	 * way because the definition of FLAGSZ uses information that is not
1234f680cc6SAli Bahrami 	 * available in the environment of other programs that include the
1244f680cc6SAli Bahrami 	 * conv.h header file.
1254f680cc6SAli Bahrami 	 */
1266a074c93Sab #if (CONV_DYN_FLAG_BUFSIZE != FLAGSZ) && !defined(__lint)
1276a074c93Sab #define	REPORT_BUFSIZE FLAGSZ
1286a074c93Sab #include "report_bufsize.h"
1296a074c93Sab #error "CONV_DYN_FLAG_BUFSIZE does not match FLAGSZ"
130de777a60Sab #endif
1315aefb655Srie 
1324f680cc6SAli Bahrami 	static const Val_desc vda_cf[] = {
1334f680cc6SAli Bahrami 		{ DF_ORIGIN,		MSG_DF_ORIGIN_CF },
1344f680cc6SAli Bahrami 		{ DF_SYMBOLIC,		MSG_DF_SYMBOLIC_CF },
1354f680cc6SAli Bahrami 		{ DF_TEXTREL,		MSG_DF_TEXTREL_CF },
1364f680cc6SAli Bahrami 		{ DF_BIND_NOW,		MSG_DF_BIND_NOW_CF },
1374f680cc6SAli Bahrami 		{ DF_STATIC_TLS,	MSG_DF_STATIC_TLS_CF },
1384f680cc6SAli Bahrami 		{ 0 }
1394f680cc6SAli Bahrami 	};
1404f680cc6SAli Bahrami 	static const Val_desc vda_cfnp[] = {
1414f680cc6SAli Bahrami 		{ DF_ORIGIN,		MSG_DF_ORIGIN_CFNP },
1424f680cc6SAli Bahrami 		{ DF_SYMBOLIC,		MSG_DF_SYMBOLIC_CFNP },
1434f680cc6SAli Bahrami 		{ DF_TEXTREL,		MSG_DF_TEXTREL_CFNP },
1444f680cc6SAli Bahrami 		{ DF_BIND_NOW,		MSG_DF_BIND_NOW_CFNP },
1454f680cc6SAli Bahrami 		{ DF_STATIC_TLS,	MSG_DF_STATIC_TLS_CFNP },
1464f680cc6SAli Bahrami 		{ 0 }
1474f680cc6SAli Bahrami 	};
1484f680cc6SAli Bahrami 	static const Val_desc vda_nf[] = {
1494f680cc6SAli Bahrami 		{ DF_ORIGIN,		MSG_DF_ORIGIN_NF },
1504f680cc6SAli Bahrami 		{ DF_SYMBOLIC,		MSG_DF_SYMBOLIC_NF },
1514f680cc6SAli Bahrami 		{ DF_TEXTREL,		MSG_DF_TEXTREL_NF },
1524f680cc6SAli Bahrami 		{ DF_BIND_NOW,		MSG_DF_BIND_NOW_NF },
1534f680cc6SAli Bahrami 		{ DF_STATIC_TLS,	MSG_DF_STATIC_TLS_NF },
1544f680cc6SAli Bahrami 		{ 0 }
1554f680cc6SAli Bahrami 	};
1565aefb655Srie 
1574f680cc6SAli Bahrami 	switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
1584f680cc6SAli Bahrami 	case CONV_FMT_ALT_CF:
1594f680cc6SAli Bahrami 		return (vda_cf);
1604f680cc6SAli Bahrami 	case CONV_FMT_ALT_NF:
1614f680cc6SAli Bahrami 		return (vda_nf);
162ba4e3c84Sab 	}
1635aefb655Srie 
1644f680cc6SAli Bahrami 	return (vda_cfnp);
1657c478bd9Sstevel@tonic-gate }
1667c478bd9Sstevel@tonic-gate 
1674f680cc6SAli Bahrami conv_iter_ret_t
1684f680cc6SAli Bahrami conv_iter_dyn_flag(Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func,
1694f680cc6SAli Bahrami     void *uvalue)
1704f680cc6SAli Bahrami {
1714f680cc6SAli Bahrami 	return (conv_iter_vd(conv_dyn_flag_strings(fmt_flags), func, uvalue));
1724f680cc6SAli Bahrami }
1734f680cc6SAli Bahrami 
1744f680cc6SAli Bahrami const Val_desc *
1754f680cc6SAli Bahrami conv_dyn_flag1_strings(Conv_fmt_flags_t fmt_flags)
1764f680cc6SAli Bahrami {
177ba4e3c84Sab #define	FLAG1SZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
1784f680cc6SAli Bahrami 	MSG_DF_1_NOW_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1794f680cc6SAli Bahrami 	MSG_DF_1_GLOBAL_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1804f680cc6SAli Bahrami 	MSG_DF_1_GROUP_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1814f680cc6SAli Bahrami 	MSG_DF_1_NODELETE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1824f680cc6SAli Bahrami 	MSG_DF_1_LOADFLTR_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1834f680cc6SAli Bahrami 	MSG_DF_1_INITFIRST_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1844f680cc6SAli Bahrami 	MSG_DF_1_NOOPEN_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1854f680cc6SAli Bahrami 	MSG_DF_1_ORIGIN_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1864f680cc6SAli Bahrami 	MSG_DF_1_DIRECT_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1874f680cc6SAli Bahrami 	MSG_DF_1_TRANS_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1884f680cc6SAli Bahrami 	MSG_DF_1_INTERPOSE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1894f680cc6SAli Bahrami 	MSG_DF_1_NODEFLIB_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1904f680cc6SAli Bahrami 	MSG_DF_1_NODUMP_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1914f680cc6SAli Bahrami 	MSG_DF_1_CONFALT_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1924f680cc6SAli Bahrami 	MSG_DF_1_ENDFILTEE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1934f680cc6SAli Bahrami 	MSG_DF_1_DISPRELPND_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1944f680cc6SAli Bahrami 	MSG_DF_1_DISPRELDNE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1954f680cc6SAli Bahrami 	MSG_DF_1_NODIRECT_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1964f680cc6SAli Bahrami 	MSG_DF_1_IGNMULDEF_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1974f680cc6SAli Bahrami 	MSG_DF_1_NOKSYMS_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1984f680cc6SAli Bahrami 	MSG_DF_1_NOHDR_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1994f680cc6SAli Bahrami 	MSG_DF_1_NORELOC_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2004f680cc6SAli Bahrami 	MSG_DF_1_SYMINTPOSE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2014f680cc6SAli Bahrami 	MSG_DF_1_GLOBAUDIT_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2024f680cc6SAli Bahrami 	MSG_DF_1_SINGLETON_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2034f680cc6SAli Bahrami 	CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
204de777a60Sab 
2054f680cc6SAli Bahrami 	/*
2064f680cc6SAli Bahrami 	 * Ensure that Conv_dyn_flag1_buf_t is large enough:
2074f680cc6SAli Bahrami 	 *
2084f680cc6SAli Bahrami 	 * FLAG1SZ is the real minimum size of the buffer required by
2094f680cc6SAli Bahrami 	 * conv_dyn_flag1(). However, Conv_dyn_flag1_buf_t uses
2104f680cc6SAli Bahrami 	 * CONV_DYN_FLAG1_BUFSIZE to set the buffer size. We do things this
2114f680cc6SAli Bahrami 	 * way because the definition of FLAG1SZ uses information that is not
2124f680cc6SAli Bahrami 	 * available in the environment of other programs that include the
2134f680cc6SAli Bahrami 	 * conv.h header file.
2144f680cc6SAli Bahrami 	 */
2156a074c93Sab #if (CONV_DYN_FLAG1_BUFSIZE != FLAG1SZ) && !defined(__lint)
2166a074c93Sab #define	REPORT_BUFSIZE FLAG1SZ
2176a074c93Sab #include "report_bufsize.h"
2186a074c93Sab #error "CONV_DYN_FLAG1_BUFSIZE does not match FLAG1SZ"
219de777a60Sab #endif
2207c478bd9Sstevel@tonic-gate 
2214f680cc6SAli Bahrami 	static const Val_desc vda_def[] = {
2224f680cc6SAli Bahrami 		{ DF_1_NOW,		MSG_DF_1_NOW_CFNP },
2234f680cc6SAli Bahrami 		{ DF_1_GLOBAL,		MSG_DF_1_GLOBAL_CFNP },
2244f680cc6SAli Bahrami 		{ DF_1_GROUP,		MSG_DF_1_GROUP_CFNP },
2254f680cc6SAli Bahrami 		{ DF_1_NODELETE,	MSG_DF_1_NODELETE_CFNP },
2264f680cc6SAli Bahrami 		{ DF_1_LOADFLTR,	MSG_DF_1_LOADFLTR_CFNP },
2274f680cc6SAli Bahrami 		{ DF_1_INITFIRST,	MSG_DF_1_INITFIRST_CFNP },
2284f680cc6SAli Bahrami 		{ DF_1_NOOPEN,		MSG_DF_1_NOOPEN_CFNP },
2294f680cc6SAli Bahrami 		{ DF_1_ORIGIN,		MSG_DF_1_ORIGIN_CFNP },
2304f680cc6SAli Bahrami 		{ DF_1_DIRECT,		MSG_DF_1_DIRECT_CFNP },
2314f680cc6SAli Bahrami 		{ DF_1_TRANS,		MSG_DF_1_TRANS_CFNP },
2324f680cc6SAli Bahrami 		{ DF_1_INTERPOSE,	MSG_DF_1_INTERPOSE_DEF },
2334f680cc6SAli Bahrami 		{ DF_1_NODEFLIB,	MSG_DF_1_NODEFLIB_CFNP },
2344f680cc6SAli Bahrami 		{ DF_1_NODUMP,		MSG_DF_1_NODUMP_CFNP },
2354f680cc6SAli Bahrami 		{ DF_1_CONFALT,		MSG_DF_1_CONFALT_CFNP },
2364f680cc6SAli Bahrami 		{ DF_1_ENDFILTEE,	MSG_DF_1_ENDFILTEE_CFNP },
2374f680cc6SAli Bahrami 		{ DF_1_DISPRELDNE,	MSG_DF_1_DISPRELDNE_DEF },
2384f680cc6SAli Bahrami 		{ DF_1_DISPRELPND,	MSG_DF_1_DISPRELPND_DEF },
2394f680cc6SAli Bahrami 		{ DF_1_NODIRECT,	MSG_DF_1_NODIRECT_CFNP },
2404f680cc6SAli Bahrami 		{ DF_1_IGNMULDEF,	MSG_DF_1_IGNMULDEF_DEF },
2414f680cc6SAli Bahrami 		{ DF_1_NOKSYMS,		MSG_DF_1_NOKSYMS_CFNP },
2424f680cc6SAli Bahrami 		{ DF_1_NOHDR,		MSG_DF_1_NOHDR_CFNP },
2434f680cc6SAli Bahrami 		{ DF_1_EDITED,		MSG_DF_1_EDITED_CFNP },
2444f680cc6SAli Bahrami 		{ DF_1_NORELOC,		MSG_DF_1_NORELOC_CFNP },
2454f680cc6SAli Bahrami 		{ DF_1_SYMINTPOSE,	MSG_DF_1_SYMINTPOSE_DEF },
2464f680cc6SAli Bahrami 		{ DF_1_GLOBAUDIT,	MSG_DF_1_GLOBAUDIT_DEF },
2474f680cc6SAli Bahrami 		{ DF_1_SINGLETON,	MSG_DF_1_SINGLETON_DEF },
2484f680cc6SAli Bahrami 		{ 0,			0 }
2494f680cc6SAli Bahrami 	};
2504f680cc6SAli Bahrami 	static const Val_desc vda_cf[] = {
2514f680cc6SAli Bahrami 		{ DF_1_NOW,		MSG_DF_1_NOW_CF },
2524f680cc6SAli Bahrami 		{ DF_1_GLOBAL,		MSG_DF_1_GLOBAL_CF },
2534f680cc6SAli Bahrami 		{ DF_1_GROUP,		MSG_DF_1_GROUP_CF },
2544f680cc6SAli Bahrami 		{ DF_1_NODELETE,	MSG_DF_1_NODELETE_CF },
2554f680cc6SAli Bahrami 		{ DF_1_LOADFLTR,	MSG_DF_1_LOADFLTR_CF },
2564f680cc6SAli Bahrami 		{ DF_1_INITFIRST,	MSG_DF_1_INITFIRST_CF },
2574f680cc6SAli Bahrami 		{ DF_1_NOOPEN,		MSG_DF_1_NOOPEN_CF },
2584f680cc6SAli Bahrami 		{ DF_1_ORIGIN,		MSG_DF_1_ORIGIN_CF },
2594f680cc6SAli Bahrami 		{ DF_1_DIRECT,		MSG_DF_1_DIRECT_CF },
2604f680cc6SAli Bahrami 		{ DF_1_TRANS,		MSG_DF_1_TRANS_CF },
2614f680cc6SAli Bahrami 		{ DF_1_INTERPOSE,	MSG_DF_1_INTERPOSE_CF },
2624f680cc6SAli Bahrami 		{ DF_1_NODEFLIB,	MSG_DF_1_NODEFLIB_CF },
2634f680cc6SAli Bahrami 		{ DF_1_NODUMP,		MSG_DF_1_NODUMP_CF },
2644f680cc6SAli Bahrami 		{ DF_1_CONFALT,		MSG_DF_1_CONFALT_CF },
2654f680cc6SAli Bahrami 		{ DF_1_ENDFILTEE,	MSG_DF_1_ENDFILTEE_CF },
2664f680cc6SAli Bahrami 		{ DF_1_DISPRELDNE,	MSG_DF_1_DISPRELDNE_CF },
2674f680cc6SAli Bahrami 		{ DF_1_DISPRELPND,	MSG_DF_1_DISPRELPND_CF },
2684f680cc6SAli Bahrami 		{ DF_1_NODIRECT,	MSG_DF_1_NODIRECT_CF },
2694f680cc6SAli Bahrami 		{ DF_1_IGNMULDEF,	MSG_DF_1_IGNMULDEF_CF },
2704f680cc6SAli Bahrami 		{ DF_1_NOKSYMS,		MSG_DF_1_NOKSYMS_CF },
2714f680cc6SAli Bahrami 		{ DF_1_NOHDR,		MSG_DF_1_NOHDR_CF },
2724f680cc6SAli Bahrami 		{ DF_1_EDITED,		MSG_DF_1_EDITED_CF },
2734f680cc6SAli Bahrami 		{ DF_1_NORELOC,		MSG_DF_1_NORELOC_CF },
2744f680cc6SAli Bahrami 		{ DF_1_SYMINTPOSE,	MSG_DF_1_SYMINTPOSE_CF },
2754f680cc6SAli Bahrami 		{ DF_1_GLOBAUDIT,	MSG_DF_1_GLOBAUDIT_CF },
2764f680cc6SAli Bahrami 		{ DF_1_SINGLETON,	MSG_DF_1_SINGLETON_CF },
2774f680cc6SAli Bahrami 		{ 0,			0 }
2784f680cc6SAli Bahrami 	};
2794f680cc6SAli Bahrami 	static const Val_desc vda_cfnp[] = {
2804f680cc6SAli Bahrami 		{ DF_1_NOW,		MSG_DF_1_NOW_CFNP },
2814f680cc6SAli Bahrami 		{ DF_1_GLOBAL,		MSG_DF_1_GLOBAL_CFNP },
2824f680cc6SAli Bahrami 		{ DF_1_GROUP,		MSG_DF_1_GROUP_CFNP },
2834f680cc6SAli Bahrami 		{ DF_1_NODELETE,	MSG_DF_1_NODELETE_CFNP },
2844f680cc6SAli Bahrami 		{ DF_1_LOADFLTR,	MSG_DF_1_LOADFLTR_CFNP },
2854f680cc6SAli Bahrami 		{ DF_1_INITFIRST,	MSG_DF_1_INITFIRST_CFNP },
2864f680cc6SAli Bahrami 		{ DF_1_NOOPEN,		MSG_DF_1_NOOPEN_CFNP },
2874f680cc6SAli Bahrami 		{ DF_1_ORIGIN,		MSG_DF_1_ORIGIN_CFNP },
2884f680cc6SAli Bahrami 		{ DF_1_DIRECT,		MSG_DF_1_DIRECT_CFNP },
2894f680cc6SAli Bahrami 		{ DF_1_TRANS,		MSG_DF_1_TRANS_CFNP },
2904f680cc6SAli Bahrami 		{ DF_1_INTERPOSE,	MSG_DF_1_INTERPOSE_CFNP },
2914f680cc6SAli Bahrami 		{ DF_1_NODEFLIB,	MSG_DF_1_NODEFLIB_CFNP },
2924f680cc6SAli Bahrami 		{ DF_1_NODUMP,		MSG_DF_1_NODUMP_CFNP },
2934f680cc6SAli Bahrami 		{ DF_1_CONFALT,		MSG_DF_1_CONFALT_CFNP },
2944f680cc6SAli Bahrami 		{ DF_1_ENDFILTEE,	MSG_DF_1_ENDFILTEE_CFNP },
2954f680cc6SAli Bahrami 		{ DF_1_DISPRELDNE,	MSG_DF_1_DISPRELDNE_CFNP },
2964f680cc6SAli Bahrami 		{ DF_1_DISPRELPND,	MSG_DF_1_DISPRELPND_CFNP },
2974f680cc6SAli Bahrami 		{ DF_1_NODIRECT,	MSG_DF_1_NODIRECT_CFNP },
2984f680cc6SAli Bahrami 		{ DF_1_IGNMULDEF,	MSG_DF_1_IGNMULDEF_CFNP },
2994f680cc6SAli Bahrami 		{ DF_1_NOKSYMS,		MSG_DF_1_NOKSYMS_CFNP },
3004f680cc6SAli Bahrami 		{ DF_1_NOHDR,		MSG_DF_1_NOHDR_CFNP },
3014f680cc6SAli Bahrami 		{ DF_1_EDITED,		MSG_DF_1_EDITED_CFNP },
3024f680cc6SAli Bahrami 		{ DF_1_NORELOC,		MSG_DF_1_NORELOC_CFNP },
3034f680cc6SAli Bahrami 		{ DF_1_SYMINTPOSE,	MSG_DF_1_SYMINTPOSE_CFNP },
3044f680cc6SAli Bahrami 		{ DF_1_GLOBAUDIT,	MSG_DF_1_GLOBAUDIT_CFNP },
3054f680cc6SAli Bahrami 		{ DF_1_SINGLETON,	MSG_DF_1_SINGLETON_CFNP },
3064f680cc6SAli Bahrami 		{ 0,			0 }
3074f680cc6SAli Bahrami 	};
3084f680cc6SAli Bahrami 	static const Val_desc vda_nf[] = {
3094f680cc6SAli Bahrami 		{ DF_1_NOW,		MSG_DF_1_NOW_NF },
3104f680cc6SAli Bahrami 		{ DF_1_GLOBAL,		MSG_DF_1_GLOBAL_NF },
3114f680cc6SAli Bahrami 		{ DF_1_GROUP,		MSG_DF_1_GROUP_NF },
3124f680cc6SAli Bahrami 		{ DF_1_NODELETE,	MSG_DF_1_NODELETE_NF },
3134f680cc6SAli Bahrami 		{ DF_1_LOADFLTR,	MSG_DF_1_LOADFLTR_NF },
3144f680cc6SAli Bahrami 		{ DF_1_INITFIRST,	MSG_DF_1_INITFIRST_NF },
3154f680cc6SAli Bahrami 		{ DF_1_NOOPEN,		MSG_DF_1_NOOPEN_NF },
3164f680cc6SAli Bahrami 		{ DF_1_ORIGIN,		MSG_DF_1_ORIGIN_NF },
3174f680cc6SAli Bahrami 		{ DF_1_DIRECT,		MSG_DF_1_DIRECT_NF },
3184f680cc6SAli Bahrami 		{ DF_1_TRANS,		MSG_DF_1_TRANS_NF },
3194f680cc6SAli Bahrami 		{ DF_1_INTERPOSE,	MSG_DF_1_INTERPOSE_NF },
3204f680cc6SAli Bahrami 		{ DF_1_NODEFLIB,	MSG_DF_1_NODEFLIB_NF },
3214f680cc6SAli Bahrami 		{ DF_1_NODUMP,		MSG_DF_1_NODUMP_NF },
3224f680cc6SAli Bahrami 		{ DF_1_CONFALT,		MSG_DF_1_CONFALT_NF },
3234f680cc6SAli Bahrami 		{ DF_1_ENDFILTEE,	MSG_DF_1_ENDFILTEE_NF },
3244f680cc6SAli Bahrami 		{ DF_1_DISPRELDNE,	MSG_DF_1_DISPRELDNE_NF },
3254f680cc6SAli Bahrami 		{ DF_1_DISPRELPND,	MSG_DF_1_DISPRELPND_NF },
3264f680cc6SAli Bahrami 		{ DF_1_NODIRECT,	MSG_DF_1_NODIRECT_NF },
3274f680cc6SAli Bahrami 		{ DF_1_IGNMULDEF,	MSG_DF_1_IGNMULDEF_NF },
3284f680cc6SAli Bahrami 		{ DF_1_NOKSYMS,		MSG_DF_1_NOKSYMS_NF },
3294f680cc6SAli Bahrami 		{ DF_1_NOHDR,		MSG_DF_1_NOHDR_NF },
3304f680cc6SAli Bahrami 		{ DF_1_EDITED,		MSG_DF_1_EDITED_NF },
3314f680cc6SAli Bahrami 		{ DF_1_NORELOC,		MSG_DF_1_NORELOC_NF },
3324f680cc6SAli Bahrami 		{ DF_1_SYMINTPOSE,	MSG_DF_1_SYMINTPOSE_NF },
3334f680cc6SAli Bahrami 		{ DF_1_GLOBAUDIT,	MSG_DF_1_GLOBAUDIT_NF },
3344f680cc6SAli Bahrami 		{ DF_1_SINGLETON,	MSG_DF_1_SINGLETON_NF },
3355aefb655Srie 		{ 0,			0 }
3365aefb655Srie 	};
3377c478bd9Sstevel@tonic-gate 
3384f680cc6SAli Bahrami 	switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
3394f680cc6SAli Bahrami 	case CONV_FMT_ALT_CF:
3404f680cc6SAli Bahrami 		return (vda_cf);
3414f680cc6SAli Bahrami 	case CONV_FMT_ALT_CFNP:
3424f680cc6SAli Bahrami 		return (vda_cfnp);
3434f680cc6SAli Bahrami 	case CONV_FMT_ALT_NF:
3444f680cc6SAli Bahrami 		return (vda_nf);
3454f680cc6SAli Bahrami 	}
3465aefb655Srie 
3474f680cc6SAli Bahrami 	return (vda_def);
3484f680cc6SAli Bahrami }
3495aefb655Srie 
3504f680cc6SAli Bahrami conv_iter_ret_t
3514f680cc6SAli Bahrami conv_iter_dyn_flag1(Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func,
3524f680cc6SAli Bahrami     void *uvalue)
3534f680cc6SAli Bahrami {
3544f680cc6SAli Bahrami 	return (conv_iter_vd(conv_dyn_flag1_strings(fmt_flags), func, uvalue));
3557c478bd9Sstevel@tonic-gate }
3567c478bd9Sstevel@tonic-gate 
3574f680cc6SAli Bahrami const Val_desc *
3584f680cc6SAli Bahrami conv_dyn_feature1_strings(Conv_fmt_flags_t fmt_flags)
3594f680cc6SAli Bahrami {
360ba4e3c84Sab #define	FEATSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
3614f680cc6SAli Bahrami 	MSG_DTF_1_PARINIT_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
3624f680cc6SAli Bahrami 	MSG_DTF_1_CONFEXP_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
3634f680cc6SAli Bahrami 	CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
364de777a60Sab 
3654f680cc6SAli Bahrami 	/*
3664f680cc6SAli Bahrami 	 * Ensure that Conv_dyn_feature1_buf_t is large enough:
3674f680cc6SAli Bahrami 	 *
3684f680cc6SAli Bahrami 	 * FEATSZ is the real min size of the buffer required by
3694f680cc6SAli Bahrami 	 * conv_dyn_feature1(). However, Conv_dyn_feature1_buf_t uses
3704f680cc6SAli Bahrami 	 * CONV_DYN_FEATURE1_BUFSIZE to set the buffer size. We do things
3714f680cc6SAli Bahrami 	 * this way because the definition of FEATSZ uses information that
3724f680cc6SAli Bahrami 	 * is not available in the environment of other programs that include
3734f680cc6SAli Bahrami 	 * the conv.h header file.
3744f680cc6SAli Bahrami 	 */
3756a074c93Sab #if (CONV_DYN_FEATURE1_BUFSIZE != FEATSZ) && !defined(__lint)
3766a074c93Sab #define	REPORT_BUFSIZE FEATSZ
3776a074c93Sab #include "report_bufsize.h"
3786a074c93Sab #error "CONV_DYN_FEATURE1_BUFSIZE does not match FEATSZ"
379de777a60Sab #endif
3807c478bd9Sstevel@tonic-gate 
3814f680cc6SAli Bahrami 	static const Val_desc vda_cf[] = {
3824f680cc6SAli Bahrami 		{ DTF_1_PARINIT,	MSG_DTF_1_PARINIT_CF },
3834f680cc6SAli Bahrami 		{ DTF_1_CONFEXP,	MSG_DTF_1_CONFEXP_CF },
3844f680cc6SAli Bahrami 		{ 0,			0 }
3854f680cc6SAli Bahrami 	};
3864f680cc6SAli Bahrami 	static const Val_desc vda_cfnp[] = {
3874f680cc6SAli Bahrami 		{ DTF_1_PARINIT,	MSG_DTF_1_PARINIT_CFNP },
3884f680cc6SAli Bahrami 		{ DTF_1_CONFEXP,	MSG_DTF_1_CONFEXP_CFNP },
3894f680cc6SAli Bahrami 		{ 0,			0 }
3904f680cc6SAli Bahrami 	};
3914f680cc6SAli Bahrami 	static const Val_desc vda_nf[] = {
3924f680cc6SAli Bahrami 		{ DTF_1_PARINIT,	MSG_DTF_1_PARINIT_NF },
3934f680cc6SAli Bahrami 		{ DTF_1_CONFEXP,	MSG_DTF_1_CONFEXP_NF },
3945aefb655Srie 		{ 0,			0 }
3955aefb655Srie 	};
3967c478bd9Sstevel@tonic-gate 
3974f680cc6SAli Bahrami 	switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
3984f680cc6SAli Bahrami 	case CONV_FMT_ALT_CF:
3994f680cc6SAli Bahrami 		return (vda_cf);
4004f680cc6SAli Bahrami 	case CONV_FMT_ALT_NF:
4014f680cc6SAli Bahrami 		return (vda_nf);
402ba4e3c84Sab 	}
4037c478bd9Sstevel@tonic-gate 
4044f680cc6SAli Bahrami 	return (vda_cfnp);
4057c478bd9Sstevel@tonic-gate }
4067c478bd9Sstevel@tonic-gate 
4074f680cc6SAli Bahrami conv_iter_ret_t
4084f680cc6SAli Bahrami conv_iter_dyn_feature1(Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func,
4094f680cc6SAli Bahrami     void *uvalue)
4107c478bd9Sstevel@tonic-gate {
4114f680cc6SAli Bahrami 	return (conv_iter_vd(conv_dyn_feature1_strings(fmt_flags),
4124f680cc6SAli Bahrami 	    func, uvalue));
4134f680cc6SAli Bahrami }
414d579eb63Sab 
4154f680cc6SAli Bahrami const conv_ds_t **
4164f680cc6SAli Bahrami conv_dyn_tag_strings(conv_iter_osabi_t osabi, Half mach,
4174f680cc6SAli Bahrami     Conv_fmt_flags_t fmt_flags)
4184f680cc6SAli Bahrami {
419d579eb63Sab 	/*
4204f680cc6SAli Bahrami 	 * Maximum # of items that can be in the returned array. Size this
4214f680cc6SAli Bahrami 	 * by counting the maximum depth in the switch statement that fills
4224f680cc6SAli Bahrami 	 * retarr at the end of this function.
423d579eb63Sab 	 */
4244f680cc6SAli Bahrami #define	MAX_RET	12
425d579eb63Sab 
426d579eb63Sab 	/*
427d579eb63Sab 	 * Generic dynamic tags:
4284f680cc6SAli Bahrami 	 * -	Note hole between DT_FLAGS and DT_PREINIT_ARRAY (tag 32).
4294f680cc6SAli Bahrami 	 *	We use a 0, which is the signal for "not defined".
4304f680cc6SAli Bahrami 	 * -	This range has alternative names for dump, requiring an
4314f680cc6SAli Bahrami 	 *	additional array.
432d579eb63Sab 	 */
4334f680cc6SAli Bahrami 	static const Msg	tags_null_cf[] = {
4344f680cc6SAli Bahrami 		MSG_DT_NULL_CF,			MSG_DT_NEEDED_CF,
4354f680cc6SAli Bahrami 		MSG_DT_PLTRELSZ_CF,		MSG_DT_PLTGOT_CF,
4364f680cc6SAli Bahrami 		MSG_DT_HASH_CF,			MSG_DT_STRTAB_CF,
4374f680cc6SAli Bahrami 		MSG_DT_SYMTAB_CF,		MSG_DT_RELA_CF,
4384f680cc6SAli Bahrami 		MSG_DT_RELASZ_CF,		MSG_DT_RELAENT_CF,
4394f680cc6SAli Bahrami 		MSG_DT_STRSZ_CF,		MSG_DT_SYMENT_CF,
4404f680cc6SAli Bahrami 		MSG_DT_INIT_CF,			MSG_DT_FINI_CF,
4414f680cc6SAli Bahrami 		MSG_DT_SONAME_CF,		MSG_DT_RPATH_CF,
4424f680cc6SAli Bahrami 		MSG_DT_SYMBOLIC_CF,		MSG_DT_REL_CF,
4434f680cc6SAli Bahrami 		MSG_DT_RELSZ_CF,		MSG_DT_RELENT_CF,
4444f680cc6SAli Bahrami 		MSG_DT_PLTREL_CF,		MSG_DT_DEBUG_CF,
4454f680cc6SAli Bahrami 		MSG_DT_TEXTREL_CF,		MSG_DT_JMPREL_CF,
4464f680cc6SAli Bahrami 		MSG_DT_BIND_NOW_CF,		MSG_DT_INIT_ARRAY_CF,
4474f680cc6SAli Bahrami 		MSG_DT_FINI_ARRAY_CF,		MSG_DT_INIT_ARRAYSZ_CF,
4484f680cc6SAli Bahrami 		MSG_DT_FINI_ARRAYSZ_CF,		MSG_DT_RUNPATH_CF,
4494f680cc6SAli Bahrami 		MSG_DT_FLAGS_CF,		0,
4504f680cc6SAli Bahrami 		MSG_DT_PREINIT_ARRAY_CF,	MSG_DT_PREINIT_ARRAYSZ_CF
4514f680cc6SAli Bahrami 	};
4524f680cc6SAli Bahrami 	static const Msg	tags_null_cfnp[] = {
4534f680cc6SAli Bahrami 		MSG_DT_NULL_CFNP,		MSG_DT_NEEDED_CFNP,
4544f680cc6SAli Bahrami 		MSG_DT_PLTRELSZ_CFNP,		MSG_DT_PLTGOT_CFNP,
4554f680cc6SAli Bahrami 		MSG_DT_HASH_CFNP,		MSG_DT_STRTAB_CFNP,
4564f680cc6SAli Bahrami 		MSG_DT_SYMTAB_CFNP,		MSG_DT_RELA_CFNP,
4574f680cc6SAli Bahrami 		MSG_DT_RELASZ_CFNP,		MSG_DT_RELAENT_CFNP,
4584f680cc6SAli Bahrami 		MSG_DT_STRSZ_CFNP,		MSG_DT_SYMENT_CFNP,
4594f680cc6SAli Bahrami 		MSG_DT_INIT_CFNP,		MSG_DT_FINI_CFNP,
4604f680cc6SAli Bahrami 		MSG_DT_SONAME_CFNP,		MSG_DT_RPATH_CFNP,
4614f680cc6SAli Bahrami 		MSG_DT_SYMBOLIC_CFNP,		MSG_DT_REL_CFNP,
4624f680cc6SAli Bahrami 		MSG_DT_RELSZ_CFNP,		MSG_DT_RELENT_CFNP,
4634f680cc6SAli Bahrami 		MSG_DT_PLTREL_CFNP,		MSG_DT_DEBUG_CFNP,
4644f680cc6SAli Bahrami 		MSG_DT_TEXTREL_CFNP,		MSG_DT_JMPREL_CFNP,
4654f680cc6SAli Bahrami 		MSG_DT_BIND_NOW_CFNP,		MSG_DT_INIT_ARRAY_CFNP,
4664f680cc6SAli Bahrami 		MSG_DT_FINI_ARRAY_CFNP,		MSG_DT_INIT_ARRAYSZ_CFNP,
4674f680cc6SAli Bahrami 		MSG_DT_FINI_ARRAYSZ_CFNP,	MSG_DT_RUNPATH_CFNP,
4684f680cc6SAli Bahrami 		MSG_DT_FLAGS_CFNP,		0,
4694f680cc6SAli Bahrami 		MSG_DT_PREINIT_ARRAY_CFNP,	MSG_DT_PREINIT_ARRAYSZ_CFNP
4704f680cc6SAli Bahrami 	};
4714f680cc6SAli Bahrami 	static const Msg	tags_null_nf[] = {
4724f680cc6SAli Bahrami 		MSG_DT_NULL_NF,			MSG_DT_NEEDED_NF,
4734f680cc6SAli Bahrami 		MSG_DT_PLTRELSZ_NF,		MSG_DT_PLTGOT_NF,
4744f680cc6SAli Bahrami 		MSG_DT_HASH_NF,			MSG_DT_STRTAB_NF,
4754f680cc6SAli Bahrami 		MSG_DT_SYMTAB_NF,		MSG_DT_RELA_NF,
4764f680cc6SAli Bahrami 		MSG_DT_RELASZ_NF,		MSG_DT_RELAENT_NF,
4774f680cc6SAli Bahrami 		MSG_DT_STRSZ_NF,		MSG_DT_SYMENT_NF,
4784f680cc6SAli Bahrami 		MSG_DT_INIT_NF,			MSG_DT_FINI_NF,
4794f680cc6SAli Bahrami 		MSG_DT_SONAME_NF,		MSG_DT_RPATH_NF,
4804f680cc6SAli Bahrami 		MSG_DT_SYMBOLIC_NF,		MSG_DT_REL_NF,
4814f680cc6SAli Bahrami 		MSG_DT_RELSZ_NF,		MSG_DT_RELENT_NF,
4824f680cc6SAli Bahrami 		MSG_DT_PLTREL_NF,		MSG_DT_DEBUG_NF,
4834f680cc6SAli Bahrami 		MSG_DT_TEXTREL_NF,		MSG_DT_JMPREL_NF,
4844f680cc6SAli Bahrami 		MSG_DT_BIND_NOW_NF,		MSG_DT_INIT_ARRAY_NF,
4854f680cc6SAli Bahrami 		MSG_DT_FINI_ARRAY_NF,		MSG_DT_INIT_ARRAYSZ_NF,
4864f680cc6SAli Bahrami 		MSG_DT_FINI_ARRAYSZ_NF,		MSG_DT_RUNPATH_NF,
4874f680cc6SAli Bahrami 		MSG_DT_FLAGS_NF,		0,
4884f680cc6SAli Bahrami 		MSG_DT_PREINIT_ARRAY_NF,	MSG_DT_PREINIT_ARRAYSZ_NF
4894f680cc6SAli Bahrami 	};
4904f680cc6SAli Bahrami 	static const Msg	tags_null_dmp[] = {
4914f680cc6SAli Bahrami 		MSG_DT_NULL_CFNP,		MSG_DT_NEEDED_CFNP,
4924f680cc6SAli Bahrami 		MSG_DT_PLTRELSZ_DMP,		MSG_DT_PLTGOT_CFNP,
4934f680cc6SAli Bahrami 		MSG_DT_HASH_CFNP,		MSG_DT_STRTAB_CFNP,
4944f680cc6SAli Bahrami 		MSG_DT_SYMTAB_CFNP,		MSG_DT_RELA_CFNP,
4954f680cc6SAli Bahrami 		MSG_DT_RELASZ_CFNP,		MSG_DT_RELAENT_CFNP,
4964f680cc6SAli Bahrami 		MSG_DT_STRSZ_CFNP,		MSG_DT_SYMENT_CFNP,
4974f680cc6SAli Bahrami 		MSG_DT_INIT_CFNP,		MSG_DT_FINI_CFNP,
4984f680cc6SAli Bahrami 		MSG_DT_SONAME_CFNP,		MSG_DT_RPATH_CFNP,
4994f680cc6SAli Bahrami 		MSG_DT_SYMBOLIC_DMP,		MSG_DT_REL_CFNP,
5004f680cc6SAli Bahrami 		MSG_DT_RELSZ_CFNP,		MSG_DT_RELENT_CFNP,
5014f680cc6SAli Bahrami 		MSG_DT_PLTREL_CFNP,		MSG_DT_DEBUG_CFNP,
5024f680cc6SAli Bahrami 		MSG_DT_TEXTREL_CFNP,		MSG_DT_JMPREL_CFNP,
5034f680cc6SAli Bahrami 		MSG_DT_BIND_NOW_CFNP,		MSG_DT_INIT_ARRAY_CFNP,
5044f680cc6SAli Bahrami 		MSG_DT_FINI_ARRAY_CFNP,		MSG_DT_INIT_ARRAYSZ_CFNP,
5054f680cc6SAli Bahrami 		MSG_DT_FINI_ARRAYSZ_CFNP,	MSG_DT_RUNPATH_CFNP,
5064f680cc6SAli Bahrami 		MSG_DT_FLAGS_CFNP,		0,
5074f680cc6SAli Bahrami 		MSG_DT_PREINIT_ARRAY_CFNP,	MSG_DT_PREINIT_ARRAYSZ_CFNP
508c13de8f6Sab 	};
5094f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_null_cf = {
5104f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_NULL, tags_null_cf) };
5114f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_null_cfnp = {
5124f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_NULL, tags_null_cfnp) };
5134f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_null_nf = {
5144f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_NULL, tags_null_nf) };
5154f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_null_dmp = {
5164f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_NULL, tags_null_dmp) };
5174f680cc6SAli Bahrami 
5184f680cc6SAli Bahrami 	/*
5194f680cc6SAli Bahrami 	 * DT_SPARC_REGISTER was originally assigned 0x7000001. It is processor
5204f680cc6SAli Bahrami 	 * specific, and should have been in the range DT_LOPROC-DT_HIPROC
5214f680cc6SAli Bahrami 	 * instead of here. When the error was fixed,
5224f680cc6SAli Bahrami 	 * DT_DEPRECATED_SPARC_REGISTER was created to maintain backward
5234f680cc6SAli Bahrami 	 * compatability.
5244f680cc6SAli Bahrami 	 */
5254f680cc6SAli Bahrami 	static const Msg	tags_sdreg_cf[] = {
5264f680cc6SAli Bahrami 	    MSG_DT_DEP_SPARC_REG_CF };
5274f680cc6SAli Bahrami 	static const Msg	tags_sdreg_cfnp[] = {
5284f680cc6SAli Bahrami 	    MSG_DT_DEP_SPARC_REG_CFNP };
5294f680cc6SAli Bahrami 	static const Msg	tags_sdreg_nf[] = {
5304f680cc6SAli Bahrami 	    MSG_DT_DEP_SPARC_REG_NF };
5314f680cc6SAli Bahrami 
5324f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sdreg_cf = {
5334f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_DEPRECATED_SPARC_REGISTER, tags_sdreg_cf) };
5344f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sdreg_cfnp = {
5354f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_DEPRECATED_SPARC_REGISTER, tags_sdreg_cfnp) };
5364f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sdreg_nf = {
5374f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_DEPRECATED_SPARC_REGISTER, tags_sdreg_nf) };
5384f680cc6SAli Bahrami 
5397c478bd9Sstevel@tonic-gate 
540d579eb63Sab 	/*
5414f680cc6SAli Bahrami 	 * SUNW: DT_LOOS -> DT_HIOS range. Note holes between DT_SUNW_TLSSORTSZ,
542ba2be530Sab 	 * DT_SUNW_STRPAD, and DT_SUNW_LDMACH. We handle the outliers
543ba2be530Sab 	 * separately below as single values.
544d579eb63Sab 	 */
5454f680cc6SAli Bahrami 	static const Msg	tags_sunw_auxiliary_cf[] = {
5464f680cc6SAli Bahrami 		MSG_DT_SUNW_AUXILIARY_CF,	MSG_DT_SUNW_RTLDINF_CF,
5474f680cc6SAli Bahrami 		MSG_DT_SUNW_FILTER_CF,		MSG_DT_SUNW_CAP_CF,
5484f680cc6SAli Bahrami 		MSG_DT_SUNW_SYMTAB_CF,		MSG_DT_SUNW_SYMSZ_CF,
5494f680cc6SAli Bahrami 		MSG_DT_SUNW_SORTENT_CF,		MSG_DT_SUNW_SYMSORT_CF,
5504f680cc6SAli Bahrami 		MSG_DT_SUNW_SYMSORTSZ_CF,	MSG_DT_SUNW_TLSSORT_CF,
551*08278a5eSRod Evans 		MSG_DT_SUNW_TLSSORTSZ_CF,	MSG_DT_SUNW_CAPINFO_CF,
552*08278a5eSRod Evans 		MSG_DT_SUNW_STRPAD_CF,		MSG_DT_SUNW_CAPCHAIN_CF,
553*08278a5eSRod Evans 		MSG_DT_SUNW_LDMACH_CF,		0,
554*08278a5eSRod Evans 		MSG_DT_SUNW_CAPCHAINENT_CF,	0,
555*08278a5eSRod Evans 		MSG_DT_SUNW_CAPCHAINSZ_CF
5564f680cc6SAli Bahrami 	};
5574f680cc6SAli Bahrami 	static const Msg	tags_sunw_auxiliary_cfnp[] = {
5584f680cc6SAli Bahrami 		MSG_DT_SUNW_AUXILIARY_CFNP,	MSG_DT_SUNW_RTLDINF_CFNP,
5594f680cc6SAli Bahrami 		MSG_DT_SUNW_FILTER_CFNP,	MSG_DT_SUNW_CAP_CFNP,
5604f680cc6SAli Bahrami 		MSG_DT_SUNW_SYMTAB_CFNP,	MSG_DT_SUNW_SYMSZ_CFNP,
5614f680cc6SAli Bahrami 		MSG_DT_SUNW_SORTENT_CFNP,	MSG_DT_SUNW_SYMSORT_CFNP,
5624f680cc6SAli Bahrami 		MSG_DT_SUNW_SYMSORTSZ_CFNP,	MSG_DT_SUNW_TLSSORT_CFNP,
563*08278a5eSRod Evans 		MSG_DT_SUNW_TLSSORTSZ_CFNP,	MSG_DT_SUNW_CAPINFO_CFNP,
564*08278a5eSRod Evans 		MSG_DT_SUNW_STRPAD_CFNP,	MSG_DT_SUNW_CAPCHAIN_CFNP,
565*08278a5eSRod Evans 		MSG_DT_SUNW_LDMACH_CFNP,	0,
566*08278a5eSRod Evans 		MSG_DT_SUNW_CAPCHAINENT_CFNP,	0,
567*08278a5eSRod Evans 		MSG_DT_SUNW_CAPCHAINSZ_CFNP
5684f680cc6SAli Bahrami 	};
5694f680cc6SAli Bahrami 	static const Msg	tags_sunw_auxiliary_nf[] = {
5704f680cc6SAli Bahrami 		MSG_DT_SUNW_AUXILIARY_NF,	MSG_DT_SUNW_RTLDINF_NF,
5714f680cc6SAli Bahrami 		MSG_DT_SUNW_FILTER_NF,		MSG_DT_SUNW_CAP_NF,
5724f680cc6SAli Bahrami 		MSG_DT_SUNW_SYMTAB_NF,		MSG_DT_SUNW_SYMSZ_NF,
5734f680cc6SAli Bahrami 		MSG_DT_SUNW_SORTENT_NF,		MSG_DT_SUNW_SYMSORT_NF,
5744f680cc6SAli Bahrami 		MSG_DT_SUNW_SYMSORTSZ_NF,	MSG_DT_SUNW_TLSSORT_NF,
575*08278a5eSRod Evans 		MSG_DT_SUNW_TLSSORTSZ_NF,	MSG_DT_SUNW_CAPINFO_NF,
576*08278a5eSRod Evans 		MSG_DT_SUNW_STRPAD_NF,		MSG_DT_SUNW_CAPCHAIN_NF,
577*08278a5eSRod Evans 		MSG_DT_SUNW_LDMACH_NF,		0,
578*08278a5eSRod Evans 		MSG_DT_SUNW_CAPCHAINENT_NF,	0,
579*08278a5eSRod Evans 		MSG_DT_SUNW_CAPCHAINSZ_NF
5804f680cc6SAli Bahrami 	};
5814f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sunw_auxiliary_cf = {
5824f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_SUNW_AUXILIARY, tags_sunw_auxiliary_cf) };
5834f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sunw_auxiliary_cfnp = {
5844f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_SUNW_AUXILIARY, tags_sunw_auxiliary_cfnp) };
5854f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sunw_auxiliary_nf = {
5864f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_SUNW_AUXILIARY, tags_sunw_auxiliary_nf) };
5874f680cc6SAli Bahrami 
5884f680cc6SAli Bahrami 	/*
5894f680cc6SAli Bahrami 	 * GNU: (In DT_VALRNGLO section) DT_GNU_PRELINKED - DT_GNU_LIBLISTSZ
5904f680cc6SAli Bahrami 	 */
5914f680cc6SAli Bahrami 	static const Msg	tags_gnu_prelinked_cf[] = {
5924f680cc6SAli Bahrami 		MSG_DT_GNU_PRELINKED_CF,	MSG_DT_GNU_CONFLICTSZ_CF,
5934f680cc6SAli Bahrami 		MSG_DT_GNU_LIBLISTSZ_CF
5944f680cc6SAli Bahrami 	};
5954f680cc6SAli Bahrami 	static const Msg	tags_gnu_prelinked_cfnp[] = {
5964f680cc6SAli Bahrami 		MSG_DT_GNU_PRELINKED_CFNP,	MSG_DT_GNU_CONFLICTSZ_CFNP,
5974f680cc6SAli Bahrami 		MSG_DT_GNU_LIBLISTSZ_CFNP
5984f680cc6SAli Bahrami 	};
5994f680cc6SAli Bahrami 	static const Msg	tags_gnu_prelinked_nf[] = {
6004f680cc6SAli Bahrami 		MSG_DT_GNU_PRELINKED_NF,	MSG_DT_GNU_CONFLICTSZ_NF,
6014f680cc6SAli Bahrami 		MSG_DT_GNU_LIBLISTSZ_NF
602d579eb63Sab 	};
6034f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_gnu_prelinked_cf = {
6044f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_GNU_PRELINKED, tags_gnu_prelinked_cf) };
6054f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_gnu_prelinked_cfnp = {
6064f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_GNU_PRELINKED, tags_gnu_prelinked_cfnp) };
6074f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_gnu_prelinked_nf = {
6084f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_GNU_PRELINKED, tags_gnu_prelinked_nf) };
609d579eb63Sab 
610d579eb63Sab 	/*
611d579eb63Sab 	 * SUNW: DT_VALRNGLO - DT_VALRNGHI range.
612d579eb63Sab 	 */
6134f680cc6SAli Bahrami 	static const Msg	tags_checksum_cf[] = {
6144f680cc6SAli Bahrami 		MSG_DT_CHECKSUM_CF,		MSG_DT_PLTPADSZ_CF,
6154f680cc6SAli Bahrami 		MSG_DT_MOVEENT_CF,		MSG_DT_MOVESZ_CF,
6164f680cc6SAli Bahrami 		MSG_DT_FEATURE_1_CF,		MSG_DT_POSFLAG_1_CF,
6174f680cc6SAli Bahrami 		MSG_DT_SYMINSZ_CF,		MSG_DT_SYMINENT_CF
618d579eb63Sab 	};
6194f680cc6SAli Bahrami 	static const Msg	tags_checksum_cfnp[] = {
6204f680cc6SAli Bahrami 		MSG_DT_CHECKSUM_CFNP,		MSG_DT_PLTPADSZ_CFNP,
6214f680cc6SAli Bahrami 		MSG_DT_MOVEENT_CFNP,		MSG_DT_MOVESZ_CFNP,
6224f680cc6SAli Bahrami 		MSG_DT_FEATURE_1_CFNP,		MSG_DT_POSFLAG_1_CFNP,
6234f680cc6SAli Bahrami 		MSG_DT_SYMINSZ_CFNP,		MSG_DT_SYMINENT_CFNP
6244f680cc6SAli Bahrami 	};
6254f680cc6SAli Bahrami 	static const Msg	tags_checksum_nf[] = {
6264f680cc6SAli Bahrami 		MSG_DT_CHECKSUM_NF,		MSG_DT_PLTPADSZ_NF,
6274f680cc6SAli Bahrami 		MSG_DT_MOVEENT_NF,		MSG_DT_MOVESZ_NF,
6284f680cc6SAli Bahrami 		MSG_DT_FEATURE_1_NF,		MSG_DT_POSFLAG_1_NF,
6294f680cc6SAli Bahrami 		MSG_DT_SYMINSZ_NF,		MSG_DT_SYMINENT_NF
6304f680cc6SAli Bahrami 	};
6314f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_checksum_cf = {
6324f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_CHECKSUM, tags_checksum_cf) };
6334f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_checksum_cfnp = {
6344f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_CHECKSUM, tags_checksum_cfnp) };
6354f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_checksum_nf = {
6364f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_CHECKSUM, tags_checksum_nf) };
6374f680cc6SAli Bahrami 
6384f680cc6SAli Bahrami 	/*
6394f680cc6SAli Bahrami 	 * GNU: (In DT_ADDRRNGLO section) DT_GNU_HASH - DT_GNU_LIBLIST
6404f680cc6SAli Bahrami 	 */
6414f680cc6SAli Bahrami 	static const Msg	tags_gnu_hash_cf[] = {
6424f680cc6SAli Bahrami 		MSG_DT_GNU_HASH_CF,		MSG_DT_TLSDESC_PLT_CF,
6434f680cc6SAli Bahrami 		MSG_DT_TLSDESC_GOT_CF,		MSG_DT_GNU_CONFLICT_CF,
6444f680cc6SAli Bahrami 		MSG_DT_GNU_LIBLIST_CF
6454f680cc6SAli Bahrami 	};
6464f680cc6SAli Bahrami 	static const Msg	tags_gnu_hash_cfnp[] = {
6474f680cc6SAli Bahrami 		MSG_DT_GNU_HASH_CFNP,		MSG_DT_TLSDESC_PLT_CFNP,
6484f680cc6SAli Bahrami 		MSG_DT_TLSDESC_GOT_CFNP,	MSG_DT_GNU_CONFLICT_CFNP,
6494f680cc6SAli Bahrami 		MSG_DT_GNU_LIBLIST_CFNP
6504f680cc6SAli Bahrami 	};
6514f680cc6SAli Bahrami 	static const Msg	tags_gnu_hash_nf[] = {
6524f680cc6SAli Bahrami 		MSG_DT_GNU_HASH_NF,		MSG_DT_TLSDESC_PLT_NF,
6534f680cc6SAli Bahrami 		MSG_DT_TLSDESC_GOT_NF,		MSG_DT_GNU_CONFLICT_NF,
6544f680cc6SAli Bahrami 		MSG_DT_GNU_LIBLIST_NF
6554f680cc6SAli Bahrami 	};
6564f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_gnu_hash_cf = {
6574f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_GNU_HASH, tags_gnu_hash_cf) };
6584f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_gnu_hash_cfnp = {
6594f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_GNU_HASH, tags_gnu_hash_cfnp) };
6604f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_gnu_hash_nf = {
6614f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_GNU_HASH, tags_gnu_hash_nf) };
662d579eb63Sab 
663d579eb63Sab 	/*
664d579eb63Sab 	 * SUNW: DT_ADDRRNGLO - DT_ADDRRNGHI range.
665d579eb63Sab 	 */
6664f680cc6SAli Bahrami 	static const Msg	tags_config_cf[] = {
6674f680cc6SAli Bahrami 		MSG_DT_CONFIG_CF,		MSG_DT_DEPAUDIT_CF,
6684f680cc6SAli Bahrami 		MSG_DT_AUDIT_CF,		MSG_DT_PLTPAD_CF,
6694f680cc6SAli Bahrami 		MSG_DT_MOVETAB_CF,		MSG_DT_SYMINFO_CF
6704f680cc6SAli Bahrami 	};
6714f680cc6SAli Bahrami 	static const Msg	tags_config_cfnp[] = {
6724f680cc6SAli Bahrami 		MSG_DT_CONFIG_CFNP,		MSG_DT_DEPAUDIT_CFNP,
6734f680cc6SAli Bahrami 		MSG_DT_AUDIT_CFNP,		MSG_DT_PLTPAD_CFNP,
6744f680cc6SAli Bahrami 		MSG_DT_MOVETAB_CFNP,		MSG_DT_SYMINFO_CFNP
675d579eb63Sab 	};
6764f680cc6SAli Bahrami 	static const Msg	tags_config_nf[] = {
6774f680cc6SAli Bahrami 		MSG_DT_CONFIG_NF,		MSG_DT_DEPAUDIT_NF,
6784f680cc6SAli Bahrami 		MSG_DT_AUDIT_NF,		MSG_DT_PLTPAD_NF,
6794f680cc6SAli Bahrami 		MSG_DT_MOVETAB_NF,		MSG_DT_SYMINFO_NF
6804f680cc6SAli Bahrami 	};
6814f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_config_cf = {
6824f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_CONFIG, tags_config_cf) };
6834f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_config_cfnp = {
6844f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_CONFIG, tags_config_cfnp) };
6854f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_config_nf = {
6864f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_CONFIG, tags_config_nf) };
687d579eb63Sab 
688d579eb63Sab 	/*
689d579eb63Sab 	 * SUNW: generic range. Note hole between DT_VERSYM and DT_RELACOUNT.
690d579eb63Sab 	 */
6914f680cc6SAli Bahrami 	static const Msg	tags_versym_cf[] = { MSG_DT_VERSYM_CF };
6924f680cc6SAli Bahrami 	static const Msg	tags_versym_cfnp[] = { MSG_DT_VERSYM_CFNP };
6934f680cc6SAli Bahrami 	static const Msg	tags_versym_nf[] = { MSG_DT_VERSYM_NF };
6944f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_versym_cf = {
6954f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_VERSYM, tags_versym_cf) };
6964f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_versym_cfnp = {
6974f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_VERSYM, tags_versym_cfnp) };
6984f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_versym_nf = {
6994f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_VERSYM, tags_versym_nf) };
7004f680cc6SAli Bahrami 
7014f680cc6SAli Bahrami 	static const Msg	tags_relacount_cf[] = {
7024f680cc6SAli Bahrami 		MSG_DT_RELACOUNT_CF,		MSG_DT_RELCOUNT_CF,
7034f680cc6SAli Bahrami 		MSG_DT_FLAGS_1_CF,		MSG_DT_VERDEF_CF,
7044f680cc6SAli Bahrami 		MSG_DT_VERDEFNUM_CF,		MSG_DT_VERNEED_CF,
7054f680cc6SAli Bahrami 		MSG_DT_VERNEEDNUM_CF
7064f680cc6SAli Bahrami 	};
7074f680cc6SAli Bahrami 	static const Msg	tags_relacount_cfnp[] = {
7084f680cc6SAli Bahrami 		MSG_DT_RELACOUNT_CFNP,		MSG_DT_RELCOUNT_CFNP,
7094f680cc6SAli Bahrami 		MSG_DT_FLAGS_1_CFNP,		MSG_DT_VERDEF_CFNP,
7104f680cc6SAli Bahrami 		MSG_DT_VERDEFNUM_CFNP,		MSG_DT_VERNEED_CFNP,
7114f680cc6SAli Bahrami 		MSG_DT_VERNEEDNUM_CFNP
7124f680cc6SAli Bahrami 	};
7134f680cc6SAli Bahrami 	static const Msg	tags_relacount_nf[] = {
7144f680cc6SAli Bahrami 		MSG_DT_RELACOUNT_NF,		MSG_DT_RELCOUNT_NF,
7154f680cc6SAli Bahrami 		MSG_DT_FLAGS_1_NF,		MSG_DT_VERDEF_NF,
7164f680cc6SAli Bahrami 		MSG_DT_VERDEFNUM_NF,		MSG_DT_VERNEED_NF,
7174f680cc6SAli Bahrami 		MSG_DT_VERNEEDNUM_NF
718d579eb63Sab 	};
7194f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_relacount_cf = {
7204f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_RELACOUNT, tags_relacount_cf) };
7214f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_relacount_cfnp = {
7224f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_RELACOUNT, tags_relacount_cfnp) };
7234f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_relacount_nf = {
7244f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_RELACOUNT, tags_relacount_nf) };
725d579eb63Sab 
726d579eb63Sab 	/*
7274f680cc6SAli Bahrami 	 * DT_LOPROC - DT_HIPROC range: solaris/sparc-only
728d579eb63Sab 	 */
7294f680cc6SAli Bahrami 	static const Msg tags_sparc_reg_cf[] = { MSG_DT_SPARC_REGISTER_CF };
7304f680cc6SAli Bahrami 	static const Msg tags_sparc_reg_cfnp[] = { MSG_DT_SPARC_REGISTER_CFNP };
7314f680cc6SAli Bahrami 	static const Msg tags_sparc_reg_nf[] = { MSG_DT_SPARC_REGISTER_NF };
7324f680cc6SAli Bahrami 	static const Msg tags_sparc_reg_dmp[] = { MSG_DT_SPARC_REGISTER_DMP };
7334f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sparc_reg_cf = {
7344f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_cf) };
7354f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sparc_reg_cfnp = {
7364f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_cfnp) };
7374f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sparc_reg_nf = {
7384f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_nf) };
7394f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sparc_reg_dmp = {
7404f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_dmp) };
7414f680cc6SAli Bahrami 
7424f680cc6SAli Bahrami 	/*
7434f680cc6SAli Bahrami 	 * DT_LOPROC - DT_HIPROC range: Solaris osabi, all hardware
7444f680cc6SAli Bahrami 	 */
7454f680cc6SAli Bahrami 	static const Msg	tags_auxiliary_cf[] = {
7464f680cc6SAli Bahrami 		MSG_DT_AUXILIARY_CF,	MSG_DT_USED_CF,
7474f680cc6SAli Bahrami 		MSG_DT_FILTER_CF
7484f680cc6SAli Bahrami 	};
7494f680cc6SAli Bahrami 	static const Msg	tags_auxiliary_cfnp[] = {
7504f680cc6SAli Bahrami 		MSG_DT_AUXILIARY_CFNP,	MSG_DT_USED_CFNP,
7514f680cc6SAli Bahrami 		MSG_DT_FILTER_CFNP
752d579eb63Sab 	};
7534f680cc6SAli Bahrami 	static const Msg	tags_auxiliary_nf[] = {
7544f680cc6SAli Bahrami 		MSG_DT_AUXILIARY_NF,	MSG_DT_USED_NF,
7554f680cc6SAli Bahrami 		MSG_DT_FILTER_NF
7564f680cc6SAli Bahrami 	};
7574f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_auxiliary_cf = {
7584f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_AUXILIARY, tags_auxiliary_cf) };
7594f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_auxiliary_cfnp = {
7604f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_AUXILIARY, tags_auxiliary_cfnp) };
7614f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_auxiliary_nf = {
7624f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_AUXILIARY, tags_auxiliary_nf) };
763d579eb63Sab 
764d579eb63Sab 
7654f680cc6SAli Bahrami 	static const conv_ds_t	*retarr[MAX_RET];
766d579eb63Sab 
7674f680cc6SAli Bahrami 	int	ndx = 0;
7684f680cc6SAli Bahrami 	int	fmt_osabi = CONV_TYPE_FMT_ALT(fmt_flags);
7694f680cc6SAli Bahrami 	int	mach_sparc, osabi_solaris, osabi_linux;
770d579eb63Sab 
7714f680cc6SAli Bahrami 
7724f680cc6SAli Bahrami 
7734f680cc6SAli Bahrami 	osabi_solaris = (osabi == ELFOSABI_NONE) ||
7744f680cc6SAli Bahrami 	    (osabi == ELFOSABI_SOLARIS) || (osabi == CONV_OSABI_ALL);
7754f680cc6SAli Bahrami 	osabi_linux = (osabi == ELFOSABI_LINUX) || (osabi == CONV_OSABI_ALL);
7764f680cc6SAli Bahrami 	mach_sparc = (mach == EM_SPARC) || (mach == EM_SPARCV9) ||
7774f680cc6SAli Bahrami 	    (mach == EM_SPARC32PLUS) || (mach == CONV_MACH_ALL);
778d579eb63Sab 
779d579eb63Sab 	/*
7804f680cc6SAli Bahrami 	 * Fill in retarr with the descriptors for the messages that
7814f680cc6SAli Bahrami 	 * apply to the current osabi. Note that we order these items such
7824f680cc6SAli Bahrami 	 * that the more common are placed at the beginning, and the less
7834f680cc6SAli Bahrami 	 * likely at the end. This should speed the common case.
7844f680cc6SAli Bahrami 	 *
7854f680cc6SAli Bahrami 	 * Note that the CFNP and DMP styles are very similar, so they
7864f680cc6SAli Bahrami 	 * are combined in 'default', and fmt_osabi is consulted when there
7874f680cc6SAli Bahrami 	 * are differences.
788d579eb63Sab 	 */
7894f680cc6SAli Bahrami 	switch (fmt_osabi) {
7904f680cc6SAli Bahrami 	case CONV_FMT_ALT_CF:
7914f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_null_cf);
7924f680cc6SAli Bahrami 		if (osabi_solaris)
7934f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_sunw_auxiliary_cf);
7944f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_checksum_cf);
7954f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_config_cf);
7964f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_versym_cf);
7974f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_relacount_cf);
7984f680cc6SAli Bahrami 		if (osabi_solaris) {
7994f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_auxiliary_cf);
8004f680cc6SAli Bahrami 			if (mach_sparc) {
8014f680cc6SAli Bahrami 				retarr[ndx++] = CONV_DS_ADDR(ds_sparc_reg_cf);
8024f680cc6SAli Bahrami 				retarr[ndx++] = CONV_DS_ADDR(ds_sdreg_cf);
8034f680cc6SAli Bahrami 			}
8044f680cc6SAli Bahrami 		}
8054f680cc6SAli Bahrami 		if (osabi_linux) {
8064f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_prelinked_cf);
8074f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_hash_cf);
8084f680cc6SAli Bahrami 		}
8094f680cc6SAli Bahrami 		break;
8104f680cc6SAli Bahrami 
8114f680cc6SAli Bahrami 	case CONV_FMT_ALT_NF:
8124f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_null_nf);
8134f680cc6SAli Bahrami 		if (osabi_solaris)
8144f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_sunw_auxiliary_nf);
8154f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_checksum_nf);
8164f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_config_nf);
8174f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_versym_nf);
8184f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_relacount_nf);
8194f680cc6SAli Bahrami 		if (osabi_solaris) {
8204f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_auxiliary_nf);
8214f680cc6SAli Bahrami 			if (mach_sparc) {
8224f680cc6SAli Bahrami 				retarr[ndx++] = CONV_DS_ADDR(ds_sparc_reg_nf);
8234f680cc6SAli Bahrami 				retarr[ndx++] = CONV_DS_ADDR(ds_sdreg_nf);
8244f680cc6SAli Bahrami 			}
8254f680cc6SAli Bahrami 		}
8264f680cc6SAli Bahrami 		if (osabi_linux) {
8274f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_prelinked_nf);
8284f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_hash_nf);
8294f680cc6SAli Bahrami 		}
8304f680cc6SAli Bahrami 		break;
8314f680cc6SAli Bahrami 	default:
8324f680cc6SAli Bahrami 		/*
8334f680cc6SAli Bahrami 		 * The default style for the generic range is CFNP,
8344f680cc6SAli Bahrami 		 * while dump has a couple of different strings.
8354f680cc6SAli Bahrami 		 */
8364f680cc6SAli Bahrami 
8374f680cc6SAli Bahrami 		retarr[ndx++] = (fmt_osabi == CONV_FMT_ALT_DUMP) ?
8384f680cc6SAli Bahrami 		    CONV_DS_ADDR(ds_null_dmp) : CONV_DS_ADDR(ds_null_cfnp);
8394f680cc6SAli Bahrami 		if (osabi_solaris)
8404f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_sunw_auxiliary_cfnp);
8414f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_checksum_cfnp);
8424f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_config_cfnp);
8434f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_versym_cfnp);
8444f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_relacount_cfnp);
8454f680cc6SAli Bahrami 		if (osabi_solaris) {
8464f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_auxiliary_cfnp);
8474f680cc6SAli Bahrami 			if (mach_sparc) {
8484f680cc6SAli Bahrami 				/*
8494f680cc6SAli Bahrami 				 * The default style for DT_SPARC_REGISTER
8504f680cc6SAli Bahrami 				 * is the dump style, which omits the 'SPARC_'.
8514f680cc6SAli Bahrami 				 * CFNP keeps the prefix.
8524f680cc6SAli Bahrami 				 */
8534f680cc6SAli Bahrami 				retarr[ndx++] =
8544f680cc6SAli Bahrami 				    (fmt_osabi == CONV_FMT_ALT_CFNP) ?
8554f680cc6SAli Bahrami 				    CONV_DS_ADDR(ds_sparc_reg_cfnp) :
8564f680cc6SAli Bahrami 				    CONV_DS_ADDR(ds_sparc_reg_dmp);
8574f680cc6SAli Bahrami 				retarr[ndx++] = CONV_DS_ADDR(ds_sdreg_cfnp);
8584f680cc6SAli Bahrami 			}
8594f680cc6SAli Bahrami 		}
8604f680cc6SAli Bahrami 		if (osabi_linux) {
8614f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_prelinked_cfnp);
8624f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_hash_cfnp);
8634f680cc6SAli Bahrami 		}
8644f680cc6SAli Bahrami 		break;
8654f680cc6SAli Bahrami 	}
866d579eb63Sab 
8674f680cc6SAli Bahrami 	retarr[ndx++] = NULL;
8684f680cc6SAli Bahrami 	assert(ndx <= MAX_RET);
8694f680cc6SAli Bahrami 	return (retarr);
8704f680cc6SAli Bahrami }
871d579eb63Sab 
8724f680cc6SAli Bahrami conv_iter_ret_t
8734f680cc6SAli Bahrami conv_iter_dyn_tag(conv_iter_osabi_t osabi, Half mach,
8744f680cc6SAli Bahrami     Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func, void *uvalue)
8754f680cc6SAli Bahrami {
8764f680cc6SAli Bahrami 	return (conv_iter_ds(osabi, mach,
8774f680cc6SAli Bahrami 	    conv_dyn_tag_strings(osabi, mach, fmt_flags), func, uvalue));
8787c478bd9Sstevel@tonic-gate }
879dffec89cSrie 
8804f680cc6SAli Bahrami 
8814f680cc6SAli Bahrami #define	BINDTSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE +			\
882ba4e3c84Sab 		MSG_BND_NEEDED_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
883ba4e3c84Sab 		MSG_BND_REFER_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
884ba4e3c84Sab 		MSG_BND_FILTER_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
885de777a60Sab 		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
886de777a60Sab 
887de777a60Sab /*
888de777a60Sab  * Ensure that Conv_bnd_type_buf_t is large enough:
889de777a60Sab  *
890de777a60Sab  * BINDTSZ is the real minimum size of the buffer required by conv_bnd_type().
891de777a60Sab  * However, Conv_bnd_type_buf_t uses CONV_BND_TYPE_BUFSIZE to set the
892de777a60Sab  * buffer size. We do things this way because the definition of BINDTSZ uses
893de777a60Sab  * information that is not available in the environment of other programs
894de777a60Sab  * that include the conv.h header file.
895de777a60Sab  */
8966a074c93Sab #if (CONV_BND_TYPE_BUFSIZE != BINDTSZ) && !defined(__lint)
8976a074c93Sab #define	REPORT_BUFSIZE BINDTSZ
8986a074c93Sab #include "report_bufsize.h"
8996a074c93Sab #error "CONV_BND_TYPE_BUFSIZE does not match BINDTSZ"
900de777a60Sab #endif
901dffec89cSrie 
902dffec89cSrie const char *
903de777a60Sab conv_bnd_type(uint_t flags, Conv_bnd_type_buf_t *bnd_type_buf)
904dffec89cSrie {
9054f680cc6SAli Bahrami 	static const Val_desc vda[] = {
9064f680cc6SAli Bahrami 		{ BND_NEEDED,		MSG_BND_NEEDED },
9074f680cc6SAli Bahrami 		{ BND_REFER,		MSG_BND_REFER },
9084f680cc6SAli Bahrami 		{ BND_FILTER,		MSG_BND_FILTER },
9095aefb655Srie 		{ 0,			0 }
9105aefb655Srie 	};
911de777a60Sab 	static CONV_EXPN_FIELD_ARG conv_arg = {
9124f680cc6SAli Bahrami 	    NULL, sizeof (bnd_type_buf->buf) };
913dffec89cSrie 
9145aefb655Srie 	if (flags == 0)
915dffec89cSrie 		return (MSG_ORIG(MSG_STR_EMPTY));
9165aefb655Srie 
917de777a60Sab 	conv_arg.buf = bnd_type_buf->buf;
918ba4e3c84Sab 	conv_arg.oflags = conv_arg.rflags = flags;
9194f680cc6SAli Bahrami 	(void) conv_expn_field(&conv_arg, vda, 0);
9205aefb655Srie 
921de777a60Sab 	return ((const char *)bnd_type_buf->buf);
922dffec89cSrie }
923dffec89cSrie 
92410a4fa49Srie /*
92510a4fa49Srie  * Note, conv_bnd_obj() is called with either:
92610a4fa49Srie  *	LML_FLG_OBJADDED (possibly with LML_FLG_OBJREEVAL added), or
92710a4fa49Srie  *	LML_FLG_OBJDELETED, or
92810a4fa49Srie  *	LML_FLG_ATEXIT.
92910a4fa49Srie  */
930ba4e3c84Sab #define	BINDOSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
931ba4e3c84Sab 		MSG_BND_ADDED_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
932ba4e3c84Sab 		MSG_BND_REEVAL_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
933de777a60Sab 		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
934de777a60Sab 
935de777a60Sab /*
936de777a60Sab  * Ensure that Conv_bnd_obj_buf_t is large enough:
937de777a60Sab  *
938de777a60Sab  * BINDOSZ is the real minimum size of the buffer required by conv_bnd_obj().
939de777a60Sab  * However, Conv_bnd_obj_buf_t uses CONV_BND_OBJ_BUFSIZE to set the
940de777a60Sab  * buffer size. We do things this way because the definition of BINDOSZ uses
941de777a60Sab  * information that is not available in the environment of other programs
942de777a60Sab  * that include the conv.h header file.
943de777a60Sab  */
9446a074c93Sab #if (CONV_BND_OBJ_BUFSIZE != BINDOSZ) && !defined(__lint)
9456a074c93Sab #define	REPORT_BUFSIZE BINDOSZ
9466a074c93Sab #include "report_bufsize.h"
9476a074c93Sab #error "CONV_BND_OBJ_BUFSIZE does not match BINDOSZ"
948de777a60Sab #endif
949dffec89cSrie 
950dffec89cSrie const char *
951de777a60Sab conv_bnd_obj(uint_t flags, Conv_bnd_obj_buf_t *bnd_obj_buf)
952dffec89cSrie {
9534f680cc6SAli Bahrami 	static const Val_desc vda[] = {
9544f680cc6SAli Bahrami 		{ LML_FLG_OBJADDED,	MSG_BND_ADDED },
9554f680cc6SAli Bahrami 		{ LML_FLG_OBJREEVAL,	MSG_BND_REEVAL },
9564f680cc6SAli Bahrami 		{ LML_FLG_OBJDELETED,	MSG_BND_DELETED },
9574f680cc6SAli Bahrami 		{ LML_FLG_ATEXIT,	MSG_BND_ATEXIT },
9585aefb655Srie 		{ 0,			0 }
9595aefb655Srie 	};
960de777a60Sab 	static CONV_EXPN_FIELD_ARG conv_arg = {
9614f680cc6SAli Bahrami 	    NULL, sizeof (bnd_obj_buf->buf) };
9625aefb655Srie 
96310a4fa49Srie 	if ((flags & (LML_FLG_OBJADDED | LML_FLG_OBJREEVAL |
96410a4fa49Srie 	    LML_FLG_OBJDELETED | LML_FLG_ATEXIT)) == 0)
96510a4fa49Srie 		return (MSG_ORIG(MSG_BND_REVISIT));
966dffec89cSrie 
967dffec89cSrie 	/*
9685aefb655Srie 	 * Note, we're not worried about unknown flags for this family, only
969ba4e3c84Sab 	 * the selected flags are of interest, so we leave conv_arg.rflags
970ba4e3c84Sab 	 * set to 0.
971dffec89cSrie 	 */
972de777a60Sab 	conv_arg.buf = bnd_obj_buf->buf;
973ba4e3c84Sab 	conv_arg.oflags = flags;
9744f680cc6SAli Bahrami 	(void) conv_expn_field(&conv_arg, vda, 0);
9755aefb655Srie 
976de777a60Sab 	return ((const char *)bnd_obj_buf->buf);
977dffec89cSrie }
978