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 /*
23f441771bSRod 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 *
conv_dyn_posflag1_strings(Conv_fmt_flags_t fmt_flags)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 + \
44f441771bSRod 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 },
65f441771bSRod Evans { DF_P1_GROUPPERM, MSG_DF_P1_GROUPPERM_DEF },
66f441771bSRod 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 },
72f441771bSRod 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 },
78f441771bSRod 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 },
84f441771bSRod 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
conv_iter_dyn_posflag1(Conv_fmt_flags_t fmt_flags,conv_iter_cb_t func,void * uvalue)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 *
conv_dyn_flag_strings(Conv_fmt_flags_t fmt_flags)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 + \
117*b6a0e2cdSRichard Lowe 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
conv_iter_dyn_flag(Conv_fmt_flags_t fmt_flags,conv_iter_cb_t func,void * uvalue)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 *
conv_dyn_flag1_strings(Conv_fmt_flags_t fmt_flags)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
conv_iter_dyn_flag1(Conv_fmt_flags_t fmt_flags,conv_iter_cb_t func,void * uvalue)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 *
conv_dyn_feature1_strings(Conv_fmt_flags_t fmt_flags)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
conv_iter_dyn_feature1(Conv_fmt_flags_t fmt_flags,conv_iter_cb_t func,void * uvalue)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 **
conv_dyn_tag_strings(conv_iter_osabi_t osabi,Half mach,Conv_fmt_flags_t fmt_flags)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,
559d2a70789SRichard Lowe MSG_DT_SUNW_CAPCHAINSZ_CF, 0,
560*b6a0e2cdSRichard Lowe 0, 0,
561*b6a0e2cdSRichard Lowe MSG_DT_SUNW_ASLR_CF, 0,
562*b6a0e2cdSRichard Lowe 0, 0,
563*b6a0e2cdSRichard Lowe MSG_DT_SUNW_KMOD_CF
5644f680cc6SAli Bahrami };
5654f680cc6SAli Bahrami static const Msg tags_sunw_auxiliary_cfnp[] = {
5664f680cc6SAli Bahrami MSG_DT_SUNW_AUXILIARY_CFNP, MSG_DT_SUNW_RTLDINF_CFNP,
5674f680cc6SAli Bahrami MSG_DT_SUNW_FILTER_CFNP, MSG_DT_SUNW_CAP_CFNP,
5684f680cc6SAli Bahrami MSG_DT_SUNW_SYMTAB_CFNP, MSG_DT_SUNW_SYMSZ_CFNP,
5694f680cc6SAli Bahrami MSG_DT_SUNW_SORTENT_CFNP, MSG_DT_SUNW_SYMSORT_CFNP,
5704f680cc6SAli Bahrami MSG_DT_SUNW_SYMSORTSZ_CFNP, MSG_DT_SUNW_TLSSORT_CFNP,
57108278a5eSRod Evans MSG_DT_SUNW_TLSSORTSZ_CFNP, MSG_DT_SUNW_CAPINFO_CFNP,
57208278a5eSRod Evans MSG_DT_SUNW_STRPAD_CFNP, MSG_DT_SUNW_CAPCHAIN_CFNP,
57308278a5eSRod Evans MSG_DT_SUNW_LDMACH_CFNP, 0,
57408278a5eSRod Evans MSG_DT_SUNW_CAPCHAINENT_CFNP, 0,
575d2a70789SRichard Lowe MSG_DT_SUNW_CAPCHAINSZ_CFNP, 0,
576d2a70789SRichard Lowe 0, 0,
577*b6a0e2cdSRichard Lowe MSG_DT_SUNW_ASLR_CFNP, 0,
578*b6a0e2cdSRichard Lowe 0, 0,
579*b6a0e2cdSRichard Lowe MSG_DT_SUNW_KMOD_CFNP
5804f680cc6SAli Bahrami };
5814f680cc6SAli Bahrami static const Msg tags_sunw_auxiliary_nf[] = {
5824f680cc6SAli Bahrami MSG_DT_SUNW_AUXILIARY_NF, MSG_DT_SUNW_RTLDINF_NF,
5834f680cc6SAli Bahrami MSG_DT_SUNW_FILTER_NF, MSG_DT_SUNW_CAP_NF,
5844f680cc6SAli Bahrami MSG_DT_SUNW_SYMTAB_NF, MSG_DT_SUNW_SYMSZ_NF,
5854f680cc6SAli Bahrami MSG_DT_SUNW_SORTENT_NF, MSG_DT_SUNW_SYMSORT_NF,
5864f680cc6SAli Bahrami MSG_DT_SUNW_SYMSORTSZ_NF, MSG_DT_SUNW_TLSSORT_NF,
58708278a5eSRod Evans MSG_DT_SUNW_TLSSORTSZ_NF, MSG_DT_SUNW_CAPINFO_NF,
58808278a5eSRod Evans MSG_DT_SUNW_STRPAD_NF, MSG_DT_SUNW_CAPCHAIN_NF,
58908278a5eSRod Evans MSG_DT_SUNW_LDMACH_NF, 0,
59008278a5eSRod Evans MSG_DT_SUNW_CAPCHAINENT_NF, 0,
591d2a70789SRichard Lowe MSG_DT_SUNW_CAPCHAINSZ_NF, 0,
592d2a70789SRichard Lowe 0, 0,
593*b6a0e2cdSRichard Lowe MSG_DT_SUNW_ASLR_NF, 0,
594*b6a0e2cdSRichard Lowe 0, 0,
595*b6a0e2cdSRichard Lowe MSG_DT_SUNW_KMOD_NF
5964f680cc6SAli Bahrami };
5974f680cc6SAli Bahrami static const conv_ds_msg_t ds_sunw_auxiliary_cf = {
5984f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_SUNW_AUXILIARY, tags_sunw_auxiliary_cf) };
5994f680cc6SAli Bahrami static const conv_ds_msg_t ds_sunw_auxiliary_cfnp = {
6004f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_SUNW_AUXILIARY, tags_sunw_auxiliary_cfnp) };
6014f680cc6SAli Bahrami static const conv_ds_msg_t ds_sunw_auxiliary_nf = {
6024f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_SUNW_AUXILIARY, tags_sunw_auxiliary_nf) };
6034f680cc6SAli Bahrami
6044f680cc6SAli Bahrami /*
6054f680cc6SAli Bahrami * GNU: (In DT_VALRNGLO section) DT_GNU_PRELINKED - DT_GNU_LIBLISTSZ
6064f680cc6SAli Bahrami */
6074f680cc6SAli Bahrami static const Msg tags_gnu_prelinked_cf[] = {
6084f680cc6SAli Bahrami MSG_DT_GNU_PRELINKED_CF, MSG_DT_GNU_CONFLICTSZ_CF,
6094f680cc6SAli Bahrami MSG_DT_GNU_LIBLISTSZ_CF
6104f680cc6SAli Bahrami };
6114f680cc6SAli Bahrami static const Msg tags_gnu_prelinked_cfnp[] = {
6124f680cc6SAli Bahrami MSG_DT_GNU_PRELINKED_CFNP, MSG_DT_GNU_CONFLICTSZ_CFNP,
6134f680cc6SAli Bahrami MSG_DT_GNU_LIBLISTSZ_CFNP
6144f680cc6SAli Bahrami };
6154f680cc6SAli Bahrami static const Msg tags_gnu_prelinked_nf[] = {
6164f680cc6SAli Bahrami MSG_DT_GNU_PRELINKED_NF, MSG_DT_GNU_CONFLICTSZ_NF,
6174f680cc6SAli Bahrami MSG_DT_GNU_LIBLISTSZ_NF
618d579eb63Sab };
6194f680cc6SAli Bahrami static const conv_ds_msg_t ds_gnu_prelinked_cf = {
6204f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_GNU_PRELINKED, tags_gnu_prelinked_cf) };
6214f680cc6SAli Bahrami static const conv_ds_msg_t ds_gnu_prelinked_cfnp = {
6224f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_GNU_PRELINKED, tags_gnu_prelinked_cfnp) };
6234f680cc6SAli Bahrami static const conv_ds_msg_t ds_gnu_prelinked_nf = {
6244f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_GNU_PRELINKED, tags_gnu_prelinked_nf) };
625d579eb63Sab
626d579eb63Sab /*
627d579eb63Sab * SUNW: DT_VALRNGLO - DT_VALRNGHI range.
628d579eb63Sab */
6294f680cc6SAli Bahrami static const Msg tags_checksum_cf[] = {
6304f680cc6SAli Bahrami MSG_DT_CHECKSUM_CF, MSG_DT_PLTPADSZ_CF,
6314f680cc6SAli Bahrami MSG_DT_MOVEENT_CF, MSG_DT_MOVESZ_CF,
6324f680cc6SAli Bahrami MSG_DT_FEATURE_1_CF, MSG_DT_POSFLAG_1_CF,
6334f680cc6SAli Bahrami MSG_DT_SYMINSZ_CF, MSG_DT_SYMINENT_CF
634d579eb63Sab };
6354f680cc6SAli Bahrami static const Msg tags_checksum_cfnp[] = {
6364f680cc6SAli Bahrami MSG_DT_CHECKSUM_CFNP, MSG_DT_PLTPADSZ_CFNP,
6374f680cc6SAli Bahrami MSG_DT_MOVEENT_CFNP, MSG_DT_MOVESZ_CFNP,
6384f680cc6SAli Bahrami MSG_DT_FEATURE_1_CFNP, MSG_DT_POSFLAG_1_CFNP,
6394f680cc6SAli Bahrami MSG_DT_SYMINSZ_CFNP, MSG_DT_SYMINENT_CFNP
6404f680cc6SAli Bahrami };
6414f680cc6SAli Bahrami static const Msg tags_checksum_nf[] = {
6424f680cc6SAli Bahrami MSG_DT_CHECKSUM_NF, MSG_DT_PLTPADSZ_NF,
6434f680cc6SAli Bahrami MSG_DT_MOVEENT_NF, MSG_DT_MOVESZ_NF,
6444f680cc6SAli Bahrami MSG_DT_FEATURE_1_NF, MSG_DT_POSFLAG_1_NF,
6454f680cc6SAli Bahrami MSG_DT_SYMINSZ_NF, MSG_DT_SYMINENT_NF
6464f680cc6SAli Bahrami };
6474f680cc6SAli Bahrami static const conv_ds_msg_t ds_checksum_cf = {
6484f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_CHECKSUM, tags_checksum_cf) };
6494f680cc6SAli Bahrami static const conv_ds_msg_t ds_checksum_cfnp = {
6504f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_CHECKSUM, tags_checksum_cfnp) };
6514f680cc6SAli Bahrami static const conv_ds_msg_t ds_checksum_nf = {
6524f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_CHECKSUM, tags_checksum_nf) };
6534f680cc6SAli Bahrami
6544f680cc6SAli Bahrami /*
6554f680cc6SAli Bahrami * GNU: (In DT_ADDRRNGLO section) DT_GNU_HASH - DT_GNU_LIBLIST
6564f680cc6SAli Bahrami */
6574f680cc6SAli Bahrami static const Msg tags_gnu_hash_cf[] = {
6584f680cc6SAli Bahrami MSG_DT_GNU_HASH_CF, MSG_DT_TLSDESC_PLT_CF,
6594f680cc6SAli Bahrami MSG_DT_TLSDESC_GOT_CF, MSG_DT_GNU_CONFLICT_CF,
6604f680cc6SAli Bahrami MSG_DT_GNU_LIBLIST_CF
6614f680cc6SAli Bahrami };
6624f680cc6SAli Bahrami static const Msg tags_gnu_hash_cfnp[] = {
6634f680cc6SAli Bahrami MSG_DT_GNU_HASH_CFNP, MSG_DT_TLSDESC_PLT_CFNP,
6644f680cc6SAli Bahrami MSG_DT_TLSDESC_GOT_CFNP, MSG_DT_GNU_CONFLICT_CFNP,
6654f680cc6SAli Bahrami MSG_DT_GNU_LIBLIST_CFNP
6664f680cc6SAli Bahrami };
6674f680cc6SAli Bahrami static const Msg tags_gnu_hash_nf[] = {
6684f680cc6SAli Bahrami MSG_DT_GNU_HASH_NF, MSG_DT_TLSDESC_PLT_NF,
6694f680cc6SAli Bahrami MSG_DT_TLSDESC_GOT_NF, MSG_DT_GNU_CONFLICT_NF,
6704f680cc6SAli Bahrami MSG_DT_GNU_LIBLIST_NF
6714f680cc6SAli Bahrami };
6724f680cc6SAli Bahrami static const conv_ds_msg_t ds_gnu_hash_cf = {
6734f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_GNU_HASH, tags_gnu_hash_cf) };
6744f680cc6SAli Bahrami static const conv_ds_msg_t ds_gnu_hash_cfnp = {
6754f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_GNU_HASH, tags_gnu_hash_cfnp) };
6764f680cc6SAli Bahrami static const conv_ds_msg_t ds_gnu_hash_nf = {
6774f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_GNU_HASH, tags_gnu_hash_nf) };
678d579eb63Sab
679d579eb63Sab /*
680d579eb63Sab * SUNW: DT_ADDRRNGLO - DT_ADDRRNGHI range.
681d579eb63Sab */
6824f680cc6SAli Bahrami static const Msg tags_config_cf[] = {
6834f680cc6SAli Bahrami MSG_DT_CONFIG_CF, MSG_DT_DEPAUDIT_CF,
6844f680cc6SAli Bahrami MSG_DT_AUDIT_CF, MSG_DT_PLTPAD_CF,
6854f680cc6SAli Bahrami MSG_DT_MOVETAB_CF, MSG_DT_SYMINFO_CF
6864f680cc6SAli Bahrami };
6874f680cc6SAli Bahrami static const Msg tags_config_cfnp[] = {
6884f680cc6SAli Bahrami MSG_DT_CONFIG_CFNP, MSG_DT_DEPAUDIT_CFNP,
6894f680cc6SAli Bahrami MSG_DT_AUDIT_CFNP, MSG_DT_PLTPAD_CFNP,
6904f680cc6SAli Bahrami MSG_DT_MOVETAB_CFNP, MSG_DT_SYMINFO_CFNP
691d579eb63Sab };
6924f680cc6SAli Bahrami static const Msg tags_config_nf[] = {
6934f680cc6SAli Bahrami MSG_DT_CONFIG_NF, MSG_DT_DEPAUDIT_NF,
6944f680cc6SAli Bahrami MSG_DT_AUDIT_NF, MSG_DT_PLTPAD_NF,
6954f680cc6SAli Bahrami MSG_DT_MOVETAB_NF, MSG_DT_SYMINFO_NF
6964f680cc6SAli Bahrami };
6974f680cc6SAli Bahrami static const conv_ds_msg_t ds_config_cf = {
6984f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_CONFIG, tags_config_cf) };
6994f680cc6SAli Bahrami static const conv_ds_msg_t ds_config_cfnp = {
7004f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_CONFIG, tags_config_cfnp) };
7014f680cc6SAli Bahrami static const conv_ds_msg_t ds_config_nf = {
7024f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_CONFIG, tags_config_nf) };
703d579eb63Sab
704d579eb63Sab /*
705d579eb63Sab * SUNW: generic range. Note hole between DT_VERSYM and DT_RELACOUNT.
706d579eb63Sab */
7074f680cc6SAli Bahrami static const Msg tags_versym_cf[] = { MSG_DT_VERSYM_CF };
7084f680cc6SAli Bahrami static const Msg tags_versym_cfnp[] = { MSG_DT_VERSYM_CFNP };
7094f680cc6SAli Bahrami static const Msg tags_versym_nf[] = { MSG_DT_VERSYM_NF };
7104f680cc6SAli Bahrami static const conv_ds_msg_t ds_versym_cf = {
7114f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_VERSYM, tags_versym_cf) };
7124f680cc6SAli Bahrami static const conv_ds_msg_t ds_versym_cfnp = {
7134f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_VERSYM, tags_versym_cfnp) };
7144f680cc6SAli Bahrami static const conv_ds_msg_t ds_versym_nf = {
7154f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_VERSYM, tags_versym_nf) };
7164f680cc6SAli Bahrami
7174f680cc6SAli Bahrami static const Msg tags_relacount_cf[] = {
7184f680cc6SAli Bahrami MSG_DT_RELACOUNT_CF, MSG_DT_RELCOUNT_CF,
7194f680cc6SAli Bahrami MSG_DT_FLAGS_1_CF, MSG_DT_VERDEF_CF,
7204f680cc6SAli Bahrami MSG_DT_VERDEFNUM_CF, MSG_DT_VERNEED_CF,
7214f680cc6SAli Bahrami MSG_DT_VERNEEDNUM_CF
7224f680cc6SAli Bahrami };
7234f680cc6SAli Bahrami static const Msg tags_relacount_cfnp[] = {
7244f680cc6SAli Bahrami MSG_DT_RELACOUNT_CFNP, MSG_DT_RELCOUNT_CFNP,
7254f680cc6SAli Bahrami MSG_DT_FLAGS_1_CFNP, MSG_DT_VERDEF_CFNP,
7264f680cc6SAli Bahrami MSG_DT_VERDEFNUM_CFNP, MSG_DT_VERNEED_CFNP,
7274f680cc6SAli Bahrami MSG_DT_VERNEEDNUM_CFNP
7284f680cc6SAli Bahrami };
7294f680cc6SAli Bahrami static const Msg tags_relacount_nf[] = {
7304f680cc6SAli Bahrami MSG_DT_RELACOUNT_NF, MSG_DT_RELCOUNT_NF,
7314f680cc6SAli Bahrami MSG_DT_FLAGS_1_NF, MSG_DT_VERDEF_NF,
7324f680cc6SAli Bahrami MSG_DT_VERDEFNUM_NF, MSG_DT_VERNEED_NF,
7334f680cc6SAli Bahrami MSG_DT_VERNEEDNUM_NF
734d579eb63Sab };
7354f680cc6SAli Bahrami static const conv_ds_msg_t ds_relacount_cf = {
7364f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_RELACOUNT, tags_relacount_cf) };
7374f680cc6SAli Bahrami static const conv_ds_msg_t ds_relacount_cfnp = {
7384f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_RELACOUNT, tags_relacount_cfnp) };
7394f680cc6SAli Bahrami static const conv_ds_msg_t ds_relacount_nf = {
7404f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_RELACOUNT, tags_relacount_nf) };
741d579eb63Sab
742d579eb63Sab /*
7434f680cc6SAli Bahrami * DT_LOPROC - DT_HIPROC range: solaris/sparc-only
744d579eb63Sab */
7454f680cc6SAli Bahrami static const Msg tags_sparc_reg_cf[] = { MSG_DT_SPARC_REGISTER_CF };
7464f680cc6SAli Bahrami static const Msg tags_sparc_reg_cfnp[] = { MSG_DT_SPARC_REGISTER_CFNP };
7474f680cc6SAli Bahrami static const Msg tags_sparc_reg_nf[] = { MSG_DT_SPARC_REGISTER_NF };
7484f680cc6SAli Bahrami static const Msg tags_sparc_reg_dmp[] = { MSG_DT_SPARC_REGISTER_DMP };
7494f680cc6SAli Bahrami static const conv_ds_msg_t ds_sparc_reg_cf = {
7504f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_cf) };
7514f680cc6SAli Bahrami static const conv_ds_msg_t ds_sparc_reg_cfnp = {
7524f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_cfnp) };
7534f680cc6SAli Bahrami static const conv_ds_msg_t ds_sparc_reg_nf = {
7544f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_nf) };
7554f680cc6SAli Bahrami static const conv_ds_msg_t ds_sparc_reg_dmp = {
7564f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_SPARC_REGISTER, tags_sparc_reg_dmp) };
7574f680cc6SAli Bahrami
7584f680cc6SAli Bahrami /*
7594f680cc6SAli Bahrami * DT_LOPROC - DT_HIPROC range: Solaris osabi, all hardware
7604f680cc6SAli Bahrami */
7614f680cc6SAli Bahrami static const Msg tags_auxiliary_cf[] = {
7624f680cc6SAli Bahrami MSG_DT_AUXILIARY_CF, MSG_DT_USED_CF,
7634f680cc6SAli Bahrami MSG_DT_FILTER_CF
7644f680cc6SAli Bahrami };
7654f680cc6SAli Bahrami static const Msg tags_auxiliary_cfnp[] = {
7664f680cc6SAli Bahrami MSG_DT_AUXILIARY_CFNP, MSG_DT_USED_CFNP,
7674f680cc6SAli Bahrami MSG_DT_FILTER_CFNP
768d579eb63Sab };
7694f680cc6SAli Bahrami static const Msg tags_auxiliary_nf[] = {
7704f680cc6SAli Bahrami MSG_DT_AUXILIARY_NF, MSG_DT_USED_NF,
7714f680cc6SAli Bahrami MSG_DT_FILTER_NF
7724f680cc6SAli Bahrami };
7734f680cc6SAli Bahrami static const conv_ds_msg_t ds_auxiliary_cf = {
7744f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_AUXILIARY, tags_auxiliary_cf) };
7754f680cc6SAli Bahrami static const conv_ds_msg_t ds_auxiliary_cfnp = {
7764f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_AUXILIARY, tags_auxiliary_cfnp) };
7774f680cc6SAli Bahrami static const conv_ds_msg_t ds_auxiliary_nf = {
7784f680cc6SAli Bahrami CONV_DS_MSG_INIT(DT_AUXILIARY, tags_auxiliary_nf) };
779d579eb63Sab
780d579eb63Sab
7814f680cc6SAli Bahrami static const conv_ds_t *retarr[MAX_RET];
782d579eb63Sab
7834f680cc6SAli Bahrami int ndx = 0;
7844f680cc6SAli Bahrami int fmt_osabi = CONV_TYPE_FMT_ALT(fmt_flags);
7854f680cc6SAli Bahrami int mach_sparc, osabi_solaris, osabi_linux;
786d579eb63Sab
7874f680cc6SAli Bahrami
7884f680cc6SAli Bahrami
7894f680cc6SAli Bahrami osabi_solaris = (osabi == ELFOSABI_NONE) ||
7904f680cc6SAli Bahrami (osabi == ELFOSABI_SOLARIS) || (osabi == CONV_OSABI_ALL);
7914f680cc6SAli Bahrami osabi_linux = (osabi == ELFOSABI_LINUX) || (osabi == CONV_OSABI_ALL);
7924f680cc6SAli Bahrami mach_sparc = (mach == EM_SPARC) || (mach == EM_SPARCV9) ||
7934f680cc6SAli Bahrami (mach == EM_SPARC32PLUS) || (mach == CONV_MACH_ALL);
794d579eb63Sab
795d579eb63Sab /*
7964f680cc6SAli Bahrami * Fill in retarr with the descriptors for the messages that
7974f680cc6SAli Bahrami * apply to the current osabi. Note that we order these items such
7984f680cc6SAli Bahrami * that the more common are placed at the beginning, and the less
7994f680cc6SAli Bahrami * likely at the end. This should speed the common case.
8004f680cc6SAli Bahrami *
8014f680cc6SAli Bahrami * Note that the CFNP and DMP styles are very similar, so they
8024f680cc6SAli Bahrami * are combined in 'default', and fmt_osabi is consulted when there
8034f680cc6SAli Bahrami * are differences.
804d579eb63Sab */
8054f680cc6SAli Bahrami switch (fmt_osabi) {
8064f680cc6SAli Bahrami case CONV_FMT_ALT_CF:
8074f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_null_cf);
8084f680cc6SAli Bahrami if (osabi_solaris)
8094f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_sunw_auxiliary_cf);
8104f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_checksum_cf);
8114f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_config_cf);
8124f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_versym_cf);
8134f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_relacount_cf);
8144f680cc6SAli Bahrami if (osabi_solaris) {
8154f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_auxiliary_cf);
8164f680cc6SAli Bahrami if (mach_sparc) {
8174f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_sparc_reg_cf);
8184f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_sdreg_cf);
8194f680cc6SAli Bahrami }
8204f680cc6SAli Bahrami }
8214f680cc6SAli Bahrami if (osabi_linux) {
8224f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_gnu_prelinked_cf);
8234f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_gnu_hash_cf);
8244f680cc6SAli Bahrami }
8254f680cc6SAli Bahrami break;
8264f680cc6SAli Bahrami
8274f680cc6SAli Bahrami case CONV_FMT_ALT_NF:
8284f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_null_nf);
8294f680cc6SAli Bahrami if (osabi_solaris)
8304f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_sunw_auxiliary_nf);
8314f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_checksum_nf);
8324f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_config_nf);
8334f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_versym_nf);
8344f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_relacount_nf);
8354f680cc6SAli Bahrami if (osabi_solaris) {
8364f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_auxiliary_nf);
8374f680cc6SAli Bahrami if (mach_sparc) {
8384f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_sparc_reg_nf);
8394f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_sdreg_nf);
8404f680cc6SAli Bahrami }
8414f680cc6SAli Bahrami }
8424f680cc6SAli Bahrami if (osabi_linux) {
8434f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_gnu_prelinked_nf);
8444f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_gnu_hash_nf);
8454f680cc6SAli Bahrami }
8464f680cc6SAli Bahrami break;
8474f680cc6SAli Bahrami default:
8484f680cc6SAli Bahrami /*
8494f680cc6SAli Bahrami * The default style for the generic range is CFNP,
8504f680cc6SAli Bahrami * while dump has a couple of different strings.
8514f680cc6SAli Bahrami */
8524f680cc6SAli Bahrami
8534f680cc6SAli Bahrami retarr[ndx++] = (fmt_osabi == CONV_FMT_ALT_DUMP) ?
8544f680cc6SAli Bahrami CONV_DS_ADDR(ds_null_dmp) : CONV_DS_ADDR(ds_null_cfnp);
8554f680cc6SAli Bahrami if (osabi_solaris)
8564f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_sunw_auxiliary_cfnp);
8574f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_checksum_cfnp);
8584f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_config_cfnp);
8594f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_versym_cfnp);
8604f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_relacount_cfnp);
8614f680cc6SAli Bahrami if (osabi_solaris) {
8624f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_auxiliary_cfnp);
8634f680cc6SAli Bahrami if (mach_sparc) {
8644f680cc6SAli Bahrami /*
8654f680cc6SAli Bahrami * The default style for DT_SPARC_REGISTER
8664f680cc6SAli Bahrami * is the dump style, which omits the 'SPARC_'.
8674f680cc6SAli Bahrami * CFNP keeps the prefix.
8684f680cc6SAli Bahrami */
8694f680cc6SAli Bahrami retarr[ndx++] =
8704f680cc6SAli Bahrami (fmt_osabi == CONV_FMT_ALT_CFNP) ?
8714f680cc6SAli Bahrami CONV_DS_ADDR(ds_sparc_reg_cfnp) :
8724f680cc6SAli Bahrami CONV_DS_ADDR(ds_sparc_reg_dmp);
8734f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_sdreg_cfnp);
8744f680cc6SAli Bahrami }
8754f680cc6SAli Bahrami }
8764f680cc6SAli Bahrami if (osabi_linux) {
8774f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_gnu_prelinked_cfnp);
8784f680cc6SAli Bahrami retarr[ndx++] = CONV_DS_ADDR(ds_gnu_hash_cfnp);
8794f680cc6SAli Bahrami }
8804f680cc6SAli Bahrami break;
8814f680cc6SAli Bahrami }
882d579eb63Sab
8834f680cc6SAli Bahrami retarr[ndx++] = NULL;
8844f680cc6SAli Bahrami assert(ndx <= MAX_RET);
8854f680cc6SAli Bahrami return (retarr);
8864f680cc6SAli Bahrami }
887d579eb63Sab
8884f680cc6SAli Bahrami conv_iter_ret_t
conv_iter_dyn_tag(conv_iter_osabi_t osabi,Half mach,Conv_fmt_flags_t fmt_flags,conv_iter_cb_t func,void * uvalue)8894f680cc6SAli Bahrami conv_iter_dyn_tag(conv_iter_osabi_t osabi, Half mach,
8904f680cc6SAli Bahrami Conv_fmt_flags_t fmt_flags, conv_iter_cb_t func, void *uvalue)
8914f680cc6SAli Bahrami {
8924f680cc6SAli Bahrami return (conv_iter_ds(osabi, mach,
8934f680cc6SAli Bahrami conv_dyn_tag_strings(osabi, mach, fmt_flags), func, uvalue));
8947c478bd9Sstevel@tonic-gate }
895dffec89cSrie
8964f680cc6SAli Bahrami
8974f680cc6SAli Bahrami #define BINDTSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
898ba4e3c84Sab MSG_BND_NEEDED_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
899ba4e3c84Sab MSG_BND_REFER_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
900ba4e3c84Sab MSG_BND_FILTER_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
901de777a60Sab CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
902de777a60Sab
903de777a60Sab /*
904de777a60Sab * Ensure that Conv_bnd_type_buf_t is large enough:
905de777a60Sab *
906de777a60Sab * BINDTSZ is the real minimum size of the buffer required by conv_bnd_type().
907de777a60Sab * However, Conv_bnd_type_buf_t uses CONV_BND_TYPE_BUFSIZE to set the
908de777a60Sab * buffer size. We do things this way because the definition of BINDTSZ uses
909de777a60Sab * information that is not available in the environment of other programs
910de777a60Sab * that include the conv.h header file.
911de777a60Sab */
9126a074c93Sab #if (CONV_BND_TYPE_BUFSIZE != BINDTSZ) && !defined(__lint)
9136a074c93Sab #define REPORT_BUFSIZE BINDTSZ
9146a074c93Sab #include "report_bufsize.h"
9156a074c93Sab #error "CONV_BND_TYPE_BUFSIZE does not match BINDTSZ"
916de777a60Sab #endif
917dffec89cSrie
918dffec89cSrie const char *
conv_bnd_type(uint_t flags,Conv_bnd_type_buf_t * bnd_type_buf)919de777a60Sab conv_bnd_type(uint_t flags, Conv_bnd_type_buf_t *bnd_type_buf)
920dffec89cSrie {
9214f680cc6SAli Bahrami static const Val_desc vda[] = {
9224f680cc6SAli Bahrami { BND_NEEDED, MSG_BND_NEEDED },
9234f680cc6SAli Bahrami { BND_REFER, MSG_BND_REFER },
9244f680cc6SAli Bahrami { BND_FILTER, MSG_BND_FILTER },
9255aefb655Srie { 0, 0 }
9265aefb655Srie };
927de777a60Sab static CONV_EXPN_FIELD_ARG conv_arg = {
9284f680cc6SAli Bahrami NULL, sizeof (bnd_type_buf->buf) };
929dffec89cSrie
9305aefb655Srie if (flags == 0)
931dffec89cSrie return (MSG_ORIG(MSG_STR_EMPTY));
9325aefb655Srie
933de777a60Sab conv_arg.buf = bnd_type_buf->buf;
934ba4e3c84Sab conv_arg.oflags = conv_arg.rflags = flags;
9354f680cc6SAli Bahrami (void) conv_expn_field(&conv_arg, vda, 0);
9365aefb655Srie
937de777a60Sab return ((const char *)bnd_type_buf->buf);
938dffec89cSrie }
939dffec89cSrie
94010a4fa49Srie /*
94110a4fa49Srie * Note, conv_bnd_obj() is called with either:
94210a4fa49Srie * LML_FLG_OBJADDED (possibly with LML_FLG_OBJREEVAL added), or
94310a4fa49Srie * LML_FLG_OBJDELETED, or
94410a4fa49Srie * LML_FLG_ATEXIT.
94510a4fa49Srie */
946ba4e3c84Sab #define BINDOSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
947ba4e3c84Sab MSG_BND_ADDED_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
948ba4e3c84Sab MSG_BND_REEVAL_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
949de777a60Sab CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
950de777a60Sab
951de777a60Sab /*
952de777a60Sab * Ensure that Conv_bnd_obj_buf_t is large enough:
953de777a60Sab *
954de777a60Sab * BINDOSZ is the real minimum size of the buffer required by conv_bnd_obj().
955de777a60Sab * However, Conv_bnd_obj_buf_t uses CONV_BND_OBJ_BUFSIZE to set the
956de777a60Sab * buffer size. We do things this way because the definition of BINDOSZ uses
957de777a60Sab * information that is not available in the environment of other programs
958de777a60Sab * that include the conv.h header file.
959de777a60Sab */
9606a074c93Sab #if (CONV_BND_OBJ_BUFSIZE != BINDOSZ) && !defined(__lint)
9616a074c93Sab #define REPORT_BUFSIZE BINDOSZ
9626a074c93Sab #include "report_bufsize.h"
9636a074c93Sab #error "CONV_BND_OBJ_BUFSIZE does not match BINDOSZ"
964de777a60Sab #endif
965dffec89cSrie
966dffec89cSrie const char *
conv_bnd_obj(uint_t flags,Conv_bnd_obj_buf_t * bnd_obj_buf)967de777a60Sab conv_bnd_obj(uint_t flags, Conv_bnd_obj_buf_t *bnd_obj_buf)
968dffec89cSrie {
9694f680cc6SAli Bahrami static const Val_desc vda[] = {
9704f680cc6SAli Bahrami { LML_FLG_OBJADDED, MSG_BND_ADDED },
9714f680cc6SAli Bahrami { LML_FLG_OBJREEVAL, MSG_BND_REEVAL },
9724f680cc6SAli Bahrami { LML_FLG_OBJDELETED, MSG_BND_DELETED },
9734f680cc6SAli Bahrami { LML_FLG_ATEXIT, MSG_BND_ATEXIT },
9745aefb655Srie { 0, 0 }
9755aefb655Srie };
976de777a60Sab static CONV_EXPN_FIELD_ARG conv_arg = {
9774f680cc6SAli Bahrami NULL, sizeof (bnd_obj_buf->buf) };
9785aefb655Srie
97910a4fa49Srie if ((flags & (LML_FLG_OBJADDED | LML_FLG_OBJREEVAL |
98010a4fa49Srie LML_FLG_OBJDELETED | LML_FLG_ATEXIT)) == 0)
98110a4fa49Srie return (MSG_ORIG(MSG_BND_REVISIT));
982dffec89cSrie
983dffec89cSrie /*
9845aefb655Srie * Note, we're not worried about unknown flags for this family, only
985ba4e3c84Sab * the selected flags are of interest, so we leave conv_arg.rflags
986ba4e3c84Sab * set to 0.
987dffec89cSrie */
988de777a60Sab conv_arg.buf = bnd_obj_buf->buf;
989ba4e3c84Sab conv_arg.oflags = flags;
9904f680cc6SAli Bahrami (void) conv_expn_field(&conv_arg, vda, 0);
9915aefb655Srie
992de777a60Sab return ((const char *)bnd_obj_buf->buf);
993dffec89cSrie }
994