10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 51618Srie * Common Development and Distribution License (the "License"). 61618Srie * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 211618Srie 220Sstevel@tonic-gate /* 233466Srie * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 240Sstevel@tonic-gate * Use is subject to license terms. 250Sstevel@tonic-gate */ 260Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 270Sstevel@tonic-gate 280Sstevel@tonic-gate /* 290Sstevel@tonic-gate * String conversion routine for .dynamic tag entries. 300Sstevel@tonic-gate */ 310Sstevel@tonic-gate #include <stdio.h> 320Sstevel@tonic-gate #include <string.h> 330Sstevel@tonic-gate #include <sys/elf_SPARC.h> 34280Srie #include "rtld.h" 350Sstevel@tonic-gate #include "_conv.h" 360Sstevel@tonic-gate #include "dynamic_msg.h" 370Sstevel@tonic-gate 383492Sab196087 393492Sab196087 403492Sab196087 /* Instantiate a local copy of conv_map2str() from _conv.h */ 413492Sab196087 DEFINE_conv_map2str 423492Sab196087 433492Sab196087 443492Sab196087 452352Sab196087 #define POSSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \ 462352Sab196087 MSG_DFP_LAZYLOAD_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 472352Sab196087 MSG_DFP_GROUPPERM_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 482352Sab196087 CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE 490Sstevel@tonic-gate 500Sstevel@tonic-gate const char * 512352Sab196087 conv_dyn_posflag1(Xword flags, int fmt_flags) 520Sstevel@tonic-gate { 531618Srie static char string[POSSZ]; 541618Srie static Val_desc vda[] = { 551618Srie { DF_P1_LAZYLOAD, MSG_ORIG(MSG_DFP_LAZYLOAD) }, 561618Srie { DF_P1_GROUPPERM, MSG_ORIG(MSG_DFP_GROUPPERM) }, 571618Srie { 0, 0 } 581618Srie }; 592352Sab196087 static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda }; 602352Sab196087 static Val_desc vda_alt[] = { 612352Sab196087 { DF_P1_LAZYLOAD, MSG_ORIG(MSG_DFP_LAZYLOAD_ALT) }, 622352Sab196087 { DF_P1_GROUPPERM, MSG_ORIG(MSG_DFP_GROUPPERM) }, 632352Sab196087 { 0, 0 } 642352Sab196087 }; 652352Sab196087 static CONV_EXPN_FIELD_ARG conv_arg_alt = { string, sizeof (string), 662352Sab196087 vda_alt, NULL, 0, 0, MSG_ORIG(MSG_STR_EMPTY), NULL, 672352Sab196087 MSG_ORIG(MSG_STR_EMPTY) }; 682352Sab196087 692352Sab196087 CONV_EXPN_FIELD_ARG *arg; 701618Srie 710Sstevel@tonic-gate if (flags == 0) 720Sstevel@tonic-gate return (MSG_ORIG(MSG_GBL_ZERO)); 730Sstevel@tonic-gate 742352Sab196087 arg = (fmt_flags & CONV_FMT_ALTDUMP) ? &conv_arg_alt : &conv_arg; 752352Sab196087 arg->oflags = arg->rflags = flags; 762352Sab196087 (void) conv_expn_field(arg); 770Sstevel@tonic-gate 780Sstevel@tonic-gate return ((const char *)string); 790Sstevel@tonic-gate } 800Sstevel@tonic-gate 812352Sab196087 #define FLAGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \ 822352Sab196087 MSG_DF_ORIGIN_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 832352Sab196087 MSG_DF_SYMBOLIC_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 842352Sab196087 MSG_DF_TEXTREL_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 852352Sab196087 MSG_DF_BIND_NOW_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 862352Sab196087 MSG_DF_STATIC_TLS_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 872352Sab196087 CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE 880Sstevel@tonic-gate 890Sstevel@tonic-gate const char * 902352Sab196087 conv_dyn_flag(Xword flags, int fmt_flags) 910Sstevel@tonic-gate { 921618Srie static char string[FLAGSZ]; 931618Srie static Val_desc vda[] = { 941618Srie { DF_ORIGIN, MSG_ORIG(MSG_DF_ORIGIN) }, 951618Srie { DF_SYMBOLIC, MSG_ORIG(MSG_DF_SYMBOLIC) }, 961618Srie { DF_TEXTREL, MSG_ORIG(MSG_DF_TEXTREL) }, 971618Srie { DF_BIND_NOW, MSG_ORIG(MSG_DF_BIND_NOW) }, 981618Srie { DF_STATIC_TLS, MSG_ORIG(MSG_DF_STATIC_TLS) }, 991618Srie { 0, 0 } 1001618Srie }; 1012352Sab196087 static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda }; 1021618Srie 1030Sstevel@tonic-gate if (flags == 0) 1040Sstevel@tonic-gate return (MSG_ORIG(MSG_GBL_ZERO)); 1050Sstevel@tonic-gate 1062352Sab196087 conv_arg.oflags = conv_arg.rflags = flags; 1072352Sab196087 if (fmt_flags & CONV_FMT_ALTDUMP) { 1082352Sab196087 conv_arg.prefix = conv_arg.suffix = MSG_ORIG(MSG_STR_EMPTY); 1092352Sab196087 } else { 1102352Sab196087 conv_arg.prefix = conv_arg.suffix = NULL; 1112352Sab196087 } 1122352Sab196087 (void) conv_expn_field(&conv_arg); 1130Sstevel@tonic-gate 1141618Srie return ((const char *)string); 1150Sstevel@tonic-gate } 1160Sstevel@tonic-gate 1172352Sab196087 #define FLAG1SZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \ 1182352Sab196087 MSG_DF1_NOW_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1192352Sab196087 MSG_DF1_GLOBAL_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1202352Sab196087 MSG_DF1_GROUP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1212352Sab196087 MSG_DF1_NODELETE_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1222352Sab196087 MSG_DF1_LOADFLTR_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1232352Sab196087 MSG_DF1_INITFIRST_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1242352Sab196087 MSG_DF1_NOOPEN_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1252352Sab196087 MSG_DF1_ORIGIN_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1262352Sab196087 MSG_DF1_DIRECT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1272352Sab196087 MSG_DF1_TRANS_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1282352Sab196087 MSG_DF1_INTERPOSE_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1292352Sab196087 MSG_DF1_NODEFLIB_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1302352Sab196087 MSG_DF1_NODUMP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1312352Sab196087 MSG_DF1_CONFALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1322352Sab196087 MSG_DF1_ENDFILTEE_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1332352Sab196087 MSG_DF1_DISPRELPND_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1342352Sab196087 MSG_DF1_DISPRELDNE_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1352352Sab196087 MSG_DF1_NODIRECT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1362352Sab196087 MSG_DF1_IGNMULDEF_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1372352Sab196087 MSG_DF1_NOKSYMS_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1383466Srie MSG_DF1_NOHDR_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1392352Sab196087 MSG_DF1_NORELOC_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1403466Srie MSG_DF1_SYMINTPOSE_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1412352Sab196087 CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE 1420Sstevel@tonic-gate 1430Sstevel@tonic-gate const char * 1441618Srie conv_dyn_flag1(Xword flags) 1450Sstevel@tonic-gate { 1461618Srie static char string[FLAG1SZ]; 1471618Srie static Val_desc vda[] = { 1482352Sab196087 { DF_1_NOW, MSG_ORIG(MSG_DF1_NOW) }, 1491618Srie { DF_1_GLOBAL, MSG_ORIG(MSG_DF1_GLOBAL) }, 1501618Srie { DF_1_GROUP, MSG_ORIG(MSG_DF1_GROUP) }, 1511618Srie { DF_1_NODELETE, MSG_ORIG(MSG_DF1_NODELETE) }, 1521618Srie { DF_1_LOADFLTR, MSG_ORIG(MSG_DF1_LOADFLTR) }, 1531618Srie { DF_1_INITFIRST, MSG_ORIG(MSG_DF1_INITFIRST) }, 1541618Srie { DF_1_NOOPEN, MSG_ORIG(MSG_DF1_NOOPEN) }, 1551618Srie { DF_1_ORIGIN, MSG_ORIG(MSG_DF1_ORIGIN) }, 1561618Srie { DF_1_DIRECT, MSG_ORIG(MSG_DF1_DIRECT) }, 1571618Srie { DF_1_TRANS, MSG_ORIG(MSG_DF1_TRANS) }, 1581618Srie { DF_1_INTERPOSE, MSG_ORIG(MSG_DF1_INTERPOSE) }, 1591618Srie { DF_1_NODEFLIB, MSG_ORIG(MSG_DF1_NODEFLIB) }, 1601618Srie { DF_1_NODUMP, MSG_ORIG(MSG_DF1_NODUMP) }, 1611618Srie { DF_1_CONFALT, MSG_ORIG(MSG_DF1_CONFALT) }, 1621618Srie { DF_1_ENDFILTEE, MSG_ORIG(MSG_DF1_ENDFILTEE) }, 1631618Srie { DF_1_DISPRELPND, MSG_ORIG(MSG_DF1_DISPRELPND) }, 1641618Srie { DF_1_DISPRELDNE, MSG_ORIG(MSG_DF1_DISPRELDNE) }, 1651618Srie { DF_1_NODIRECT, MSG_ORIG(MSG_DF1_NODIRECT) }, 1661618Srie { DF_1_IGNMULDEF, MSG_ORIG(MSG_DF1_IGNMULDEF) }, 1671618Srie { DF_1_NOKSYMS, MSG_ORIG(MSG_DF1_NOKSYMS) }, 1683466Srie { DF_1_NOHDR, MSG_ORIG(MSG_DF1_NOHDR) }, 1691618Srie { DF_1_NORELOC, MSG_ORIG(MSG_DF1_NORELOC) }, 1703466Srie { DF_1_SYMINTPOSE, MSG_ORIG(MSG_DF1_SYMINTPOSE) }, 1711618Srie { 0, 0 } 1721618Srie }; 1732352Sab196087 static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda }; 1740Sstevel@tonic-gate 1750Sstevel@tonic-gate if (flags == 0) 1760Sstevel@tonic-gate return (MSG_ORIG(MSG_GBL_ZERO)); 1770Sstevel@tonic-gate 1782352Sab196087 conv_arg.oflags = conv_arg.rflags = flags; 1792352Sab196087 (void) conv_expn_field(&conv_arg); 1800Sstevel@tonic-gate 1811618Srie return ((const char *)string); 1820Sstevel@tonic-gate } 1830Sstevel@tonic-gate 1842352Sab196087 #define FEATSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \ 1852352Sab196087 MSG_DTF_PARINIT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1862352Sab196087 MSG_DTF_CONFEXP_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 1872352Sab196087 CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE 1880Sstevel@tonic-gate 1890Sstevel@tonic-gate const char * 1902352Sab196087 conv_dyn_feature1(Xword flags, int fmt_flags) 1910Sstevel@tonic-gate { 1921618Srie static char string[FEATSZ]; 1931618Srie static Val_desc vda[] = { 1941618Srie { DTF_1_PARINIT, MSG_ORIG(MSG_DTF_PARINIT) }, 1951618Srie { DTF_1_CONFEXP, MSG_ORIG(MSG_DTF_CONFEXP) }, 1961618Srie { 0, 0 } 1971618Srie }; 1982352Sab196087 static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda }; 1990Sstevel@tonic-gate 2000Sstevel@tonic-gate if (flags == 0) 2010Sstevel@tonic-gate return (MSG_ORIG(MSG_GBL_ZERO)); 2020Sstevel@tonic-gate 2032352Sab196087 conv_arg.oflags = conv_arg.rflags = flags; 2042352Sab196087 if (fmt_flags & CONV_FMT_ALTDUMP) { 2052352Sab196087 conv_arg.prefix = conv_arg.suffix = MSG_ORIG(MSG_STR_EMPTY); 2062352Sab196087 } else { 2072352Sab196087 conv_arg.prefix = conv_arg.suffix = NULL; 2082352Sab196087 } 2092352Sab196087 (void) conv_expn_field(&conv_arg); 2100Sstevel@tonic-gate 2111618Srie return ((const char *)string); 2120Sstevel@tonic-gate } 2130Sstevel@tonic-gate 2140Sstevel@tonic-gate const char * 2151976Sab196087 conv_dyn_tag(Xword tag, Half mach, int fmt_flags) 2160Sstevel@tonic-gate { 2172850Srie static Conv_inv_buf_t string; 2183492Sab196087 2193492Sab196087 /* 2203492Sab196087 * Dynamic tag values are sparse, cover a wide range, and have 2213492Sab196087 * holes. To handle this efficiently, we fall through a series 2223492Sab196087 * of tests below, in increasing tag order, returning at the first 2233492Sab196087 * match. 2243492Sab196087 * 2253492Sab196087 * If we fall all the way to the end, the tag is unknown, 2263492Sab196087 * and its numeric value is printed. 2273492Sab196087 */ 2283492Sab196087 2293492Sab196087 /* 2303492Sab196087 * Most of the tag values are clustered in contiguous ranges. 2313492Sab196087 * Each contiguous range of defined values is handled with 2323492Sab196087 * an array that contains the message index corresponding to 2333492Sab196087 * each value in that range. The DYN_RANGE macro checks the 2343492Sab196087 * tag value against range of values starting at _start_tag. 2353492Sab196087 * If there is a match, the index of the appropriate name is 2363492Sab196087 * pulled from _array and returned to the caller. 2373492Sab196087 */ 2383492Sab196087 #define DYN_RANGE(_start_tag, _array) \ 2393492Sab196087 if ((tag >= _start_tag) && (tag < (_start_tag + ARRAY_NELTS(_array)))) \ 2403492Sab196087 return (MSG_ORIG(_array[tag - _start_tag])); 2413492Sab196087 2423492Sab196087 2433492Sab196087 /* 2443492Sab196087 * Generic dynamic tags: 2453492Sab196087 * - Note hole between DT_FLAGS and DT_PREINIT_ARRAY 2463492Sab196087 * - The first range has alternative names for dump, 2473492Sab196087 * requiring a second array. 2483492Sab196087 */ 2493492Sab196087 static const Msg tags_null[] = { 2501618Srie MSG_DYN_NULL, MSG_DYN_NEEDED, 2511618Srie MSG_DYN_PLTRELSZ, MSG_DYN_PLTGOT, 2521618Srie MSG_DYN_HASH, MSG_DYN_STRTAB, 2531618Srie MSG_DYN_SYMTAB, MSG_DYN_RELA, 2541618Srie MSG_DYN_RELASZ, MSG_DYN_RELAENT, 2551618Srie MSG_DYN_STRSZ, MSG_DYN_SYMENT, 2561618Srie MSG_DYN_INIT, MSG_DYN_FINI, 2571618Srie MSG_DYN_SONAME, MSG_DYN_RPATH, 2581618Srie MSG_DYN_SYMBOLIC, MSG_DYN_REL, 2591618Srie MSG_DYN_RELSZ, MSG_DYN_RELENT, 2601618Srie MSG_DYN_PLTREL, MSG_DYN_DEBUG, 2611618Srie MSG_DYN_TEXTREL, MSG_DYN_JMPREL, 2621618Srie MSG_DYN_BIND_NOW, MSG_DYN_INIT_ARRAY, 2631618Srie MSG_DYN_FINI_ARRAY, MSG_DYN_INIT_ARRAYSZ, 2641618Srie MSG_DYN_FINI_ARRAYSZ, MSG_DYN_RUNPATH, 2653492Sab196087 MSG_DYN_FLAGS 2661618Srie }; 2673492Sab196087 static const Msg tags_null_alt[] = { 2681976Sab196087 MSG_DYN_NULL, MSG_DYN_NEEDED, 2691976Sab196087 MSG_DYN_PLTRELSZ_ALT, MSG_DYN_PLTGOT, 2701976Sab196087 MSG_DYN_HASH, MSG_DYN_STRTAB, 2711976Sab196087 MSG_DYN_SYMTAB, MSG_DYN_RELA, 2721976Sab196087 MSG_DYN_RELASZ, MSG_DYN_RELAENT, 2731976Sab196087 MSG_DYN_STRSZ, MSG_DYN_SYMENT, 2741976Sab196087 MSG_DYN_INIT, MSG_DYN_FINI, 2751976Sab196087 MSG_DYN_SONAME, MSG_DYN_RPATH, 2761976Sab196087 MSG_DYN_SYMBOLIC_ALT, MSG_DYN_REL, 2771976Sab196087 MSG_DYN_RELSZ, MSG_DYN_RELENT, 2781976Sab196087 MSG_DYN_PLTREL, MSG_DYN_DEBUG, 2791976Sab196087 MSG_DYN_TEXTREL, MSG_DYN_JMPREL, 2801976Sab196087 MSG_DYN_BIND_NOW, MSG_DYN_INIT_ARRAY, 2811976Sab196087 MSG_DYN_FINI_ARRAY, MSG_DYN_INIT_ARRAYSZ, 2821976Sab196087 MSG_DYN_FINI_ARRAYSZ, MSG_DYN_RUNPATH, 2833492Sab196087 MSG_DYN_FLAGS 2843492Sab196087 }; 2853492Sab196087 static const Msg tags_preinit_array[] = { 2861976Sab196087 MSG_DYN_PREINIT_ARRAY, MSG_DYN_PREINIT_ARRAYSZ 2871976Sab196087 }; 2880Sstevel@tonic-gate 2893492Sab196087 /* 2903492Sab196087 * SUNW: DT_LOOS -> DT_HIOS range. 2913492Sab196087 */ 2923492Sab196087 static const Msg tags_sunw_auxiliary[] = { 2933492Sab196087 MSG_DYN_SUNW_AUXILIARY, MSG_DYN_SUNW_RTLDINF, 2943492Sab196087 MSG_DYN_SUNW_FILTER, MSG_DYN_SUNW_CAP, 2953492Sab196087 MSG_DYN_SUNW_SYMTAB, MSG_DYN_SUNW_SYMSZ, 296*3731Srie MSG_DYN_SUNW_SORTENT, MSG_DYN_SUNW_SYMSORT, 297*3731Srie MSG_DYN_SUNW_SYMSORTSZ, MSG_DYN_SUNW_TLSSORT, 298*3731Srie MSG_DYN_SUNW_TLSSORTSZ 2993492Sab196087 }; 3000Sstevel@tonic-gate 3013492Sab196087 /* 3023492Sab196087 * SUNW: DT_VALRNGLO - DT_VALRNGHI range. 3033492Sab196087 */ 3043492Sab196087 static const Msg tags_checksum[] = { 3053492Sab196087 MSG_DYN_CHECKSUM, MSG_DYN_PLTPADSZ, 3063492Sab196087 MSG_DYN_MOVEENT, MSG_DYN_MOVESZ, 3073492Sab196087 MSG_DYN_FEATURE_1, MSG_DYN_POSFLAG_1, 3083492Sab196087 MSG_DYN_SYMINSZ, MSG_DYN_SYMINENT 3093492Sab196087 }; 3103492Sab196087 3113492Sab196087 /* 3123492Sab196087 * SUNW: DT_ADDRRNGLO - DT_ADDRRNGHI range. 3133492Sab196087 */ 3143492Sab196087 static const Msg tags_config[] = { 3153492Sab196087 MSG_DYN_CONFIG, MSG_DYN_DEPAUDIT, 3163492Sab196087 MSG_DYN_AUDIT, MSG_DYN_PLTPAD, 3173492Sab196087 MSG_DYN_MOVETAB, MSG_DYN_SYMINFO 3183492Sab196087 }; 3190Sstevel@tonic-gate 3203492Sab196087 /* 3213492Sab196087 * SUNW: generic range. Note hole between DT_VERSYM and DT_RELACOUNT. 3223492Sab196087 * We handle DT_VERSYM as a single value below. 3233492Sab196087 */ 3243492Sab196087 static const Msg tags_relacount[] = { 3253492Sab196087 MSG_DYN_RELACOUNT, MSG_DYN_RELCOUNT, 3263492Sab196087 MSG_DYN_FLAGS_1, MSG_DYN_VERDEF, 3273492Sab196087 MSG_DYN_VERDEFNUM, MSG_DYN_VERNEED, 3283492Sab196087 MSG_DYN_VERNEEDNUM 3293492Sab196087 }; 3303492Sab196087 3313492Sab196087 /* 3323492Sab196087 * DT_LOPROC - DT_HIPROC range. 3333492Sab196087 */ 3343492Sab196087 static const Msg tags_auxiliary[] = { 3353492Sab196087 MSG_DYN_AUXILIARY, MSG_DYN_USED, 3363492Sab196087 MSG_DYN_FILTER 3373492Sab196087 }; 3383492Sab196087 3393492Sab196087 3403492Sab196087 3410Sstevel@tonic-gate 3423492Sab196087 if (tag <= DT_FLAGS) 3433492Sab196087 return (conv_map2str(string, sizeof (string), tag, 3443492Sab196087 fmt_flags, ARRAY_NELTS(tags_null), tags_null, 3453492Sab196087 tags_null_alt, NULL)); 3463492Sab196087 DYN_RANGE(DT_PREINIT_ARRAY, tags_preinit_array); 3473492Sab196087 DYN_RANGE(DT_SUNW_AUXILIARY, tags_sunw_auxiliary); 3483492Sab196087 DYN_RANGE(DT_CHECKSUM, tags_checksum); 3493492Sab196087 DYN_RANGE(DT_CONFIG, tags_config); 3503492Sab196087 if (tag == DT_VERSYM) 3513492Sab196087 return (MSG_ORIG(MSG_DYN_VERSYM)); 3523492Sab196087 DYN_RANGE(DT_RELACOUNT, tags_relacount); 3533492Sab196087 DYN_RANGE(DT_AUXILIARY, tags_auxiliary); 3540Sstevel@tonic-gate 3553492Sab196087 /* 3563492Sab196087 * SUNW: machine specific range. 3573492Sab196087 */ 3583492Sab196087 if (((mach == EM_SPARC) || (mach == EM_SPARCV9) || 3593492Sab196087 (mach == EM_SPARC32PLUS)) && (tag == DT_SPARC_REGISTER)) 3603492Sab196087 /* this is so x86 can display a sparc binary */ 3613492Sab196087 return (MSG_ORIG(MSG_DYN_REGISTER)); 3623492Sab196087 3633492Sab196087 if (tag == DT_DEPRECATED_SPARC_REGISTER) 3643492Sab196087 return (MSG_ORIG(MSG_DYN_REGISTER)); 3653492Sab196087 3663492Sab196087 /* Unknown item */ 3673492Sab196087 return (conv_invalid_val(string, CONV_INV_STRSIZE, tag, fmt_flags)); 3683492Sab196087 3693492Sab196087 #undef DYN_RANGE 3700Sstevel@tonic-gate } 371280Srie 3722352Sab196087 #define BINDTSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \ 3732352Sab196087 MSG_BND_NEEDED_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 3742352Sab196087 MSG_BND_REFER_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 3752352Sab196087 MSG_BND_FILTER_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 3762352Sab196087 CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE 377280Srie 378280Srie const char * 3791618Srie conv_bnd_type(uint_t flags) 380280Srie { 3811618Srie static char string[BINDTSZ]; 3821618Srie static Val_desc vda[] = { 3831618Srie { BND_NEEDED, MSG_ORIG(MSG_BND_NEEDED) }, 3841618Srie { BND_REFER, MSG_ORIG(MSG_BND_REFER) }, 3851618Srie { BND_FILTER, MSG_ORIG(MSG_BND_FILTER) }, 3861618Srie { 0, 0 } 3871618Srie }; 3882352Sab196087 static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda }; 389280Srie 3901618Srie if (flags == 0) 3911618Srie return (MSG_ORIG(MSG_STR_EMPTY)); 392280Srie 3932352Sab196087 conv_arg.oflags = conv_arg.rflags = flags; 3942352Sab196087 (void) conv_expn_field(&conv_arg); 3951618Srie 3961618Srie return ((const char *)string); 397280Srie } 398280Srie 3991824Srie /* 4001824Srie * Note, conv_bnd_obj() is called with either: 4011824Srie * LML_FLG_OBJADDED (possibly with LML_FLG_OBJREEVAL added), or 4021824Srie * LML_FLG_OBJDELETED, or 4031824Srie * LML_FLG_ATEXIT. 4041824Srie */ 4052352Sab196087 #define BINDOSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \ 4062352Sab196087 MSG_BND_ADDED_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 4072352Sab196087 MSG_BND_REEVAL_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \ 4082352Sab196087 CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE 409280Srie 410280Srie const char * 4111618Srie conv_bnd_obj(uint_t flags) 412280Srie { 4131618Srie static char string[BINDOSZ]; 4141618Srie static Val_desc vda[] = { 4151618Srie { LML_FLG_OBJADDED, MSG_ORIG(MSG_BND_ADDED) }, 4161618Srie { LML_FLG_OBJREEVAL, MSG_ORIG(MSG_BND_REEVAL) }, 4171618Srie { LML_FLG_OBJDELETED, MSG_ORIG(MSG_BND_DELETED) }, 4181618Srie { LML_FLG_ATEXIT, MSG_ORIG(MSG_BND_ATEXIT) }, 4191618Srie { 0, 0 } 4201618Srie }; 4212352Sab196087 static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda }; 4221618Srie 4231824Srie if ((flags & (LML_FLG_OBJADDED | LML_FLG_OBJREEVAL | 4241824Srie LML_FLG_OBJDELETED | LML_FLG_ATEXIT)) == 0) 4251824Srie return (MSG_ORIG(MSG_BND_REVISIT)); 426280Srie 427280Srie /* 4281618Srie * Note, we're not worried about unknown flags for this family, only 4292352Sab196087 * the selected flags are of interest, so we leave conv_arg.rflags 4302352Sab196087 * set to 0. 431280Srie */ 4322352Sab196087 conv_arg.oflags = flags; 4332352Sab196087 (void) conv_expn_field(&conv_arg); 434280Srie 4351618Srie return ((const char *)string); 436280Srie } 437