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 /* 231618Srie * Copyright 2006 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 380Sstevel@tonic-gate #define POSSZ MSG_GBL_OSQBRKT_SIZE + \ 390Sstevel@tonic-gate MSG_DFP_LAZYLOAD_SIZE + \ 400Sstevel@tonic-gate MSG_DFP_GROUPPERM_SIZE + \ 411618Srie CONV_INV_STRSIZE + MSG_GBL_CSQBRKT_SIZE 420Sstevel@tonic-gate 430Sstevel@tonic-gate const char * 441618Srie conv_dyn_posflag1(Xword flags) 450Sstevel@tonic-gate { 461618Srie static char string[POSSZ]; 471618Srie static Val_desc vda[] = { 481618Srie { DF_P1_LAZYLOAD, MSG_ORIG(MSG_DFP_LAZYLOAD) }, 491618Srie { DF_P1_GROUPPERM, MSG_ORIG(MSG_DFP_GROUPPERM) }, 501618Srie { 0, 0 } 511618Srie }; 521618Srie 530Sstevel@tonic-gate if (flags == 0) 540Sstevel@tonic-gate return (MSG_ORIG(MSG_GBL_ZERO)); 550Sstevel@tonic-gate 561618Srie (void) strlcpy(string, MSG_ORIG(MSG_GBL_OSQBRKT), POSSZ); 571618Srie if (conv_expn_field(string, POSSZ, vda, flags, flags, 0, 0)) 581618Srie (void) strlcat(string, MSG_ORIG(MSG_GBL_CSQBRKT), POSSZ); 590Sstevel@tonic-gate 600Sstevel@tonic-gate return ((const char *)string); 610Sstevel@tonic-gate } 620Sstevel@tonic-gate 631618Srie #define FLAGSZ MSG_GBL_OSQBRKT_SIZE + \ 641618Srie MSG_DF_ORIGIN_SIZE + \ 650Sstevel@tonic-gate MSG_DF_SYMBOLIC_SIZE + \ 660Sstevel@tonic-gate MSG_DF_TEXTREL_SIZE + \ 670Sstevel@tonic-gate MSG_DF_BIND_NOW_SIZE + \ 681618Srie MSG_DF_STATIC_TLS_SIZE + \ 691618Srie CONV_INV_STRSIZE + MSG_GBL_CSQBRKT_SIZE 700Sstevel@tonic-gate 710Sstevel@tonic-gate const char * 721618Srie conv_dyn_flag(Xword flags) 730Sstevel@tonic-gate { 741618Srie static char string[FLAGSZ]; 751618Srie static Val_desc vda[] = { 761618Srie { DF_ORIGIN, MSG_ORIG(MSG_DF_ORIGIN) }, 771618Srie { DF_SYMBOLIC, MSG_ORIG(MSG_DF_SYMBOLIC) }, 781618Srie { DF_TEXTREL, MSG_ORIG(MSG_DF_TEXTREL) }, 791618Srie { DF_BIND_NOW, MSG_ORIG(MSG_DF_BIND_NOW) }, 801618Srie { DF_STATIC_TLS, MSG_ORIG(MSG_DF_STATIC_TLS) }, 811618Srie { 0, 0 } 821618Srie }; 831618Srie 840Sstevel@tonic-gate if (flags == 0) 850Sstevel@tonic-gate return (MSG_ORIG(MSG_GBL_ZERO)); 860Sstevel@tonic-gate 871618Srie (void) strlcpy(string, MSG_ORIG(MSG_GBL_OSQBRKT), FLAGSZ); 881618Srie if (conv_expn_field(string, FLAGSZ, vda, flags, flags, 0, 0)) 891618Srie (void) strlcat(string, MSG_ORIG(MSG_GBL_CSQBRKT), FLAGSZ); 900Sstevel@tonic-gate 911618Srie return ((const char *)string); 920Sstevel@tonic-gate } 930Sstevel@tonic-gate 940Sstevel@tonic-gate #define FLAG1SZ MSG_GBL_OSQBRKT_SIZE + \ 950Sstevel@tonic-gate MSG_DF1_NOW_SIZE + \ 961618Srie MSG_DF1_GLOBAL_SIZE + \ 970Sstevel@tonic-gate MSG_DF1_GROUP_SIZE + \ 980Sstevel@tonic-gate MSG_DF1_NODELETE_SIZE + \ 990Sstevel@tonic-gate MSG_DF1_LOADFLTR_SIZE + \ 1000Sstevel@tonic-gate MSG_DF1_INITFIRST_SIZE + \ 1010Sstevel@tonic-gate MSG_DF1_NOOPEN_SIZE + \ 1020Sstevel@tonic-gate MSG_DF1_ORIGIN_SIZE + \ 1030Sstevel@tonic-gate MSG_DF1_DIRECT_SIZE + \ 1040Sstevel@tonic-gate MSG_DF1_TRANS_SIZE + \ 1050Sstevel@tonic-gate MSG_DF1_INTERPOSE_SIZE + \ 1060Sstevel@tonic-gate MSG_DF1_NODEFLIB_SIZE + \ 1070Sstevel@tonic-gate MSG_DF1_NODUMP_SIZE + \ 1080Sstevel@tonic-gate MSG_DF1_CONFALT_SIZE + \ 1090Sstevel@tonic-gate MSG_DF1_ENDFILTEE_SIZE + \ 1100Sstevel@tonic-gate MSG_DF1_DISPRELPND_SIZE + \ 1110Sstevel@tonic-gate MSG_DF1_DISPRELDNE_SIZE + \ 1120Sstevel@tonic-gate MSG_DF1_NODIRECT_SIZE + \ 1130Sstevel@tonic-gate MSG_DF1_IGNMULDEF_SIZE + \ 1140Sstevel@tonic-gate MSG_DF1_NOKSYMS_SIZE + \ 1150Sstevel@tonic-gate MSG_DF1_NORELOC_SIZE + \ 1161698Sab196087 MSG_DF1_NOHDR_SIZE + \ 1171618Srie CONV_INV_STRSIZE + MSG_GBL_CSQBRKT_SIZE 1180Sstevel@tonic-gate 1190Sstevel@tonic-gate const char * 1201618Srie conv_dyn_flag1(Xword flags) 1210Sstevel@tonic-gate { 1221618Srie static char string[FLAG1SZ]; 1231618Srie static Val_desc vda[] = { 1241618Srie { DF_1_NOW, MSG_ORIG(MSG_DF_ORIGIN) }, 1251618Srie { DF_1_GLOBAL, MSG_ORIG(MSG_DF1_GLOBAL) }, 1261618Srie { DF_1_GROUP, MSG_ORIG(MSG_DF1_GROUP) }, 1271618Srie { DF_1_NODELETE, MSG_ORIG(MSG_DF1_NODELETE) }, 1281618Srie { DF_1_LOADFLTR, MSG_ORIG(MSG_DF1_LOADFLTR) }, 1291618Srie { DF_1_INITFIRST, MSG_ORIG(MSG_DF1_INITFIRST) }, 1301618Srie { DF_1_NOOPEN, MSG_ORIG(MSG_DF1_NOOPEN) }, 1311618Srie { DF_1_ORIGIN, MSG_ORIG(MSG_DF1_ORIGIN) }, 1321618Srie { DF_1_DIRECT, MSG_ORIG(MSG_DF1_DIRECT) }, 1331618Srie { DF_1_TRANS, MSG_ORIG(MSG_DF1_TRANS) }, 1341618Srie { DF_1_INTERPOSE, MSG_ORIG(MSG_DF1_INTERPOSE) }, 1351618Srie { DF_1_NODEFLIB, MSG_ORIG(MSG_DF1_NODEFLIB) }, 1361618Srie { DF_1_NODUMP, MSG_ORIG(MSG_DF1_NODUMP) }, 1371618Srie { DF_1_CONFALT, MSG_ORIG(MSG_DF1_CONFALT) }, 1381618Srie { DF_1_ENDFILTEE, MSG_ORIG(MSG_DF1_ENDFILTEE) }, 1391618Srie { DF_1_DISPRELPND, MSG_ORIG(MSG_DF1_DISPRELPND) }, 1401618Srie { DF_1_DISPRELDNE, MSG_ORIG(MSG_DF1_DISPRELDNE) }, 1411618Srie { DF_1_NODIRECT, MSG_ORIG(MSG_DF1_NODIRECT) }, 1421618Srie { DF_1_IGNMULDEF, MSG_ORIG(MSG_DF1_IGNMULDEF) }, 1431618Srie { DF_1_NOKSYMS, MSG_ORIG(MSG_DF1_NOKSYMS) }, 1441618Srie { DF_1_NORELOC, MSG_ORIG(MSG_DF1_NORELOC) }, 1451698Sab196087 { DF_1_NOHDR, MSG_ORIG(MSG_DF1_NOHDR) }, 1461618Srie { 0, 0 } 1471618Srie }; 1480Sstevel@tonic-gate 1490Sstevel@tonic-gate if (flags == 0) 1500Sstevel@tonic-gate return (MSG_ORIG(MSG_GBL_ZERO)); 1510Sstevel@tonic-gate 1521618Srie (void) strlcpy(string, MSG_ORIG(MSG_GBL_OSQBRKT), FLAG1SZ); 1531618Srie if (conv_expn_field(string, FLAG1SZ, vda, flags, flags, 0, 0)) 1541618Srie (void) strlcat(string, MSG_ORIG(MSG_GBL_CSQBRKT), FLAG1SZ); 1550Sstevel@tonic-gate 1561618Srie return ((const char *)string); 1570Sstevel@tonic-gate } 1580Sstevel@tonic-gate 1590Sstevel@tonic-gate #define FEATSZ MSG_GBL_OSQBRKT_SIZE + \ 1600Sstevel@tonic-gate MSG_DTF_PARINIT_SIZE + \ 1610Sstevel@tonic-gate MSG_DTF_CONFEXP_SIZE + \ 1621618Srie CONV_INV_STRSIZE + MSG_GBL_CSQBRKT_SIZE 1630Sstevel@tonic-gate 1640Sstevel@tonic-gate const char * 1651618Srie conv_dyn_feature1(Xword flags) 1660Sstevel@tonic-gate { 1671618Srie static char string[FEATSZ]; 1681618Srie static Val_desc vda[] = { 1691618Srie { DTF_1_PARINIT, MSG_ORIG(MSG_DTF_PARINIT) }, 1701618Srie { DTF_1_CONFEXP, MSG_ORIG(MSG_DTF_CONFEXP) }, 1711618Srie { 0, 0 } 1721618Srie }; 1730Sstevel@tonic-gate 1740Sstevel@tonic-gate if (flags == 0) 1750Sstevel@tonic-gate return (MSG_ORIG(MSG_GBL_ZERO)); 1760Sstevel@tonic-gate 1771618Srie (void) strlcpy(string, MSG_ORIG(MSG_GBL_OSQBRKT), FEATSZ); 1781618Srie if (conv_expn_field(string, FEATSZ, vda, flags, flags, 0, 0)) 1791618Srie (void) strlcat(string, MSG_ORIG(MSG_GBL_CSQBRKT), FEATSZ); 1800Sstevel@tonic-gate 1811618Srie return ((const char *)string); 1820Sstevel@tonic-gate } 1830Sstevel@tonic-gate 1840Sstevel@tonic-gate const char * 185*1976Sab196087 conv_dyn_tag(Xword tag, Half mach, int fmt_flags) 1860Sstevel@tonic-gate { 1871618Srie static char string[CONV_INV_STRSIZE]; 1881618Srie static const Msg tags[DT_MAXPOSTAGS] = { 1891618Srie MSG_DYN_NULL, MSG_DYN_NEEDED, 1901618Srie MSG_DYN_PLTRELSZ, MSG_DYN_PLTGOT, 1911618Srie MSG_DYN_HASH, MSG_DYN_STRTAB, 1921618Srie MSG_DYN_SYMTAB, MSG_DYN_RELA, 1931618Srie MSG_DYN_RELASZ, MSG_DYN_RELAENT, 1941618Srie MSG_DYN_STRSZ, MSG_DYN_SYMENT, 1951618Srie MSG_DYN_INIT, MSG_DYN_FINI, 1961618Srie MSG_DYN_SONAME, MSG_DYN_RPATH, 1971618Srie MSG_DYN_SYMBOLIC, MSG_DYN_REL, 1981618Srie MSG_DYN_RELSZ, MSG_DYN_RELENT, 1991618Srie MSG_DYN_PLTREL, MSG_DYN_DEBUG, 2001618Srie MSG_DYN_TEXTREL, MSG_DYN_JMPREL, 2011618Srie MSG_DYN_BIND_NOW, MSG_DYN_INIT_ARRAY, 2021618Srie MSG_DYN_FINI_ARRAY, MSG_DYN_INIT_ARRAYSZ, 2031618Srie MSG_DYN_FINI_ARRAYSZ, MSG_DYN_RUNPATH, 2041618Srie MSG_DYN_FLAGS, MSG_DYN_NULL, 2051618Srie MSG_DYN_PREINIT_ARRAY, MSG_DYN_PREINIT_ARRAYSZ 2061618Srie }; 207*1976Sab196087 static const Msg tags_alt[DT_MAXPOSTAGS] = { 208*1976Sab196087 MSG_DYN_NULL, MSG_DYN_NEEDED, 209*1976Sab196087 MSG_DYN_PLTRELSZ_ALT, MSG_DYN_PLTGOT, 210*1976Sab196087 MSG_DYN_HASH, MSG_DYN_STRTAB, 211*1976Sab196087 MSG_DYN_SYMTAB, MSG_DYN_RELA, 212*1976Sab196087 MSG_DYN_RELASZ, MSG_DYN_RELAENT, 213*1976Sab196087 MSG_DYN_STRSZ, MSG_DYN_SYMENT, 214*1976Sab196087 MSG_DYN_INIT, MSG_DYN_FINI, 215*1976Sab196087 MSG_DYN_SONAME, MSG_DYN_RPATH, 216*1976Sab196087 MSG_DYN_SYMBOLIC_ALT, MSG_DYN_REL, 217*1976Sab196087 MSG_DYN_RELSZ, MSG_DYN_RELENT, 218*1976Sab196087 MSG_DYN_PLTREL, MSG_DYN_DEBUG, 219*1976Sab196087 MSG_DYN_TEXTREL, MSG_DYN_JMPREL, 220*1976Sab196087 MSG_DYN_BIND_NOW, MSG_DYN_INIT_ARRAY, 221*1976Sab196087 MSG_DYN_FINI_ARRAY, MSG_DYN_INIT_ARRAYSZ, 222*1976Sab196087 MSG_DYN_FINI_ARRAYSZ, MSG_DYN_RUNPATH, 223*1976Sab196087 MSG_DYN_FLAGS, MSG_DYN_NULL, 224*1976Sab196087 MSG_DYN_PREINIT_ARRAY, MSG_DYN_PREINIT_ARRAYSZ 225*1976Sab196087 }; 2260Sstevel@tonic-gate 2270Sstevel@tonic-gate if (tag < DT_MAXPOSTAGS) { 2280Sstevel@tonic-gate /* 2290Sstevel@tonic-gate * Generic dynamic tags. 2300Sstevel@tonic-gate */ 231*1976Sab196087 return ((fmt_flags & CONV_FMTALTMASK) 232*1976Sab196087 ? MSG_ORIG(tags_alt[tag]) : MSG_ORIG(tags[tag])); 2330Sstevel@tonic-gate } else { 2340Sstevel@tonic-gate /* 2350Sstevel@tonic-gate * SUNW: DT_LOOS -> DT_HIOS range. 2360Sstevel@tonic-gate */ 2370Sstevel@tonic-gate if (tag == DT_SUNW_AUXILIARY) 2380Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_SUNW_AUXILIARY)); 2390Sstevel@tonic-gate else if (tag == DT_SUNW_RTLDINF) 2400Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_SUNW_RTLDINF)); 2410Sstevel@tonic-gate else if (tag == DT_SUNW_FILTER) 2420Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_SUNW_FILTER)); 2430Sstevel@tonic-gate else if (tag == DT_SUNW_CAP) 2440Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_SUNW_CAP)); 2450Sstevel@tonic-gate 2460Sstevel@tonic-gate /* 2470Sstevel@tonic-gate * SUNW: DT_VALRNGLO - DT_VALRNGHI range. 2480Sstevel@tonic-gate */ 2490Sstevel@tonic-gate else if (tag == DT_CHECKSUM) 2500Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_CHECKSUM)); 2510Sstevel@tonic-gate else if (tag == DT_PLTPADSZ) 2520Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_PLTPADSZ)); 2530Sstevel@tonic-gate else if (tag == DT_MOVEENT) 2540Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_MOVEENT)); 2550Sstevel@tonic-gate else if (tag == DT_MOVESZ) 2560Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_MOVESZ)); 2570Sstevel@tonic-gate else if (tag == DT_FEATURE_1) 2580Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_FEATURE_1)); 2590Sstevel@tonic-gate else if (tag == DT_POSFLAG_1) 2600Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_POSFLAG_1)); 2610Sstevel@tonic-gate else if (tag == DT_SYMINSZ) 2620Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_SYMINSZ)); 2630Sstevel@tonic-gate else if (tag == DT_SYMINENT) 2640Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_SYMINENT)); 2650Sstevel@tonic-gate 2660Sstevel@tonic-gate /* 2670Sstevel@tonic-gate * SUNW: DT_ADDRRNGLO - DT_ADDRRNGHI range. 2680Sstevel@tonic-gate */ 2690Sstevel@tonic-gate else if (tag == DT_CONFIG) 2700Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_CONFIG)); 2710Sstevel@tonic-gate else if (tag == DT_DEPAUDIT) 2720Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_DEPAUDIT)); 2730Sstevel@tonic-gate else if (tag == DT_AUDIT) 2740Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_AUDIT)); 2750Sstevel@tonic-gate else if (tag == DT_PLTPAD) 2760Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_PLTPAD)); 2770Sstevel@tonic-gate else if (tag == DT_MOVETAB) 2780Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_MOVETAB)); 2790Sstevel@tonic-gate else if (tag == DT_SYMINFO) 2800Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_SYMINFO)); 2810Sstevel@tonic-gate 2820Sstevel@tonic-gate /* 2830Sstevel@tonic-gate * SUNW: generic range. 2840Sstevel@tonic-gate */ 2850Sstevel@tonic-gate else if (tag == DT_VERSYM) 2860Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_VERSYM)); 2870Sstevel@tonic-gate else if (tag == DT_RELACOUNT) 2880Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_RELACOUNT)); 2890Sstevel@tonic-gate else if (tag == DT_RELCOUNT) 2900Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_RELCOUNT)); 2910Sstevel@tonic-gate else if (tag == DT_FLAGS_1) 2920Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_FLAGS_1)); 2930Sstevel@tonic-gate else if (tag == DT_VERDEF) 2940Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_VERDEF)); 2950Sstevel@tonic-gate else if (tag == DT_VERDEFNUM) 2960Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_VERDEFNUM)); 2970Sstevel@tonic-gate else if (tag == DT_VERNEED) 2980Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_VERNEED)); 2990Sstevel@tonic-gate else if (tag == DT_VERNEEDNUM) 3000Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_VERNEEDNUM)); 3010Sstevel@tonic-gate else if (tag == DT_AUXILIARY) 3020Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_AUXILIARY)); 3030Sstevel@tonic-gate else if (tag == DT_USED) 3040Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_USED)); 3050Sstevel@tonic-gate else if (tag == DT_FILTER) 3060Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_FILTER)); 3070Sstevel@tonic-gate 3080Sstevel@tonic-gate /* 3090Sstevel@tonic-gate * SUNW: machine specific range. 3100Sstevel@tonic-gate */ 3110Sstevel@tonic-gate else if (((mach == EM_SPARC) || (mach == EM_SPARCV9) || 3120Sstevel@tonic-gate (mach == EM_SPARC32PLUS)) && (tag == DT_SPARC_REGISTER)) 3130Sstevel@tonic-gate /* this is so x86 can display a sparc binary */ 3140Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_REGISTER)); 3150Sstevel@tonic-gate else if (tag == DT_DEPRECATED_SPARC_REGISTER) 3160Sstevel@tonic-gate return (MSG_ORIG(MSG_DYN_REGISTER)); 3170Sstevel@tonic-gate else 3181618Srie return (conv_invalid_val(string, CONV_INV_STRSIZE, 319*1976Sab196087 tag, fmt_flags)); 3200Sstevel@tonic-gate } 3210Sstevel@tonic-gate } 322280Srie 3231618Srie #define BINDTSZ MSG_GBL_OSQBRKT_SIZE + \ 324280Srie MSG_BND_NEEDED_SIZE + \ 325280Srie MSG_BND_REFER_SIZE + \ 326280Srie MSG_BND_FILTER_SIZE + \ 3271618Srie CONV_INV_STRSIZE + MSG_GBL_CSQBRKT_SIZE 328280Srie 329280Srie const char * 3301618Srie conv_bnd_type(uint_t flags) 331280Srie { 3321618Srie static char string[BINDTSZ]; 3331618Srie static Val_desc vda[] = { 3341618Srie { BND_NEEDED, MSG_ORIG(MSG_BND_NEEDED) }, 3351618Srie { BND_REFER, MSG_ORIG(MSG_BND_REFER) }, 3361618Srie { BND_FILTER, MSG_ORIG(MSG_BND_FILTER) }, 3371618Srie { 0, 0 } 3381618Srie }; 339280Srie 3401618Srie if (flags == 0) 3411618Srie return (MSG_ORIG(MSG_STR_EMPTY)); 342280Srie 3431618Srie (void) strlcpy(string, MSG_ORIG(MSG_GBL_OSQBRKT), BINDTSZ); 3441618Srie if (conv_expn_field(string, BINDTSZ, vda, flags, flags, 0, 0)) 3451618Srie (void) strlcat(string, MSG_ORIG(MSG_GBL_CSQBRKT), BINDTSZ); 3461618Srie 3471618Srie return ((const char *)string); 348280Srie } 349280Srie 3501824Srie /* 3511824Srie * Note, conv_bnd_obj() is called with either: 3521824Srie * LML_FLG_OBJADDED (possibly with LML_FLG_OBJREEVAL added), or 3531824Srie * LML_FLG_OBJDELETED, or 3541824Srie * LML_FLG_ATEXIT. 3551824Srie */ 3561618Srie #define BINDOSZ MSG_GBL_OSQBRKT_SIZE + \ 357280Srie MSG_BND_ADDED_SIZE + \ 358280Srie MSG_BND_REEVAL_SIZE + \ 359280Srie MSG_GBL_CSQBRKT_SIZE 360280Srie 361280Srie const char * 3621618Srie conv_bnd_obj(uint_t flags) 363280Srie { 3641618Srie static char string[BINDOSZ]; 3651618Srie static Val_desc vda[] = { 3661618Srie { LML_FLG_OBJADDED, MSG_ORIG(MSG_BND_ADDED) }, 3671618Srie { LML_FLG_OBJREEVAL, MSG_ORIG(MSG_BND_REEVAL) }, 3681618Srie { LML_FLG_OBJDELETED, MSG_ORIG(MSG_BND_DELETED) }, 3691618Srie { LML_FLG_ATEXIT, MSG_ORIG(MSG_BND_ATEXIT) }, 3701618Srie { 0, 0 } 3711618Srie }; 3721618Srie 3731824Srie if ((flags & (LML_FLG_OBJADDED | LML_FLG_OBJREEVAL | 3741824Srie LML_FLG_OBJDELETED | LML_FLG_ATEXIT)) == 0) 3751824Srie return (MSG_ORIG(MSG_BND_REVISIT)); 376280Srie 377280Srie /* 3781618Srie * Note, we're not worried about unknown flags for this family, only 3791618Srie * the selected flags are of interest. 380280Srie */ 3811618Srie (void) strlcpy(string, MSG_ORIG(MSG_GBL_OSQBRKT), BINDOSZ); 3821618Srie if (conv_expn_field(string, BINDOSZ, vda, flags, 0, 0, 0)) 3831618Srie (void) strlcat(string, MSG_ORIG(MSG_GBL_CSQBRKT), BINDOSZ); 384280Srie 3851618Srie return ((const char *)string); 386280Srie } 387