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*f441771bSRod Evans  * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate /*
277c478bd9Sstevel@tonic-gate  * String conversion routine for .dynamic tag entries.
287c478bd9Sstevel@tonic-gate  */
297c478bd9Sstevel@tonic-gate #include	<stdio.h>
307c478bd9Sstevel@tonic-gate #include	<string.h>
317c478bd9Sstevel@tonic-gate #include	<sys/elf_SPARC.h>
32dffec89cSrie #include	"rtld.h"
337c478bd9Sstevel@tonic-gate #include	"_conv.h"
347c478bd9Sstevel@tonic-gate #include	"dynamic_msg.h"
357c478bd9Sstevel@tonic-gate 
36d579eb63Sab 
37d579eb63Sab 
384f680cc6SAli Bahrami const Val_desc *
394f680cc6SAli Bahrami conv_dyn_posflag1_strings(Conv_fmt_flags_t fmt_flags)
404f680cc6SAli Bahrami {
41ba4e3c84Sab #define	POSSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
424f680cc6SAli Bahrami 	MSG_DF_P1_LAZYLOAD_CF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
434f680cc6SAli Bahrami 	MSG_DF_P1_GROUPPERM_CF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
44*f441771bSRod Evans 	MSG_DF_P1_DEFERRED_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 },
65*f441771bSRod Evans 		{ DF_P1_GROUPPERM,	MSG_DF_P1_GROUPPERM_DEF },
66*f441771bSRod Evans 		{ DF_P1_DEFERRED,	MSG_DF_P1_DEFERRED_DEF },
675aefb655Srie 		{ 0,			0 }
685aefb655Srie 	};
694f680cc6SAli Bahrami 	static const Val_desc vda_cf[] = {
704f680cc6SAli Bahrami 		{ DF_P1_LAZYLOAD,	MSG_DF_P1_LAZYLOAD_CF },
714f680cc6SAli Bahrami 		{ DF_P1_GROUPPERM,	MSG_DF_P1_GROUPPERM_CF },
72*f441771bSRod Evans 		{ DF_P1_DEFERRED,	MSG_DF_P1_DEFERRED_CF },
734f680cc6SAli Bahrami 		{ 0,			0 }
744f680cc6SAli Bahrami 	};
754f680cc6SAli Bahrami 	static const Val_desc vda_cfnp[] = {
764f680cc6SAli Bahrami 		{ DF_P1_LAZYLOAD,	MSG_DF_P1_LAZYLOAD_CFNP },
774f680cc6SAli Bahrami 		{ DF_P1_GROUPPERM,	MSG_DF_P1_GROUPPERM_CFNP },
78*f441771bSRod Evans 		{ DF_P1_DEFERRED,	MSG_DF_P1_DEFERRED_CFNP },
794f680cc6SAli Bahrami 		{ 0,			0 }
804f680cc6SAli Bahrami 	};
814f680cc6SAli Bahrami 	static const Val_desc vda_nf[] = {
824f680cc6SAli Bahrami 		{ DF_P1_LAZYLOAD,	MSG_DF_P1_LAZYLOAD_NF },
834f680cc6SAli Bahrami 		{ DF_P1_GROUPPERM,	MSG_DF_P1_GROUPPERM_NF },
84*f441771bSRod Evans 		{ DF_P1_DEFERRED,	MSG_DF_P1_DEFERRED_NF },
85ba4e3c84Sab 		{ 0,			0 }
86ba4e3c84Sab 	};
875aefb655Srie 
884f680cc6SAli Bahrami 	switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
894f680cc6SAli Bahrami 	case CONV_FMT_ALT_DUMP:
904f680cc6SAli Bahrami 	case CONV_FMT_ALT_CFNP:
914f680cc6SAli Bahrami 		return (vda_cfnp);
924f680cc6SAli Bahrami 	case CONV_FMT_ALT_CF:
934f680cc6SAli Bahrami 		return (vda_cf);
944f680cc6SAli Bahrami 	case CONV_FMT_ALT_NF:
954f680cc6SAli Bahrami 		return (vda_nf);
964f680cc6SAli Bahrami 	}
977c478bd9Sstevel@tonic-gate 
984f680cc6SAli Bahrami 	return (vda_def);
994f680cc6SAli Bahrami }
1007c478bd9Sstevel@tonic-gate 
1014f680cc6SAli Bahrami conv_iter_ret_t
1024f680cc6SAli Bahrami conv_iter_dyn_posflag1(Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func,
1034f680cc6SAli Bahrami     void *uvalue)
1044f680cc6SAli Bahrami {
1054f680cc6SAli Bahrami 	return (conv_iter_vd(conv_dyn_posflag1_strings(fmt_flags),
1064f680cc6SAli Bahrami 	    func, uvalue));
1077c478bd9Sstevel@tonic-gate }
1087c478bd9Sstevel@tonic-gate 
1094f680cc6SAli Bahrami const Val_desc *
1104f680cc6SAli Bahrami conv_dyn_flag_strings(Conv_fmt_flags_t fmt_flags)
1114f680cc6SAli Bahrami {
112ba4e3c84Sab #define	FLAGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
1134f680cc6SAli Bahrami 	MSG_DF_ORIGIN_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1144f680cc6SAli Bahrami 	MSG_DF_SYMBOLIC_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1154f680cc6SAli Bahrami 	MSG_DF_TEXTREL_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1164f680cc6SAli Bahrami 	MSG_DF_BIND_NOW_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1174f680cc6SAli Bahrami 	MSG_DF_STATIC_TLS_CF_SIZE 	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1184f680cc6SAli Bahrami 	CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
119de777a60Sab 
1204f680cc6SAli Bahrami 	/*
1214f680cc6SAli Bahrami 	 * Ensure that Conv_dyn_flag_buf_t is large enough:
1224f680cc6SAli Bahrami 	 *
1234f680cc6SAli Bahrami 	 * FLAGSZ is the real minimum size of the buffer required by
1244f680cc6SAli Bahrami 	 * conv_dyn_flag(). However, Conv_dyn_flag_buf_t uses
1254f680cc6SAli Bahrami 	 * CONV_DYN_FLAG_BUFSIZE to set the buffer size. We do things this
1264f680cc6SAli Bahrami 	 * way because the definition of FLAGSZ uses information that is not
1274f680cc6SAli Bahrami 	 * available in the environment of other programs that include the
1284f680cc6SAli Bahrami 	 * conv.h header file.
1294f680cc6SAli Bahrami 	 */
1306a074c93Sab #if (CONV_DYN_FLAG_BUFSIZE != FLAGSZ) && !defined(__lint)
1316a074c93Sab #define	REPORT_BUFSIZE FLAGSZ
1326a074c93Sab #include "report_bufsize.h"
1336a074c93Sab #error "CONV_DYN_FLAG_BUFSIZE does not match FLAGSZ"
134de777a60Sab #endif
1355aefb655Srie 
1364f680cc6SAli Bahrami 	static const Val_desc vda_cf[] = {
1374f680cc6SAli Bahrami 		{ DF_ORIGIN,		MSG_DF_ORIGIN_CF },
1384f680cc6SAli Bahrami 		{ DF_SYMBOLIC,		MSG_DF_SYMBOLIC_CF },
1394f680cc6SAli Bahrami 		{ DF_TEXTREL,		MSG_DF_TEXTREL_CF },
1404f680cc6SAli Bahrami 		{ DF_BIND_NOW,		MSG_DF_BIND_NOW_CF },
1414f680cc6SAli Bahrami 		{ DF_STATIC_TLS,	MSG_DF_STATIC_TLS_CF },
1424f680cc6SAli Bahrami 		{ 0 }
1434f680cc6SAli Bahrami 	};
1444f680cc6SAli Bahrami 	static const Val_desc vda_cfnp[] = {
1454f680cc6SAli Bahrami 		{ DF_ORIGIN,		MSG_DF_ORIGIN_CFNP },
1464f680cc6SAli Bahrami 		{ DF_SYMBOLIC,		MSG_DF_SYMBOLIC_CFNP },
1474f680cc6SAli Bahrami 		{ DF_TEXTREL,		MSG_DF_TEXTREL_CFNP },
1484f680cc6SAli Bahrami 		{ DF_BIND_NOW,		MSG_DF_BIND_NOW_CFNP },
1494f680cc6SAli Bahrami 		{ DF_STATIC_TLS,	MSG_DF_STATIC_TLS_CFNP },
1504f680cc6SAli Bahrami 		{ 0 }
1514f680cc6SAli Bahrami 	};
1524f680cc6SAli Bahrami 	static const Val_desc vda_nf[] = {
1534f680cc6SAli Bahrami 		{ DF_ORIGIN,		MSG_DF_ORIGIN_NF },
1544f680cc6SAli Bahrami 		{ DF_SYMBOLIC,		MSG_DF_SYMBOLIC_NF },
1554f680cc6SAli Bahrami 		{ DF_TEXTREL,		MSG_DF_TEXTREL_NF },
1564f680cc6SAli Bahrami 		{ DF_BIND_NOW,		MSG_DF_BIND_NOW_NF },
1574f680cc6SAli Bahrami 		{ DF_STATIC_TLS,	MSG_DF_STATIC_TLS_NF },
1584f680cc6SAli Bahrami 		{ 0 }
1594f680cc6SAli Bahrami 	};
1605aefb655Srie 
1614f680cc6SAli Bahrami 	switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
1624f680cc6SAli Bahrami 	case CONV_FMT_ALT_CF:
1634f680cc6SAli Bahrami 		return (vda_cf);
1644f680cc6SAli Bahrami 	case CONV_FMT_ALT_NF:
1654f680cc6SAli Bahrami 		return (vda_nf);
166ba4e3c84Sab 	}
1675aefb655Srie 
1684f680cc6SAli Bahrami 	return (vda_cfnp);
1697c478bd9Sstevel@tonic-gate }
1707c478bd9Sstevel@tonic-gate 
1714f680cc6SAli Bahrami conv_iter_ret_t
1724f680cc6SAli Bahrami conv_iter_dyn_flag(Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func,
1734f680cc6SAli Bahrami     void *uvalue)
1744f680cc6SAli Bahrami {
1754f680cc6SAli Bahrami 	return (conv_iter_vd(conv_dyn_flag_strings(fmt_flags), func, uvalue));
1764f680cc6SAli Bahrami }
1774f680cc6SAli Bahrami 
1784f680cc6SAli Bahrami const Val_desc *
1794f680cc6SAli Bahrami conv_dyn_flag1_strings(Conv_fmt_flags_t fmt_flags)
1804f680cc6SAli Bahrami {
181ba4e3c84Sab #define	FLAG1SZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
1824f680cc6SAli Bahrami 	MSG_DF_1_NOW_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1834f680cc6SAli Bahrami 	MSG_DF_1_GLOBAL_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1844f680cc6SAli Bahrami 	MSG_DF_1_GROUP_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1854f680cc6SAli Bahrami 	MSG_DF_1_NODELETE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1864f680cc6SAli Bahrami 	MSG_DF_1_LOADFLTR_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1874f680cc6SAli Bahrami 	MSG_DF_1_INITFIRST_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1884f680cc6SAli Bahrami 	MSG_DF_1_NOOPEN_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1894f680cc6SAli Bahrami 	MSG_DF_1_ORIGIN_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1904f680cc6SAli Bahrami 	MSG_DF_1_DIRECT_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1914f680cc6SAli Bahrami 	MSG_DF_1_TRANS_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1924f680cc6SAli Bahrami 	MSG_DF_1_INTERPOSE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1934f680cc6SAli Bahrami 	MSG_DF_1_NODEFLIB_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1944f680cc6SAli Bahrami 	MSG_DF_1_NODUMP_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1954f680cc6SAli Bahrami 	MSG_DF_1_CONFALT_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1964f680cc6SAli Bahrami 	MSG_DF_1_ENDFILTEE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1974f680cc6SAli Bahrami 	MSG_DF_1_DISPRELPND_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1984f680cc6SAli Bahrami 	MSG_DF_1_DISPRELDNE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
1994f680cc6SAli Bahrami 	MSG_DF_1_NODIRECT_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2004f680cc6SAli Bahrami 	MSG_DF_1_IGNMULDEF_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2014f680cc6SAli Bahrami 	MSG_DF_1_NOKSYMS_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2024f680cc6SAli Bahrami 	MSG_DF_1_NOHDR_CF_SIZE		+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2034f680cc6SAli Bahrami 	MSG_DF_1_NORELOC_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2044f680cc6SAli Bahrami 	MSG_DF_1_SYMINTPOSE_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2054f680cc6SAli Bahrami 	MSG_DF_1_GLOBAUDIT_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2064f680cc6SAli Bahrami 	MSG_DF_1_SINGLETON_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2074f680cc6SAli Bahrami 	CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
208de777a60Sab 
2094f680cc6SAli Bahrami 	/*
2104f680cc6SAli Bahrami 	 * Ensure that Conv_dyn_flag1_buf_t is large enough:
2114f680cc6SAli Bahrami 	 *
2124f680cc6SAli Bahrami 	 * FLAG1SZ is the real minimum size of the buffer required by
2134f680cc6SAli Bahrami 	 * conv_dyn_flag1(). However, Conv_dyn_flag1_buf_t uses
2144f680cc6SAli Bahrami 	 * CONV_DYN_FLAG1_BUFSIZE to set the buffer size. We do things this
2154f680cc6SAli Bahrami 	 * way because the definition of FLAG1SZ uses information that is not
2164f680cc6SAli Bahrami 	 * available in the environment of other programs that include the
2174f680cc6SAli Bahrami 	 * conv.h header file.
2184f680cc6SAli Bahrami 	 */
2196a074c93Sab #if (CONV_DYN_FLAG1_BUFSIZE != FLAG1SZ) && !defined(__lint)
2206a074c93Sab #define	REPORT_BUFSIZE FLAG1SZ
2216a074c93Sab #include "report_bufsize.h"
2226a074c93Sab #error "CONV_DYN_FLAG1_BUFSIZE does not match FLAG1SZ"
223de777a60Sab #endif
2247c478bd9Sstevel@tonic-gate 
2254f680cc6SAli Bahrami 	static const Val_desc vda_def[] = {
2264f680cc6SAli Bahrami 		{ DF_1_NOW,		MSG_DF_1_NOW_CFNP },
2274f680cc6SAli Bahrami 		{ DF_1_GLOBAL,		MSG_DF_1_GLOBAL_CFNP },
2284f680cc6SAli Bahrami 		{ DF_1_GROUP,		MSG_DF_1_GROUP_CFNP },
2294f680cc6SAli Bahrami 		{ DF_1_NODELETE,	MSG_DF_1_NODELETE_CFNP },
2304f680cc6SAli Bahrami 		{ DF_1_LOADFLTR,	MSG_DF_1_LOADFLTR_CFNP },
2314f680cc6SAli Bahrami 		{ DF_1_INITFIRST,	MSG_DF_1_INITFIRST_CFNP },
2324f680cc6SAli Bahrami 		{ DF_1_NOOPEN,		MSG_DF_1_NOOPEN_CFNP },
2334f680cc6SAli Bahrami 		{ DF_1_ORIGIN,		MSG_DF_1_ORIGIN_CFNP },
2344f680cc6SAli Bahrami 		{ DF_1_DIRECT,		MSG_DF_1_DIRECT_CFNP },
2354f680cc6SAli Bahrami 		{ DF_1_TRANS,		MSG_DF_1_TRANS_CFNP },
2364f680cc6SAli Bahrami 		{ DF_1_INTERPOSE,	MSG_DF_1_INTERPOSE_DEF },
2374f680cc6SAli Bahrami 		{ DF_1_NODEFLIB,	MSG_DF_1_NODEFLIB_CFNP },
2384f680cc6SAli Bahrami 		{ DF_1_NODUMP,		MSG_DF_1_NODUMP_CFNP },
2394f680cc6SAli Bahrami 		{ DF_1_CONFALT,		MSG_DF_1_CONFALT_CFNP },
2404f680cc6SAli Bahrami 		{ DF_1_ENDFILTEE,	MSG_DF_1_ENDFILTEE_CFNP },
2414f680cc6SAli Bahrami 		{ DF_1_DISPRELDNE,	MSG_DF_1_DISPRELDNE_DEF },
2424f680cc6SAli Bahrami 		{ DF_1_DISPRELPND,	MSG_DF_1_DISPRELPND_DEF },
2434f680cc6SAli Bahrami 		{ DF_1_NODIRECT,	MSG_DF_1_NODIRECT_CFNP },
2444f680cc6SAli Bahrami 		{ DF_1_IGNMULDEF,	MSG_DF_1_IGNMULDEF_DEF },
2454f680cc6SAli Bahrami 		{ DF_1_NOKSYMS,		MSG_DF_1_NOKSYMS_CFNP },
2464f680cc6SAli Bahrami 		{ DF_1_NOHDR,		MSG_DF_1_NOHDR_CFNP },
2474f680cc6SAli Bahrami 		{ DF_1_EDITED,		MSG_DF_1_EDITED_CFNP },
2484f680cc6SAli Bahrami 		{ DF_1_NORELOC,		MSG_DF_1_NORELOC_CFNP },
2494f680cc6SAli Bahrami 		{ DF_1_SYMINTPOSE,	MSG_DF_1_SYMINTPOSE_DEF },
2504f680cc6SAli Bahrami 		{ DF_1_GLOBAUDIT,	MSG_DF_1_GLOBAUDIT_DEF },
2514f680cc6SAli Bahrami 		{ DF_1_SINGLETON,	MSG_DF_1_SINGLETON_DEF },
2524f680cc6SAli Bahrami 		{ 0,			0 }
2534f680cc6SAli Bahrami 	};
2544f680cc6SAli Bahrami 	static const Val_desc vda_cf[] = {
2554f680cc6SAli Bahrami 		{ DF_1_NOW,		MSG_DF_1_NOW_CF },
2564f680cc6SAli Bahrami 		{ DF_1_GLOBAL,		MSG_DF_1_GLOBAL_CF },
2574f680cc6SAli Bahrami 		{ DF_1_GROUP,		MSG_DF_1_GROUP_CF },
2584f680cc6SAli Bahrami 		{ DF_1_NODELETE,	MSG_DF_1_NODELETE_CF },
2594f680cc6SAli Bahrami 		{ DF_1_LOADFLTR,	MSG_DF_1_LOADFLTR_CF },
2604f680cc6SAli Bahrami 		{ DF_1_INITFIRST,	MSG_DF_1_INITFIRST_CF },
2614f680cc6SAli Bahrami 		{ DF_1_NOOPEN,		MSG_DF_1_NOOPEN_CF },
2624f680cc6SAli Bahrami 		{ DF_1_ORIGIN,		MSG_DF_1_ORIGIN_CF },
2634f680cc6SAli Bahrami 		{ DF_1_DIRECT,		MSG_DF_1_DIRECT_CF },
2644f680cc6SAli Bahrami 		{ DF_1_TRANS,		MSG_DF_1_TRANS_CF },
2654f680cc6SAli Bahrami 		{ DF_1_INTERPOSE,	MSG_DF_1_INTERPOSE_CF },
2664f680cc6SAli Bahrami 		{ DF_1_NODEFLIB,	MSG_DF_1_NODEFLIB_CF },
2674f680cc6SAli Bahrami 		{ DF_1_NODUMP,		MSG_DF_1_NODUMP_CF },
2684f680cc6SAli Bahrami 		{ DF_1_CONFALT,		MSG_DF_1_CONFALT_CF },
2694f680cc6SAli Bahrami 		{ DF_1_ENDFILTEE,	MSG_DF_1_ENDFILTEE_CF },
2704f680cc6SAli Bahrami 		{ DF_1_DISPRELDNE,	MSG_DF_1_DISPRELDNE_CF },
2714f680cc6SAli Bahrami 		{ DF_1_DISPRELPND,	MSG_DF_1_DISPRELPND_CF },
2724f680cc6SAli Bahrami 		{ DF_1_NODIRECT,	MSG_DF_1_NODIRECT_CF },
2734f680cc6SAli Bahrami 		{ DF_1_IGNMULDEF,	MSG_DF_1_IGNMULDEF_CF },
2744f680cc6SAli Bahrami 		{ DF_1_NOKSYMS,		MSG_DF_1_NOKSYMS_CF },
2754f680cc6SAli Bahrami 		{ DF_1_NOHDR,		MSG_DF_1_NOHDR_CF },
2764f680cc6SAli Bahrami 		{ DF_1_EDITED,		MSG_DF_1_EDITED_CF },
2774f680cc6SAli Bahrami 		{ DF_1_NORELOC,		MSG_DF_1_NORELOC_CF },
2784f680cc6SAli Bahrami 		{ DF_1_SYMINTPOSE,	MSG_DF_1_SYMINTPOSE_CF },
2794f680cc6SAli Bahrami 		{ DF_1_GLOBAUDIT,	MSG_DF_1_GLOBAUDIT_CF },
2804f680cc6SAli Bahrami 		{ DF_1_SINGLETON,	MSG_DF_1_SINGLETON_CF },
2814f680cc6SAli Bahrami 		{ 0,			0 }
2824f680cc6SAli Bahrami 	};
2834f680cc6SAli Bahrami 	static const Val_desc vda_cfnp[] = {
2844f680cc6SAli Bahrami 		{ DF_1_NOW,		MSG_DF_1_NOW_CFNP },
2854f680cc6SAli Bahrami 		{ DF_1_GLOBAL,		MSG_DF_1_GLOBAL_CFNP },
2864f680cc6SAli Bahrami 		{ DF_1_GROUP,		MSG_DF_1_GROUP_CFNP },
2874f680cc6SAli Bahrami 		{ DF_1_NODELETE,	MSG_DF_1_NODELETE_CFNP },
2884f680cc6SAli Bahrami 		{ DF_1_LOADFLTR,	MSG_DF_1_LOADFLTR_CFNP },
2894f680cc6SAli Bahrami 		{ DF_1_INITFIRST,	MSG_DF_1_INITFIRST_CFNP },
2904f680cc6SAli Bahrami 		{ DF_1_NOOPEN,		MSG_DF_1_NOOPEN_CFNP },
2914f680cc6SAli Bahrami 		{ DF_1_ORIGIN,		MSG_DF_1_ORIGIN_CFNP },
2924f680cc6SAli Bahrami 		{ DF_1_DIRECT,		MSG_DF_1_DIRECT_CFNP },
2934f680cc6SAli Bahrami 		{ DF_1_TRANS,		MSG_DF_1_TRANS_CFNP },
2944f680cc6SAli Bahrami 		{ DF_1_INTERPOSE,	MSG_DF_1_INTERPOSE_CFNP },
2954f680cc6SAli Bahrami 		{ DF_1_NODEFLIB,	MSG_DF_1_NODEFLIB_CFNP },
2964f680cc6SAli Bahrami 		{ DF_1_NODUMP,		MSG_DF_1_NODUMP_CFNP },
2974f680cc6SAli Bahrami 		{ DF_1_CONFALT,		MSG_DF_1_CONFALT_CFNP },
2984f680cc6SAli Bahrami 		{ DF_1_ENDFILTEE,	MSG_DF_1_ENDFILTEE_CFNP },
2994f680cc6SAli Bahrami 		{ DF_1_DISPRELDNE,	MSG_DF_1_DISPRELDNE_CFNP },
3004f680cc6SAli Bahrami 		{ DF_1_DISPRELPND,	MSG_DF_1_DISPRELPND_CFNP },
3014f680cc6SAli Bahrami 		{ DF_1_NODIRECT,	MSG_DF_1_NODIRECT_CFNP },
3024f680cc6SAli Bahrami 		{ DF_1_IGNMULDEF,	MSG_DF_1_IGNMULDEF_CFNP },
3034f680cc6SAli Bahrami 		{ DF_1_NOKSYMS,		MSG_DF_1_NOKSYMS_CFNP },
3044f680cc6SAli Bahrami 		{ DF_1_NOHDR,		MSG_DF_1_NOHDR_CFNP },
3054f680cc6SAli Bahrami 		{ DF_1_EDITED,		MSG_DF_1_EDITED_CFNP },
3064f680cc6SAli Bahrami 		{ DF_1_NORELOC,		MSG_DF_1_NORELOC_CFNP },
3074f680cc6SAli Bahrami 		{ DF_1_SYMINTPOSE,	MSG_DF_1_SYMINTPOSE_CFNP },
3084f680cc6SAli Bahrami 		{ DF_1_GLOBAUDIT,	MSG_DF_1_GLOBAUDIT_CFNP },
3094f680cc6SAli Bahrami 		{ DF_1_SINGLETON,	MSG_DF_1_SINGLETON_CFNP },
3104f680cc6SAli Bahrami 		{ 0,			0 }
3114f680cc6SAli Bahrami 	};
3124f680cc6SAli Bahrami 	static const Val_desc vda_nf[] = {
3134f680cc6SAli Bahrami 		{ DF_1_NOW,		MSG_DF_1_NOW_NF },
3144f680cc6SAli Bahrami 		{ DF_1_GLOBAL,		MSG_DF_1_GLOBAL_NF },
3154f680cc6SAli Bahrami 		{ DF_1_GROUP,		MSG_DF_1_GROUP_NF },
3164f680cc6SAli Bahrami 		{ DF_1_NODELETE,	MSG_DF_1_NODELETE_NF },
3174f680cc6SAli Bahrami 		{ DF_1_LOADFLTR,	MSG_DF_1_LOADFLTR_NF },
3184f680cc6SAli Bahrami 		{ DF_1_INITFIRST,	MSG_DF_1_INITFIRST_NF },
3194f680cc6SAli Bahrami 		{ DF_1_NOOPEN,		MSG_DF_1_NOOPEN_NF },
3204f680cc6SAli Bahrami 		{ DF_1_ORIGIN,		MSG_DF_1_ORIGIN_NF },
3214f680cc6SAli Bahrami 		{ DF_1_DIRECT,		MSG_DF_1_DIRECT_NF },
3224f680cc6SAli Bahrami 		{ DF_1_TRANS,		MSG_DF_1_TRANS_NF },
3234f680cc6SAli Bahrami 		{ DF_1_INTERPOSE,	MSG_DF_1_INTERPOSE_NF },
3244f680cc6SAli Bahrami 		{ DF_1_NODEFLIB,	MSG_DF_1_NODEFLIB_NF },
3254f680cc6SAli Bahrami 		{ DF_1_NODUMP,		MSG_DF_1_NODUMP_NF },
3264f680cc6SAli Bahrami 		{ DF_1_CONFALT,		MSG_DF_1_CONFALT_NF },
3274f680cc6SAli Bahrami 		{ DF_1_ENDFILTEE,	MSG_DF_1_ENDFILTEE_NF },
3284f680cc6SAli Bahrami 		{ DF_1_DISPRELDNE,	MSG_DF_1_DISPRELDNE_NF },
3294f680cc6SAli Bahrami 		{ DF_1_DISPRELPND,	MSG_DF_1_DISPRELPND_NF },
3304f680cc6SAli Bahrami 		{ DF_1_NODIRECT,	MSG_DF_1_NODIRECT_NF },
3314f680cc6SAli Bahrami 		{ DF_1_IGNMULDEF,	MSG_DF_1_IGNMULDEF_NF },
3324f680cc6SAli Bahrami 		{ DF_1_NOKSYMS,		MSG_DF_1_NOKSYMS_NF },
3334f680cc6SAli Bahrami 		{ DF_1_NOHDR,		MSG_DF_1_NOHDR_NF },
3344f680cc6SAli Bahrami 		{ DF_1_EDITED,		MSG_DF_1_EDITED_NF },
3354f680cc6SAli Bahrami 		{ DF_1_NORELOC,		MSG_DF_1_NORELOC_NF },
3364f680cc6SAli Bahrami 		{ DF_1_SYMINTPOSE,	MSG_DF_1_SYMINTPOSE_NF },
3374f680cc6SAli Bahrami 		{ DF_1_GLOBAUDIT,	MSG_DF_1_GLOBAUDIT_NF },
3384f680cc6SAli Bahrami 		{ DF_1_SINGLETON,	MSG_DF_1_SINGLETON_NF },
3395aefb655Srie 		{ 0,			0 }
3405aefb655Srie 	};
3417c478bd9Sstevel@tonic-gate 
3424f680cc6SAli Bahrami 	switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
3434f680cc6SAli Bahrami 	case CONV_FMT_ALT_CF:
3444f680cc6SAli Bahrami 		return (vda_cf);
3454f680cc6SAli Bahrami 	case CONV_FMT_ALT_CFNP:
3464f680cc6SAli Bahrami 		return (vda_cfnp);
3474f680cc6SAli Bahrami 	case CONV_FMT_ALT_NF:
3484f680cc6SAli Bahrami 		return (vda_nf);
3494f680cc6SAli Bahrami 	}
3505aefb655Srie 
3514f680cc6SAli Bahrami 	return (vda_def);
3524f680cc6SAli Bahrami }
3535aefb655Srie 
3544f680cc6SAli Bahrami conv_iter_ret_t
3554f680cc6SAli Bahrami conv_iter_dyn_flag1(Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func,
3564f680cc6SAli Bahrami     void *uvalue)
3574f680cc6SAli Bahrami {
3584f680cc6SAli Bahrami 	return (conv_iter_vd(conv_dyn_flag1_strings(fmt_flags), func, uvalue));
3597c478bd9Sstevel@tonic-gate }
3607c478bd9Sstevel@tonic-gate 
3614f680cc6SAli Bahrami const Val_desc *
3624f680cc6SAli Bahrami conv_dyn_feature1_strings(Conv_fmt_flags_t fmt_flags)
3634f680cc6SAli Bahrami {
364ba4e3c84Sab #define	FEATSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
3654f680cc6SAli Bahrami 	MSG_DTF_1_PARINIT_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
3664f680cc6SAli Bahrami 	MSG_DTF_1_CONFEXP_CF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
3674f680cc6SAli Bahrami 	CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
368de777a60Sab 
3694f680cc6SAli Bahrami 	/*
3704f680cc6SAli Bahrami 	 * Ensure that Conv_dyn_feature1_buf_t is large enough:
3714f680cc6SAli Bahrami 	 *
3724f680cc6SAli Bahrami 	 * FEATSZ is the real min size of the buffer required by
3734f680cc6SAli Bahrami 	 * conv_dyn_feature1(). However, Conv_dyn_feature1_buf_t uses
3744f680cc6SAli Bahrami 	 * CONV_DYN_FEATURE1_BUFSIZE to set the buffer size. We do things
3754f680cc6SAli Bahrami 	 * this way because the definition of FEATSZ uses information that
3764f680cc6SAli Bahrami 	 * is not available in the environment of other programs that include
3774f680cc6SAli Bahrami 	 * the conv.h header file.
3784f680cc6SAli Bahrami 	 */
3796a074c93Sab #if (CONV_DYN_FEATURE1_BUFSIZE != FEATSZ) && !defined(__lint)
3806a074c93Sab #define	REPORT_BUFSIZE FEATSZ
3816a074c93Sab #include "report_bufsize.h"
3826a074c93Sab #error "CONV_DYN_FEATURE1_BUFSIZE does not match FEATSZ"
383de777a60Sab #endif
3847c478bd9Sstevel@tonic-gate 
3854f680cc6SAli Bahrami 	static const Val_desc vda_cf[] = {
3864f680cc6SAli Bahrami 		{ DTF_1_PARINIT,	MSG_DTF_1_PARINIT_CF },
3874f680cc6SAli Bahrami 		{ DTF_1_CONFEXP,	MSG_DTF_1_CONFEXP_CF },
3884f680cc6SAli Bahrami 		{ 0,			0 }
3894f680cc6SAli Bahrami 	};
3904f680cc6SAli Bahrami 	static const Val_desc vda_cfnp[] = {
3914f680cc6SAli Bahrami 		{ DTF_1_PARINIT,	MSG_DTF_1_PARINIT_CFNP },
3924f680cc6SAli Bahrami 		{ DTF_1_CONFEXP,	MSG_DTF_1_CONFEXP_CFNP },
3934f680cc6SAli Bahrami 		{ 0,			0 }
3944f680cc6SAli Bahrami 	};
3954f680cc6SAli Bahrami 	static const Val_desc vda_nf[] = {
3964f680cc6SAli Bahrami 		{ DTF_1_PARINIT,	MSG_DTF_1_PARINIT_NF },
3974f680cc6SAli Bahrami 		{ DTF_1_CONFEXP,	MSG_DTF_1_CONFEXP_NF },
3985aefb655Srie 		{ 0,			0 }
3995aefb655Srie 	};
4007c478bd9Sstevel@tonic-gate 
4014f680cc6SAli Bahrami 	switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
4024f680cc6SAli Bahrami 	case CONV_FMT_ALT_CF:
4034f680cc6SAli Bahrami 		return (vda_cf);
4044f680cc6SAli Bahrami 	case CONV_FMT_ALT_NF:
4054f680cc6SAli Bahrami 		return (vda_nf);
406ba4e3c84Sab 	}
4077c478bd9Sstevel@tonic-gate 
4084f680cc6SAli Bahrami 	return (vda_cfnp);
4097c478bd9Sstevel@tonic-gate }
4107c478bd9Sstevel@tonic-gate 
4114f680cc6SAli Bahrami conv_iter_ret_t
4124f680cc6SAli Bahrami conv_iter_dyn_feature1(Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func,
4134f680cc6SAli Bahrami     void *uvalue)
4147c478bd9Sstevel@tonic-gate {
4154f680cc6SAli Bahrami 	return (conv_iter_vd(conv_dyn_feature1_strings(fmt_flags),
4164f680cc6SAli Bahrami 	    func, uvalue));
4174f680cc6SAli Bahrami }
418d579eb63Sab 
4194f680cc6SAli Bahrami const conv_ds_t **
4204f680cc6SAli Bahrami conv_dyn_tag_strings(conv_iter_osabi_t osabi, Half mach,
4214f680cc6SAli Bahrami     Conv_fmt_flags_t fmt_flags)
4224f680cc6SAli Bahrami {
423d579eb63Sab 	/*
4244f680cc6SAli Bahrami 	 * Maximum # of items that can be in the returned array. Size this
4254f680cc6SAli Bahrami 	 * by counting the maximum depth in the switch statement that fills
4264f680cc6SAli Bahrami 	 * retarr at the end of this function.
427d579eb63Sab 	 */
4284f680cc6SAli Bahrami #define	MAX_RET	12
429d579eb63Sab 
430d579eb63Sab 	/*
431d579eb63Sab 	 * Generic dynamic tags:
4324f680cc6SAli Bahrami 	 * -	Note hole between DT_FLAGS and DT_PREINIT_ARRAY (tag 32).
4334f680cc6SAli Bahrami 	 *	We use a 0, which is the signal for "not defined".
4344f680cc6SAli Bahrami 	 * -	This range has alternative names for dump, requiring an
4354f680cc6SAli Bahrami 	 *	additional array.
436d579eb63Sab 	 */
4374f680cc6SAli Bahrami 	static const Msg	tags_null_cf[] = {
4384f680cc6SAli Bahrami 		MSG_DT_NULL_CF,			MSG_DT_NEEDED_CF,
4394f680cc6SAli Bahrami 		MSG_DT_PLTRELSZ_CF,		MSG_DT_PLTGOT_CF,
4404f680cc6SAli Bahrami 		MSG_DT_HASH_CF,			MSG_DT_STRTAB_CF,
4414f680cc6SAli Bahrami 		MSG_DT_SYMTAB_CF,		MSG_DT_RELA_CF,
4424f680cc6SAli Bahrami 		MSG_DT_RELASZ_CF,		MSG_DT_RELAENT_CF,
4434f680cc6SAli Bahrami 		MSG_DT_STRSZ_CF,		MSG_DT_SYMENT_CF,
4444f680cc6SAli Bahrami 		MSG_DT_INIT_CF,			MSG_DT_FINI_CF,
4454f680cc6SAli Bahrami 		MSG_DT_SONAME_CF,		MSG_DT_RPATH_CF,
4464f680cc6SAli Bahrami 		MSG_DT_SYMBOLIC_CF,		MSG_DT_REL_CF,
4474f680cc6SAli Bahrami 		MSG_DT_RELSZ_CF,		MSG_DT_RELENT_CF,
4484f680cc6SAli Bahrami 		MSG_DT_PLTREL_CF,		MSG_DT_DEBUG_CF,
4494f680cc6SAli Bahrami 		MSG_DT_TEXTREL_CF,		MSG_DT_JMPREL_CF,
4504f680cc6SAli Bahrami 		MSG_DT_BIND_NOW_CF,		MSG_DT_INIT_ARRAY_CF,
4514f680cc6SAli Bahrami 		MSG_DT_FINI_ARRAY_CF,		MSG_DT_INIT_ARRAYSZ_CF,
4524f680cc6SAli Bahrami 		MSG_DT_FINI_ARRAYSZ_CF,		MSG_DT_RUNPATH_CF,
4534f680cc6SAli Bahrami 		MSG_DT_FLAGS_CF,		0,
4544f680cc6SAli Bahrami 		MSG_DT_PREINIT_ARRAY_CF,	MSG_DT_PREINIT_ARRAYSZ_CF
4554f680cc6SAli Bahrami 	};
4564f680cc6SAli Bahrami 	static const Msg	tags_null_cfnp[] = {
4574f680cc6SAli Bahrami 		MSG_DT_NULL_CFNP,		MSG_DT_NEEDED_CFNP,
4584f680cc6SAli Bahrami 		MSG_DT_PLTRELSZ_CFNP,		MSG_DT_PLTGOT_CFNP,
4594f680cc6SAli Bahrami 		MSG_DT_HASH_CFNP,		MSG_DT_STRTAB_CFNP,
4604f680cc6SAli Bahrami 		MSG_DT_SYMTAB_CFNP,		MSG_DT_RELA_CFNP,
4614f680cc6SAli Bahrami 		MSG_DT_RELASZ_CFNP,		MSG_DT_RELAENT_CFNP,
4624f680cc6SAli Bahrami 		MSG_DT_STRSZ_CFNP,		MSG_DT_SYMENT_CFNP,
4634f680cc6SAli Bahrami 		MSG_DT_INIT_CFNP,		MSG_DT_FINI_CFNP,
4644f680cc6SAli Bahrami 		MSG_DT_SONAME_CFNP,		MSG_DT_RPATH_CFNP,
4654f680cc6SAli Bahrami 		MSG_DT_SYMBOLIC_CFNP,		MSG_DT_REL_CFNP,
4664f680cc6SAli Bahrami 		MSG_DT_RELSZ_CFNP,		MSG_DT_RELENT_CFNP,
4674f680cc6SAli Bahrami 		MSG_DT_PLTREL_CFNP,		MSG_DT_DEBUG_CFNP,
4684f680cc6SAli Bahrami 		MSG_DT_TEXTREL_CFNP,		MSG_DT_JMPREL_CFNP,
4694f680cc6SAli Bahrami 		MSG_DT_BIND_NOW_CFNP,		MSG_DT_INIT_ARRAY_CFNP,
4704f680cc6SAli Bahrami 		MSG_DT_FINI_ARRAY_CFNP,		MSG_DT_INIT_ARRAYSZ_CFNP,
4714f680cc6SAli Bahrami 		MSG_DT_FINI_ARRAYSZ_CFNP,	MSG_DT_RUNPATH_CFNP,
4724f680cc6SAli Bahrami 		MSG_DT_FLAGS_CFNP,		0,
4734f680cc6SAli Bahrami 		MSG_DT_PREINIT_ARRAY_CFNP,	MSG_DT_PREINIT_ARRAYSZ_CFNP
4744f680cc6SAli Bahrami 	};
4754f680cc6SAli Bahrami 	static const Msg	tags_null_nf[] = {
4764f680cc6SAli Bahrami 		MSG_DT_NULL_NF,			MSG_DT_NEEDED_NF,
4774f680cc6SAli Bahrami 		MSG_DT_PLTRELSZ_NF,		MSG_DT_PLTGOT_NF,
4784f680cc6SAli Bahrami 		MSG_DT_HASH_NF,			MSG_DT_STRTAB_NF,
4794f680cc6SAli Bahrami 		MSG_DT_SYMTAB_NF,		MSG_DT_RELA_NF,
4804f680cc6SAli Bahrami 		MSG_DT_RELASZ_NF,		MSG_DT_RELAENT_NF,
4814f680cc6SAli Bahrami 		MSG_DT_STRSZ_NF,		MSG_DT_SYMENT_NF,
4824f680cc6SAli Bahrami 		MSG_DT_INIT_NF,			MSG_DT_FINI_NF,
4834f680cc6SAli Bahrami 		MSG_DT_SONAME_NF,		MSG_DT_RPATH_NF,
4844f680cc6SAli Bahrami 		MSG_DT_SYMBOLIC_NF,		MSG_DT_REL_NF,
4854f680cc6SAli Bahrami 		MSG_DT_RELSZ_NF,		MSG_DT_RELENT_NF,
4864f680cc6SAli Bahrami 		MSG_DT_PLTREL_NF,		MSG_DT_DEBUG_NF,
4874f680cc6SAli Bahrami 		MSG_DT_TEXTREL_NF,		MSG_DT_JMPREL_NF,
4884f680cc6SAli Bahrami 		MSG_DT_BIND_NOW_NF,		MSG_DT_INIT_ARRAY_NF,
4894f680cc6SAli Bahrami 		MSG_DT_FINI_ARRAY_NF,		MSG_DT_INIT_ARRAYSZ_NF,
4904f680cc6SAli Bahrami 		MSG_DT_FINI_ARRAYSZ_NF,		MSG_DT_RUNPATH_NF,
4914f680cc6SAli Bahrami 		MSG_DT_FLAGS_NF,		0,
4924f680cc6SAli Bahrami 		MSG_DT_PREINIT_ARRAY_NF,	MSG_DT_PREINIT_ARRAYSZ_NF
4934f680cc6SAli Bahrami 	};
4944f680cc6SAli Bahrami 	static const Msg	tags_null_dmp[] = {
4954f680cc6SAli Bahrami 		MSG_DT_NULL_CFNP,		MSG_DT_NEEDED_CFNP,
4964f680cc6SAli Bahrami 		MSG_DT_PLTRELSZ_DMP,		MSG_DT_PLTGOT_CFNP,
4974f680cc6SAli Bahrami 		MSG_DT_HASH_CFNP,		MSG_DT_STRTAB_CFNP,
4984f680cc6SAli Bahrami 		MSG_DT_SYMTAB_CFNP,		MSG_DT_RELA_CFNP,
4994f680cc6SAli Bahrami 		MSG_DT_RELASZ_CFNP,		MSG_DT_RELAENT_CFNP,
5004f680cc6SAli Bahrami 		MSG_DT_STRSZ_CFNP,		MSG_DT_SYMENT_CFNP,
5014f680cc6SAli Bahrami 		MSG_DT_INIT_CFNP,		MSG_DT_FINI_CFNP,
5024f680cc6SAli Bahrami 		MSG_DT_SONAME_CFNP,		MSG_DT_RPATH_CFNP,
5034f680cc6SAli Bahrami 		MSG_DT_SYMBOLIC_DMP,		MSG_DT_REL_CFNP,
5044f680cc6SAli Bahrami 		MSG_DT_RELSZ_CFNP,		MSG_DT_RELENT_CFNP,
5054f680cc6SAli Bahrami 		MSG_DT_PLTREL_CFNP,		MSG_DT_DEBUG_CFNP,
5064f680cc6SAli Bahrami 		MSG_DT_TEXTREL_CFNP,		MSG_DT_JMPREL_CFNP,
5074f680cc6SAli Bahrami 		MSG_DT_BIND_NOW_CFNP,		MSG_DT_INIT_ARRAY_CFNP,
5084f680cc6SAli Bahrami 		MSG_DT_FINI_ARRAY_CFNP,		MSG_DT_INIT_ARRAYSZ_CFNP,
5094f680cc6SAli Bahrami 		MSG_DT_FINI_ARRAYSZ_CFNP,	MSG_DT_RUNPATH_CFNP,
5104f680cc6SAli Bahrami 		MSG_DT_FLAGS_CFNP,		0,
5114f680cc6SAli Bahrami 		MSG_DT_PREINIT_ARRAY_CFNP,	MSG_DT_PREINIT_ARRAYSZ_CFNP
512c13de8f6Sab 	};
5134f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_null_cf = {
5144f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_NULL, tags_null_cf) };
5154f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_null_cfnp = {
5164f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_NULL, tags_null_cfnp) };
5174f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_null_nf = {
5184f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_NULL, tags_null_nf) };
5194f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_null_dmp = {
5204f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_NULL, tags_null_dmp) };
5214f680cc6SAli Bahrami 
5224f680cc6SAli Bahrami 	/*
5234f680cc6SAli Bahrami 	 * DT_SPARC_REGISTER was originally assigned 0x7000001. It is processor
5244f680cc6SAli Bahrami 	 * specific, and should have been in the range DT_LOPROC-DT_HIPROC
5254f680cc6SAli Bahrami 	 * instead of here. When the error was fixed,
5264f680cc6SAli Bahrami 	 * DT_DEPRECATED_SPARC_REGISTER was created to maintain backward
5274f680cc6SAli Bahrami 	 * compatability.
5284f680cc6SAli Bahrami 	 */
5294f680cc6SAli Bahrami 	static const Msg	tags_sdreg_cf[] = {
5304f680cc6SAli Bahrami 	    MSG_DT_DEP_SPARC_REG_CF };
5314f680cc6SAli Bahrami 	static const Msg	tags_sdreg_cfnp[] = {
5324f680cc6SAli Bahrami 	    MSG_DT_DEP_SPARC_REG_CFNP };
5334f680cc6SAli Bahrami 	static const Msg	tags_sdreg_nf[] = {
5344f680cc6SAli Bahrami 	    MSG_DT_DEP_SPARC_REG_NF };
5354f680cc6SAli Bahrami 
5364f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sdreg_cf = {
5374f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_DEPRECATED_SPARC_REGISTER, tags_sdreg_cf) };
5384f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sdreg_cfnp = {
5394f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_DEPRECATED_SPARC_REGISTER, tags_sdreg_cfnp) };
5404f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sdreg_nf = {
5414f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_DEPRECATED_SPARC_REGISTER, tags_sdreg_nf) };
5424f680cc6SAli Bahrami 
5437c478bd9Sstevel@tonic-gate 
544d579eb63Sab 	/*
5454f680cc6SAli Bahrami 	 * SUNW: DT_LOOS -> DT_HIOS range. Note holes between DT_SUNW_TLSSORTSZ,
546ba2be530Sab 	 * DT_SUNW_STRPAD, and DT_SUNW_LDMACH. We handle the outliers
547ba2be530Sab 	 * separately below as single values.
548d579eb63Sab 	 */
5494f680cc6SAli Bahrami 	static const Msg	tags_sunw_auxiliary_cf[] = {
5504f680cc6SAli Bahrami 		MSG_DT_SUNW_AUXILIARY_CF,	MSG_DT_SUNW_RTLDINF_CF,
5514f680cc6SAli Bahrami 		MSG_DT_SUNW_FILTER_CF,		MSG_DT_SUNW_CAP_CF,
5524f680cc6SAli Bahrami 		MSG_DT_SUNW_SYMTAB_CF,		MSG_DT_SUNW_SYMSZ_CF,
5534f680cc6SAli Bahrami 		MSG_DT_SUNW_SORTENT_CF,		MSG_DT_SUNW_SYMSORT_CF,
5544f680cc6SAli Bahrami 		MSG_DT_SUNW_SYMSORTSZ_CF,	MSG_DT_SUNW_TLSSORT_CF,
55508278a5eSRod Evans 		MSG_DT_SUNW_TLSSORTSZ_CF,	MSG_DT_SUNW_CAPINFO_CF,
55608278a5eSRod Evans 		MSG_DT_SUNW_STRPAD_CF,		MSG_DT_SUNW_CAPCHAIN_CF,
55708278a5eSRod Evans 		MSG_DT_SUNW_LDMACH_CF,		0,
55808278a5eSRod Evans 		MSG_DT_SUNW_CAPCHAINENT_CF,	0,
55908278a5eSRod Evans 		MSG_DT_SUNW_CAPCHAINSZ_CF
5604f680cc6SAli Bahrami 	};
5614f680cc6SAli Bahrami 	static const Msg	tags_sunw_auxiliary_cfnp[] = {
5624f680cc6SAli Bahrami 		MSG_DT_SUNW_AUXILIARY_CFNP,	MSG_DT_SUNW_RTLDINF_CFNP,
5634f680cc6SAli Bahrami 		MSG_DT_SUNW_FILTER_CFNP,	MSG_DT_SUNW_CAP_CFNP,
5644f680cc6SAli Bahrami 		MSG_DT_SUNW_SYMTAB_CFNP,	MSG_DT_SUNW_SYMSZ_CFNP,
5654f680cc6SAli Bahrami 		MSG_DT_SUNW_SORTENT_CFNP,	MSG_DT_SUNW_SYMSORT_CFNP,
5664f680cc6SAli Bahrami 		MSG_DT_SUNW_SYMSORTSZ_CFNP,	MSG_DT_SUNW_TLSSORT_CFNP,
56708278a5eSRod Evans 		MSG_DT_SUNW_TLSSORTSZ_CFNP,	MSG_DT_SUNW_CAPINFO_CFNP,
56808278a5eSRod Evans 		MSG_DT_SUNW_STRPAD_CFNP,	MSG_DT_SUNW_CAPCHAIN_CFNP,
56908278a5eSRod Evans 		MSG_DT_SUNW_LDMACH_CFNP,	0,
57008278a5eSRod Evans 		MSG_DT_SUNW_CAPCHAINENT_CFNP,	0,
57108278a5eSRod Evans 		MSG_DT_SUNW_CAPCHAINSZ_CFNP
5724f680cc6SAli Bahrami 	};
5734f680cc6SAli Bahrami 	static const Msg	tags_sunw_auxiliary_nf[] = {
5744f680cc6SAli Bahrami 		MSG_DT_SUNW_AUXILIARY_NF,	MSG_DT_SUNW_RTLDINF_NF,
5754f680cc6SAli Bahrami 		MSG_DT_SUNW_FILTER_NF,		MSG_DT_SUNW_CAP_NF,
5764f680cc6SAli Bahrami 		MSG_DT_SUNW_SYMTAB_NF,		MSG_DT_SUNW_SYMSZ_NF,
5774f680cc6SAli Bahrami 		MSG_DT_SUNW_SORTENT_NF,		MSG_DT_SUNW_SYMSORT_NF,
5784f680cc6SAli Bahrami 		MSG_DT_SUNW_SYMSORTSZ_NF,	MSG_DT_SUNW_TLSSORT_NF,
57908278a5eSRod Evans 		MSG_DT_SUNW_TLSSORTSZ_NF,	MSG_DT_SUNW_CAPINFO_NF,
58008278a5eSRod Evans 		MSG_DT_SUNW_STRPAD_NF,		MSG_DT_SUNW_CAPCHAIN_NF,
58108278a5eSRod Evans 		MSG_DT_SUNW_LDMACH_NF,		0,
58208278a5eSRod Evans 		MSG_DT_SUNW_CAPCHAINENT_NF,	0,
58308278a5eSRod Evans 		MSG_DT_SUNW_CAPCHAINSZ_NF
5844f680cc6SAli Bahrami 	};
5854f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sunw_auxiliary_cf = {
5864f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_SUNW_AUXILIARY, tags_sunw_auxiliary_cf) };
5874f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sunw_auxiliary_cfnp = {
5884f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_SUNW_AUXILIARY, tags_sunw_auxiliary_cfnp) };
5894f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sunw_auxiliary_nf = {
5904f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_SUNW_AUXILIARY, tags_sunw_auxiliary_nf) };
5914f680cc6SAli Bahrami 
5924f680cc6SAli Bahrami 	/*
5934f680cc6SAli Bahrami 	 * GNU: (In DT_VALRNGLO section) DT_GNU_PRELINKED - DT_GNU_LIBLISTSZ
5944f680cc6SAli Bahrami 	 */
5954f680cc6SAli Bahrami 	static const Msg	tags_gnu_prelinked_cf[] = {
5964f680cc6SAli Bahrami 		MSG_DT_GNU_PRELINKED_CF,	MSG_DT_GNU_CONFLICTSZ_CF,
5974f680cc6SAli Bahrami 		MSG_DT_GNU_LIBLISTSZ_CF
5984f680cc6SAli Bahrami 	};
5994f680cc6SAli Bahrami 	static const Msg	tags_gnu_prelinked_cfnp[] = {
6004f680cc6SAli Bahrami 		MSG_DT_GNU_PRELINKED_CFNP,	MSG_DT_GNU_CONFLICTSZ_CFNP,
6014f680cc6SAli Bahrami 		MSG_DT_GNU_LIBLISTSZ_CFNP
6024f680cc6SAli Bahrami 	};
6034f680cc6SAli Bahrami 	static const Msg	tags_gnu_prelinked_nf[] = {
6044f680cc6SAli Bahrami 		MSG_DT_GNU_PRELINKED_NF,	MSG_DT_GNU_CONFLICTSZ_NF,
6054f680cc6SAli Bahrami 		MSG_DT_GNU_LIBLISTSZ_NF
606d579eb63Sab 	};
6074f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_gnu_prelinked_cf = {
6084f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_GNU_PRELINKED, tags_gnu_prelinked_cf) };
6094f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_gnu_prelinked_cfnp = {
6104f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_GNU_PRELINKED, tags_gnu_prelinked_cfnp) };
6114f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_gnu_prelinked_nf = {
6124f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_GNU_PRELINKED, tags_gnu_prelinked_nf) };
613d579eb63Sab 
614d579eb63Sab 	/*
615d579eb63Sab 	 * SUNW: DT_VALRNGLO - DT_VALRNGHI range.
616d579eb63Sab 	 */
6174f680cc6SAli Bahrami 	static const Msg	tags_checksum_cf[] = {
6184f680cc6SAli Bahrami 		MSG_DT_CHECKSUM_CF,		MSG_DT_PLTPADSZ_CF,
6194f680cc6SAli Bahrami 		MSG_DT_MOVEENT_CF,		MSG_DT_MOVESZ_CF,
6204f680cc6SAli Bahrami 		MSG_DT_FEATURE_1_CF,		MSG_DT_POSFLAG_1_CF,
6214f680cc6SAli Bahrami 		MSG_DT_SYMINSZ_CF,		MSG_DT_SYMINENT_CF
622d579eb63Sab 	};
6234f680cc6SAli Bahrami 	static const Msg	tags_checksum_cfnp[] = {
6244f680cc6SAli Bahrami 		MSG_DT_CHECKSUM_CFNP,		MSG_DT_PLTPADSZ_CFNP,
6254f680cc6SAli Bahrami 		MSG_DT_MOVEENT_CFNP,		MSG_DT_MOVESZ_CFNP,
6264f680cc6SAli Bahrami 		MSG_DT_FEATURE_1_CFNP,		MSG_DT_POSFLAG_1_CFNP,
6274f680cc6SAli Bahrami 		MSG_DT_SYMINSZ_CFNP,		MSG_DT_SYMINENT_CFNP
6284f680cc6SAli Bahrami 	};
6294f680cc6SAli Bahrami 	static const Msg	tags_checksum_nf[] = {
6304f680cc6SAli Bahrami 		MSG_DT_CHECKSUM_NF,		MSG_DT_PLTPADSZ_NF,
6314f680cc6SAli Bahrami 		MSG_DT_MOVEENT_NF,		MSG_DT_MOVESZ_NF,
6324f680cc6SAli Bahrami 		MSG_DT_FEATURE_1_NF,		MSG_DT_POSFLAG_1_NF,
6334f680cc6SAli Bahrami 		MSG_DT_SYMINSZ_NF,		MSG_DT_SYMINENT_NF
6344f680cc6SAli Bahrami 	};
6354f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_checksum_cf = {
6364f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_CHECKSUM, tags_checksum_cf) };
6374f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_checksum_cfnp = {
6384f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_CHECKSUM, tags_checksum_cfnp) };
6394f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_checksum_nf = {
6404f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_CHECKSUM, tags_checksum_nf) };
6414f680cc6SAli Bahrami 
6424f680cc6SAli Bahrami 	/*
6434f680cc6SAli Bahrami 	 * GNU: (In DT_ADDRRNGLO section) DT_GNU_HASH - DT_GNU_LIBLIST
6444f680cc6SAli Bahrami 	 */
6454f680cc6SAli Bahrami 	static const Msg	tags_gnu_hash_cf[] = {
6464f680cc6SAli Bahrami 		MSG_DT_GNU_HASH_CF,		MSG_DT_TLSDESC_PLT_CF,
6474f680cc6SAli Bahrami 		MSG_DT_TLSDESC_GOT_CF,		MSG_DT_GNU_CONFLICT_CF,
6484f680cc6SAli Bahrami 		MSG_DT_GNU_LIBLIST_CF
6494f680cc6SAli Bahrami 	};
6504f680cc6SAli Bahrami 	static const Msg	tags_gnu_hash_cfnp[] = {
6514f680cc6SAli Bahrami 		MSG_DT_GNU_HASH_CFNP,		MSG_DT_TLSDESC_PLT_CFNP,
6524f680cc6SAli Bahrami 		MSG_DT_TLSDESC_GOT_CFNP,	MSG_DT_GNU_CONFLICT_CFNP,
6534f680cc6SAli Bahrami 		MSG_DT_GNU_LIBLIST_CFNP
6544f680cc6SAli Bahrami 	};
6554f680cc6SAli Bahrami 	static const Msg	tags_gnu_hash_nf[] = {
6564f680cc6SAli Bahrami 		MSG_DT_GNU_HASH_NF,		MSG_DT_TLSDESC_PLT_NF,
6574f680cc6SAli Bahrami 		MSG_DT_TLSDESC_GOT_NF,		MSG_DT_GNU_CONFLICT_NF,
6584f680cc6SAli Bahrami 		MSG_DT_GNU_LIBLIST_NF
6594f680cc6SAli Bahrami 	};
6604f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_gnu_hash_cf = {
6614f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_GNU_HASH, tags_gnu_hash_cf) };
6624f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_gnu_hash_cfnp = {
6634f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_GNU_HASH, tags_gnu_hash_cfnp) };
6644f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_gnu_hash_nf = {
6654f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_GNU_HASH, tags_gnu_hash_nf) };
666d579eb63Sab 
667d579eb63Sab 	/*
668d579eb63Sab 	 * SUNW: DT_ADDRRNGLO - DT_ADDRRNGHI range.
669d579eb63Sab 	 */
6704f680cc6SAli Bahrami 	static const Msg	tags_config_cf[] = {
6714f680cc6SAli Bahrami 		MSG_DT_CONFIG_CF,		MSG_DT_DEPAUDIT_CF,
6724f680cc6SAli Bahrami 		MSG_DT_AUDIT_CF,		MSG_DT_PLTPAD_CF,
6734f680cc6SAli Bahrami 		MSG_DT_MOVETAB_CF,		MSG_DT_SYMINFO_CF
6744f680cc6SAli Bahrami 	};
6754f680cc6SAli Bahrami 	static const Msg	tags_config_cfnp[] = {
6764f680cc6SAli Bahrami 		MSG_DT_CONFIG_CFNP,		MSG_DT_DEPAUDIT_CFNP,
6774f680cc6SAli Bahrami 		MSG_DT_AUDIT_CFNP,		MSG_DT_PLTPAD_CFNP,
6784f680cc6SAli Bahrami 		MSG_DT_MOVETAB_CFNP,		MSG_DT_SYMINFO_CFNP
679d579eb63Sab 	};
6804f680cc6SAli Bahrami 	static const Msg	tags_config_nf[] = {
6814f680cc6SAli Bahrami 		MSG_DT_CONFIG_NF,		MSG_DT_DEPAUDIT_NF,
6824f680cc6SAli Bahrami 		MSG_DT_AUDIT_NF,		MSG_DT_PLTPAD_NF,
6834f680cc6SAli Bahrami 		MSG_DT_MOVETAB_NF,		MSG_DT_SYMINFO_NF
6844f680cc6SAli Bahrami 	};
6854f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_config_cf = {
6864f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_CONFIG, tags_config_cf) };
6874f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_config_cfnp = {
6884f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_CONFIG, tags_config_cfnp) };
6894f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_config_nf = {
6904f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_CONFIG, tags_config_nf) };
691d579eb63Sab 
692d579eb63Sab 	/*
693d579eb63Sab 	 * SUNW: generic range. Note hole between DT_VERSYM and DT_RELACOUNT.
694d579eb63Sab 	 */
6954f680cc6SAli Bahrami 	static const Msg	tags_versym_cf[] = { MSG_DT_VERSYM_CF };
6964f680cc6SAli Bahrami 	static const Msg	tags_versym_cfnp[] = { MSG_DT_VERSYM_CFNP };
6974f680cc6SAli Bahrami 	static const Msg	tags_versym_nf[] = { MSG_DT_VERSYM_NF };
6984f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_versym_cf = {
6994f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_VERSYM, tags_versym_cf) };
7004f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_versym_cfnp = {
7014f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_VERSYM, tags_versym_cfnp) };
7024f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_versym_nf = {
7034f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_VERSYM, tags_versym_nf) };
7044f680cc6SAli Bahrami 
7054f680cc6SAli Bahrami 	static const Msg	tags_relacount_cf[] = {
7064f680cc6SAli Bahrami 		MSG_DT_RELACOUNT_CF,		MSG_DT_RELCOUNT_CF,
7074f680cc6SAli Bahrami 		MSG_DT_FLAGS_1_CF,		MSG_DT_VERDEF_CF,
7084f680cc6SAli Bahrami 		MSG_DT_VERDEFNUM_CF,		MSG_DT_VERNEED_CF,
7094f680cc6SAli Bahrami 		MSG_DT_VERNEEDNUM_CF
7104f680cc6SAli Bahrami 	};
7114f680cc6SAli Bahrami 	static const Msg	tags_relacount_cfnp[] = {
7124f680cc6SAli Bahrami 		MSG_DT_RELACOUNT_CFNP,		MSG_DT_RELCOUNT_CFNP,
7134f680cc6SAli Bahrami 		MSG_DT_FLAGS_1_CFNP,		MSG_DT_VERDEF_CFNP,
7144f680cc6SAli Bahrami 		MSG_DT_VERDEFNUM_CFNP,		MSG_DT_VERNEED_CFNP,
7154f680cc6SAli Bahrami 		MSG_DT_VERNEEDNUM_CFNP
7164f680cc6SAli Bahrami 	};
7174f680cc6SAli Bahrami 	static const Msg	tags_relacount_nf[] = {
7184f680cc6SAli Bahrami 		MSG_DT_RELACOUNT_NF,		MSG_DT_RELCOUNT_NF,
7194f680cc6SAli Bahrami 		MSG_DT_FLAGS_1_NF,		MSG_DT_VERDEF_NF,
7204f680cc6SAli Bahrami 		MSG_DT_VERDEFNUM_NF,		MSG_DT_VERNEED_NF,
7214f680cc6SAli Bahrami 		MSG_DT_VERNEEDNUM_NF
722d579eb63Sab 	};
7234f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_relacount_cf = {
7244f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_RELACOUNT, tags_relacount_cf) };
7254f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_relacount_cfnp = {
7264f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_RELACOUNT, tags_relacount_cfnp) };
7274f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_relacount_nf = {
7284f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_RELACOUNT, tags_relacount_nf) };
729d579eb63Sab 
730d579eb63Sab 	/*
7314f680cc6SAli Bahrami 	 * DT_LOPROC - DT_HIPROC range: solaris/sparc-only
732d579eb63Sab 	 */
7334f680cc6SAli Bahrami 	static const Msg tags_sparc_reg_cf[] = { MSG_DT_SPARC_REGISTER_CF };
7344f680cc6SAli Bahrami 	static const Msg tags_sparc_reg_cfnp[] = { MSG_DT_SPARC_REGISTER_CFNP };
7354f680cc6SAli Bahrami 	static const Msg tags_sparc_reg_nf[] = { MSG_DT_SPARC_REGISTER_NF };
7364f680cc6SAli Bahrami 	static const Msg tags_sparc_reg_dmp[] = { MSG_DT_SPARC_REGISTER_DMP };
7374f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sparc_reg_cf = {
7384f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_cf) };
7394f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sparc_reg_cfnp = {
7404f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_cfnp) };
7414f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sparc_reg_nf = {
7424f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_nf) };
7434f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_sparc_reg_dmp = {
7444f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_dmp) };
7454f680cc6SAli Bahrami 
7464f680cc6SAli Bahrami 	/*
7474f680cc6SAli Bahrami 	 * DT_LOPROC - DT_HIPROC range: Solaris osabi, all hardware
7484f680cc6SAli Bahrami 	 */
7494f680cc6SAli Bahrami 	static const Msg	tags_auxiliary_cf[] = {
7504f680cc6SAli Bahrami 		MSG_DT_AUXILIARY_CF,	MSG_DT_USED_CF,
7514f680cc6SAli Bahrami 		MSG_DT_FILTER_CF
7524f680cc6SAli Bahrami 	};
7534f680cc6SAli Bahrami 	static const Msg	tags_auxiliary_cfnp[] = {
7544f680cc6SAli Bahrami 		MSG_DT_AUXILIARY_CFNP,	MSG_DT_USED_CFNP,
7554f680cc6SAli Bahrami 		MSG_DT_FILTER_CFNP
756d579eb63Sab 	};
7574f680cc6SAli Bahrami 	static const Msg	tags_auxiliary_nf[] = {
7584f680cc6SAli Bahrami 		MSG_DT_AUXILIARY_NF,	MSG_DT_USED_NF,
7594f680cc6SAli Bahrami 		MSG_DT_FILTER_NF
7604f680cc6SAli Bahrami 	};
7614f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_auxiliary_cf = {
7624f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_AUXILIARY, tags_auxiliary_cf) };
7634f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_auxiliary_cfnp = {
7644f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_AUXILIARY, tags_auxiliary_cfnp) };
7654f680cc6SAli Bahrami 	static const conv_ds_msg_t ds_auxiliary_nf = {
7664f680cc6SAli Bahrami 	    CONV_DS_MSG_INIT(DT_AUXILIARY, tags_auxiliary_nf) };
767d579eb63Sab 
768d579eb63Sab 
7694f680cc6SAli Bahrami 	static const conv_ds_t	*retarr[MAX_RET];
770d579eb63Sab 
7714f680cc6SAli Bahrami 	int	ndx = 0;
7724f680cc6SAli Bahrami 	int	fmt_osabi = CONV_TYPE_FMT_ALT(fmt_flags);
7734f680cc6SAli Bahrami 	int	mach_sparc, osabi_solaris, osabi_linux;
774d579eb63Sab 
7754f680cc6SAli Bahrami 
7764f680cc6SAli Bahrami 
7774f680cc6SAli Bahrami 	osabi_solaris = (osabi == ELFOSABI_NONE) ||
7784f680cc6SAli Bahrami 	    (osabi == ELFOSABI_SOLARIS) || (osabi == CONV_OSABI_ALL);
7794f680cc6SAli Bahrami 	osabi_linux = (osabi == ELFOSABI_LINUX) || (osabi == CONV_OSABI_ALL);
7804f680cc6SAli Bahrami 	mach_sparc = (mach == EM_SPARC) || (mach == EM_SPARCV9) ||
7814f680cc6SAli Bahrami 	    (mach == EM_SPARC32PLUS) || (mach == CONV_MACH_ALL);
782d579eb63Sab 
783d579eb63Sab 	/*
7844f680cc6SAli Bahrami 	 * Fill in retarr with the descriptors for the messages that
7854f680cc6SAli Bahrami 	 * apply to the current osabi. Note that we order these items such
7864f680cc6SAli Bahrami 	 * that the more common are placed at the beginning, and the less
7874f680cc6SAli Bahrami 	 * likely at the end. This should speed the common case.
7884f680cc6SAli Bahrami 	 *
7894f680cc6SAli Bahrami 	 * Note that the CFNP and DMP styles are very similar, so they
7904f680cc6SAli Bahrami 	 * are combined in 'default', and fmt_osabi is consulted when there
7914f680cc6SAli Bahrami 	 * are differences.
792d579eb63Sab 	 */
7934f680cc6SAli Bahrami 	switch (fmt_osabi) {
7944f680cc6SAli Bahrami 	case CONV_FMT_ALT_CF:
7954f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_null_cf);
7964f680cc6SAli Bahrami 		if (osabi_solaris)
7974f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_sunw_auxiliary_cf);
7984f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_checksum_cf);
7994f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_config_cf);
8004f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_versym_cf);
8014f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_relacount_cf);
8024f680cc6SAli Bahrami 		if (osabi_solaris) {
8034f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_auxiliary_cf);
8044f680cc6SAli Bahrami 			if (mach_sparc) {
8054f680cc6SAli Bahrami 				retarr[ndx++] = CONV_DS_ADDR(ds_sparc_reg_cf);
8064f680cc6SAli Bahrami 				retarr[ndx++] = CONV_DS_ADDR(ds_sdreg_cf);
8074f680cc6SAli Bahrami 			}
8084f680cc6SAli Bahrami 		}
8094f680cc6SAli Bahrami 		if (osabi_linux) {
8104f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_prelinked_cf);
8114f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_hash_cf);
8124f680cc6SAli Bahrami 		}
8134f680cc6SAli Bahrami 		break;
8144f680cc6SAli Bahrami 
8154f680cc6SAli Bahrami 	case CONV_FMT_ALT_NF:
8164f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_null_nf);
8174f680cc6SAli Bahrami 		if (osabi_solaris)
8184f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_sunw_auxiliary_nf);
8194f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_checksum_nf);
8204f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_config_nf);
8214f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_versym_nf);
8224f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_relacount_nf);
8234f680cc6SAli Bahrami 		if (osabi_solaris) {
8244f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_auxiliary_nf);
8254f680cc6SAli Bahrami 			if (mach_sparc) {
8264f680cc6SAli Bahrami 				retarr[ndx++] = CONV_DS_ADDR(ds_sparc_reg_nf);
8274f680cc6SAli Bahrami 				retarr[ndx++] = CONV_DS_ADDR(ds_sdreg_nf);
8284f680cc6SAli Bahrami 			}
8294f680cc6SAli Bahrami 		}
8304f680cc6SAli Bahrami 		if (osabi_linux) {
8314f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_prelinked_nf);
8324f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_hash_nf);
8334f680cc6SAli Bahrami 		}
8344f680cc6SAli Bahrami 		break;
8354f680cc6SAli Bahrami 	default:
8364f680cc6SAli Bahrami 		/*
8374f680cc6SAli Bahrami 		 * The default style for the generic range is CFNP,
8384f680cc6SAli Bahrami 		 * while dump has a couple of different strings.
8394f680cc6SAli Bahrami 		 */
8404f680cc6SAli Bahrami 
8414f680cc6SAli Bahrami 		retarr[ndx++] = (fmt_osabi == CONV_FMT_ALT_DUMP) ?
8424f680cc6SAli Bahrami 		    CONV_DS_ADDR(ds_null_dmp) : CONV_DS_ADDR(ds_null_cfnp);
8434f680cc6SAli Bahrami 		if (osabi_solaris)
8444f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_sunw_auxiliary_cfnp);
8454f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_checksum_cfnp);
8464f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_config_cfnp);
8474f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_versym_cfnp);
8484f680cc6SAli Bahrami 		retarr[ndx++] = CONV_DS_ADDR(ds_relacount_cfnp);
8494f680cc6SAli Bahrami 		if (osabi_solaris) {
8504f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_auxiliary_cfnp);
8514f680cc6SAli Bahrami 			if (mach_sparc) {
8524f680cc6SAli Bahrami 				/*
8534f680cc6SAli Bahrami 				 * The default style for DT_SPARC_REGISTER
8544f680cc6SAli Bahrami 				 * is the dump style, which omits the 'SPARC_'.
8554f680cc6SAli Bahrami 				 * CFNP keeps the prefix.
8564f680cc6SAli Bahrami 				 */
8574f680cc6SAli Bahrami 				retarr[ndx++] =
8584f680cc6SAli Bahrami 				    (fmt_osabi == CONV_FMT_ALT_CFNP) ?
8594f680cc6SAli Bahrami 				    CONV_DS_ADDR(ds_sparc_reg_cfnp) :
8604f680cc6SAli Bahrami 				    CONV_DS_ADDR(ds_sparc_reg_dmp);
8614f680cc6SAli Bahrami 				retarr[ndx++] = CONV_DS_ADDR(ds_sdreg_cfnp);
8624f680cc6SAli Bahrami 			}
8634f680cc6SAli Bahrami 		}
8644f680cc6SAli Bahrami 		if (osabi_linux) {
8654f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_prelinked_cfnp);
8664f680cc6SAli Bahrami 			retarr[ndx++] = CONV_DS_ADDR(ds_gnu_hash_cfnp);
8674f680cc6SAli Bahrami 		}
8684f680cc6SAli Bahrami 		break;
8694f680cc6SAli Bahrami 	}
870d579eb63Sab 
8714f680cc6SAli Bahrami 	retarr[ndx++] = NULL;
8724f680cc6SAli Bahrami 	assert(ndx <= MAX_RET);
8734f680cc6SAli Bahrami 	return (retarr);
8744f680cc6SAli Bahrami }
875d579eb63Sab 
8764f680cc6SAli Bahrami conv_iter_ret_t
8774f680cc6SAli Bahrami conv_iter_dyn_tag(conv_iter_osabi_t osabi, Half mach,
8784f680cc6SAli Bahrami     Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func, void *uvalue)
8794f680cc6SAli Bahrami {
8804f680cc6SAli Bahrami 	return (conv_iter_ds(osabi, mach,
8814f680cc6SAli Bahrami 	    conv_dyn_tag_strings(osabi, mach, fmt_flags), func, uvalue));
8827c478bd9Sstevel@tonic-gate }
883dffec89cSrie 
8844f680cc6SAli Bahrami 
8854f680cc6SAli Bahrami #define	BINDTSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE +			\
886ba4e3c84Sab 		MSG_BND_NEEDED_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
887ba4e3c84Sab 		MSG_BND_REFER_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
888ba4e3c84Sab 		MSG_BND_FILTER_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
889de777a60Sab 		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
890de777a60Sab 
891de777a60Sab /*
892de777a60Sab  * Ensure that Conv_bnd_type_buf_t is large enough:
893de777a60Sab  *
894de777a60Sab  * BINDTSZ is the real minimum size of the buffer required by conv_bnd_type().
895de777a60Sab  * However, Conv_bnd_type_buf_t uses CONV_BND_TYPE_BUFSIZE to set the
896de777a60Sab  * buffer size. We do things this way because the definition of BINDTSZ uses
897de777a60Sab  * information that is not available in the environment of other programs
898de777a60Sab  * that include the conv.h header file.
899de777a60Sab  */
9006a074c93Sab #if (CONV_BND_TYPE_BUFSIZE != BINDTSZ) && !defined(__lint)
9016a074c93Sab #define	REPORT_BUFSIZE BINDTSZ
9026a074c93Sab #include "report_bufsize.h"
9036a074c93Sab #error "CONV_BND_TYPE_BUFSIZE does not match BINDTSZ"
904de777a60Sab #endif
905dffec89cSrie 
906dffec89cSrie const char *
907de777a60Sab conv_bnd_type(uint_t flags, Conv_bnd_type_buf_t *bnd_type_buf)
908dffec89cSrie {
9094f680cc6SAli Bahrami 	static const Val_desc vda[] = {
9104f680cc6SAli Bahrami 		{ BND_NEEDED,		MSG_BND_NEEDED },
9114f680cc6SAli Bahrami 		{ BND_REFER,		MSG_BND_REFER },
9124f680cc6SAli Bahrami 		{ BND_FILTER,		MSG_BND_FILTER },
9135aefb655Srie 		{ 0,			0 }
9145aefb655Srie 	};
915de777a60Sab 	static CONV_EXPN_FIELD_ARG conv_arg = {
9164f680cc6SAli Bahrami 	    NULL, sizeof (bnd_type_buf->buf) };
917dffec89cSrie 
9185aefb655Srie 	if (flags == 0)
919dffec89cSrie 		return (MSG_ORIG(MSG_STR_EMPTY));
9205aefb655Srie 
921de777a60Sab 	conv_arg.buf = bnd_type_buf->buf;
922ba4e3c84Sab 	conv_arg.oflags = conv_arg.rflags = flags;
9234f680cc6SAli Bahrami 	(void) conv_expn_field(&conv_arg, vda, 0);
9245aefb655Srie 
925de777a60Sab 	return ((const char *)bnd_type_buf->buf);
926dffec89cSrie }
927dffec89cSrie 
92810a4fa49Srie /*
92910a4fa49Srie  * Note, conv_bnd_obj() is called with either:
93010a4fa49Srie  *	LML_FLG_OBJADDED (possibly with LML_FLG_OBJREEVAL added), or
93110a4fa49Srie  *	LML_FLG_OBJDELETED, or
93210a4fa49Srie  *	LML_FLG_ATEXIT.
93310a4fa49Srie  */
934ba4e3c84Sab #define	BINDOSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
935ba4e3c84Sab 		MSG_BND_ADDED_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
936ba4e3c84Sab 		MSG_BND_REEVAL_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
937de777a60Sab 		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
938de777a60Sab 
939de777a60Sab /*
940de777a60Sab  * Ensure that Conv_bnd_obj_buf_t is large enough:
941de777a60Sab  *
942de777a60Sab  * BINDOSZ is the real minimum size of the buffer required by conv_bnd_obj().
943de777a60Sab  * However, Conv_bnd_obj_buf_t uses CONV_BND_OBJ_BUFSIZE to set the
944de777a60Sab  * buffer size. We do things this way because the definition of BINDOSZ uses
945de777a60Sab  * information that is not available in the environment of other programs
946de777a60Sab  * that include the conv.h header file.
947de777a60Sab  */
9486a074c93Sab #if (CONV_BND_OBJ_BUFSIZE != BINDOSZ) && !defined(__lint)
9496a074c93Sab #define	REPORT_BUFSIZE BINDOSZ
9506a074c93Sab #include "report_bufsize.h"
9516a074c93Sab #error "CONV_BND_OBJ_BUFSIZE does not match BINDOSZ"
952de777a60Sab #endif
953dffec89cSrie 
954dffec89cSrie const char *
955de777a60Sab conv_bnd_obj(uint_t flags, Conv_bnd_obj_buf_t *bnd_obj_buf)
956dffec89cSrie {
9574f680cc6SAli Bahrami 	static const Val_desc vda[] = {
9584f680cc6SAli Bahrami 		{ LML_FLG_OBJADDED,	MSG_BND_ADDED },
9594f680cc6SAli Bahrami 		{ LML_FLG_OBJREEVAL,	MSG_BND_REEVAL },
9604f680cc6SAli Bahrami 		{ LML_FLG_OBJDELETED,	MSG_BND_DELETED },
9614f680cc6SAli Bahrami 		{ LML_FLG_ATEXIT,	MSG_BND_ATEXIT },
9625aefb655Srie 		{ 0,			0 }
9635aefb655Srie 	};
964de777a60Sab 	static CONV_EXPN_FIELD_ARG conv_arg = {
9654f680cc6SAli Bahrami 	    NULL, sizeof (bnd_obj_buf->buf) };
9665aefb655Srie 
96710a4fa49Srie 	if ((flags & (LML_FLG_OBJADDED | LML_FLG_OBJREEVAL |
96810a4fa49Srie 	    LML_FLG_OBJDELETED | LML_FLG_ATEXIT)) == 0)
96910a4fa49Srie 		return (MSG_ORIG(MSG_BND_REVISIT));
970dffec89cSrie 
971dffec89cSrie 	/*
9725aefb655Srie 	 * Note, we're not worried about unknown flags for this family, only
973ba4e3c84Sab 	 * the selected flags are of interest, so we leave conv_arg.rflags
974ba4e3c84Sab 	 * set to 0.
975dffec89cSrie 	 */
976de777a60Sab 	conv_arg.buf = bnd_obj_buf->buf;
977ba4e3c84Sab 	conv_arg.oflags = flags;
9784f680cc6SAli Bahrami 	(void) conv_expn_field(&conv_arg, vda, 0);
9795aefb655Srie 
980de777a60Sab 	return ((const char *)bnd_obj_buf->buf);
981dffec89cSrie }
982