xref: /onnv-gate/usr/src/cmd/sgs/libconv/common/dynamic.c (revision 1618:8c9a4f31d225)
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
5*1618Srie  * Common Development and Distribution License (the "License").
6*1618Srie  * 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  */
21*1618Srie 
220Sstevel@tonic-gate /*
23*1618Srie  * 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 + \
41*1618Srie 		CONV_INV_STRSIZE + MSG_GBL_CSQBRKT_SIZE
420Sstevel@tonic-gate 
430Sstevel@tonic-gate const char *
44*1618Srie conv_dyn_posflag1(Xword flags)
450Sstevel@tonic-gate {
46*1618Srie 	static char	string[POSSZ];
47*1618Srie 	static Val_desc vda[] = {
48*1618Srie 		{ DF_P1_LAZYLOAD,	MSG_ORIG(MSG_DFP_LAZYLOAD) },
49*1618Srie 		{ DF_P1_GROUPPERM,	MSG_ORIG(MSG_DFP_GROUPPERM) },
50*1618Srie 		{ 0,			0 }
51*1618Srie 	};
52*1618Srie 
530Sstevel@tonic-gate 	if (flags == 0)
540Sstevel@tonic-gate 		return (MSG_ORIG(MSG_GBL_ZERO));
550Sstevel@tonic-gate 
56*1618Srie 	(void) strlcpy(string, MSG_ORIG(MSG_GBL_OSQBRKT), POSSZ);
57*1618Srie 	if (conv_expn_field(string, POSSZ, vda, flags, flags, 0, 0))
58*1618Srie 		(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 
63*1618Srie #define	FLAGSZ	MSG_GBL_OSQBRKT_SIZE + \
64*1618Srie 		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 + \
68*1618Srie 		MSG_DF_STATIC_TLS_SIZE + \
69*1618Srie 		CONV_INV_STRSIZE + MSG_GBL_CSQBRKT_SIZE
700Sstevel@tonic-gate 
710Sstevel@tonic-gate const char *
72*1618Srie conv_dyn_flag(Xword flags)
730Sstevel@tonic-gate {
74*1618Srie 	static char	string[FLAGSZ];
75*1618Srie 	static Val_desc vda[] = {
76*1618Srie 		{ DF_ORIGIN,		MSG_ORIG(MSG_DF_ORIGIN) },
77*1618Srie 		{ DF_SYMBOLIC,		MSG_ORIG(MSG_DF_SYMBOLIC) },
78*1618Srie 		{ DF_TEXTREL,		MSG_ORIG(MSG_DF_TEXTREL) },
79*1618Srie 		{ DF_BIND_NOW,		MSG_ORIG(MSG_DF_BIND_NOW) },
80*1618Srie 		{ DF_STATIC_TLS,	MSG_ORIG(MSG_DF_STATIC_TLS) },
81*1618Srie 		{ 0,			0 }
82*1618Srie 	};
83*1618Srie 
840Sstevel@tonic-gate 	if (flags == 0)
850Sstevel@tonic-gate 		return (MSG_ORIG(MSG_GBL_ZERO));
860Sstevel@tonic-gate 
87*1618Srie 	(void) strlcpy(string, MSG_ORIG(MSG_GBL_OSQBRKT), FLAGSZ);
88*1618Srie 	if (conv_expn_field(string, FLAGSZ, vda, flags, flags, 0, 0))
89*1618Srie 		(void) strlcat(string, MSG_ORIG(MSG_GBL_CSQBRKT), FLAGSZ);
900Sstevel@tonic-gate 
91*1618Srie 	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 + \
96*1618Srie 		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 + \
116*1618Srie 		CONV_INV_STRSIZE + MSG_GBL_CSQBRKT_SIZE
1170Sstevel@tonic-gate 
1180Sstevel@tonic-gate const char *
119*1618Srie conv_dyn_flag1(Xword flags)
1200Sstevel@tonic-gate {
121*1618Srie 	static char	string[FLAG1SZ];
122*1618Srie 	static Val_desc vda[] = {
123*1618Srie 		{ DF_1_NOW,		MSG_ORIG(MSG_DF_ORIGIN) },
124*1618Srie 		{ DF_1_GLOBAL,		MSG_ORIG(MSG_DF1_GLOBAL) },
125*1618Srie 		{ DF_1_GROUP,		MSG_ORIG(MSG_DF1_GROUP) },
126*1618Srie 		{ DF_1_NODELETE,	MSG_ORIG(MSG_DF1_NODELETE) },
127*1618Srie 		{ DF_1_LOADFLTR,	MSG_ORIG(MSG_DF1_LOADFLTR) },
128*1618Srie 		{ DF_1_INITFIRST,	MSG_ORIG(MSG_DF1_INITFIRST) },
129*1618Srie 		{ DF_1_NOOPEN,		MSG_ORIG(MSG_DF1_NOOPEN) },
130*1618Srie 		{ DF_1_ORIGIN,		MSG_ORIG(MSG_DF1_ORIGIN) },
131*1618Srie 		{ DF_1_DIRECT,		MSG_ORIG(MSG_DF1_DIRECT) },
132*1618Srie 		{ DF_1_TRANS,		MSG_ORIG(MSG_DF1_TRANS) },
133*1618Srie 		{ DF_1_INTERPOSE,	MSG_ORIG(MSG_DF1_INTERPOSE) },
134*1618Srie 		{ DF_1_NODEFLIB,	MSG_ORIG(MSG_DF1_NODEFLIB) },
135*1618Srie 		{ DF_1_NODUMP,		MSG_ORIG(MSG_DF1_NODUMP) },
136*1618Srie 		{ DF_1_CONFALT,		MSG_ORIG(MSG_DF1_CONFALT) },
137*1618Srie 		{ DF_1_ENDFILTEE,	MSG_ORIG(MSG_DF1_ENDFILTEE) },
138*1618Srie 		{ DF_1_DISPRELPND,	MSG_ORIG(MSG_DF1_DISPRELPND) },
139*1618Srie 		{ DF_1_DISPRELDNE,	MSG_ORIG(MSG_DF1_DISPRELDNE) },
140*1618Srie 		{ DF_1_NODIRECT,	MSG_ORIG(MSG_DF1_NODIRECT) },
141*1618Srie 		{ DF_1_IGNMULDEF,	MSG_ORIG(MSG_DF1_IGNMULDEF) },
142*1618Srie 		{ DF_1_NOKSYMS,		MSG_ORIG(MSG_DF1_NOKSYMS) },
143*1618Srie 		{ DF_1_NORELOC,		MSG_ORIG(MSG_DF1_NORELOC) },
144*1618Srie 		{ 0,			0 }
145*1618Srie 	};
1460Sstevel@tonic-gate 
1470Sstevel@tonic-gate 	if (flags == 0)
1480Sstevel@tonic-gate 		return (MSG_ORIG(MSG_GBL_ZERO));
1490Sstevel@tonic-gate 
150*1618Srie 	(void) strlcpy(string, MSG_ORIG(MSG_GBL_OSQBRKT), FLAG1SZ);
151*1618Srie 	if (conv_expn_field(string, FLAG1SZ, vda, flags, flags, 0, 0))
152*1618Srie 		(void) strlcat(string, MSG_ORIG(MSG_GBL_CSQBRKT), FLAG1SZ);
1530Sstevel@tonic-gate 
154*1618Srie 	return ((const char *)string);
1550Sstevel@tonic-gate }
1560Sstevel@tonic-gate 
1570Sstevel@tonic-gate #define	FEATSZ	MSG_GBL_OSQBRKT_SIZE + \
1580Sstevel@tonic-gate 		MSG_DTF_PARINIT_SIZE + \
1590Sstevel@tonic-gate 		MSG_DTF_CONFEXP_SIZE + \
160*1618Srie 		CONV_INV_STRSIZE + MSG_GBL_CSQBRKT_SIZE
1610Sstevel@tonic-gate 
1620Sstevel@tonic-gate const char *
163*1618Srie conv_dyn_feature1(Xword flags)
1640Sstevel@tonic-gate {
165*1618Srie 	static char	string[FEATSZ];
166*1618Srie 	static Val_desc vda[] = {
167*1618Srie 		{ DTF_1_PARINIT,	MSG_ORIG(MSG_DTF_PARINIT) },
168*1618Srie 		{ DTF_1_CONFEXP,	MSG_ORIG(MSG_DTF_CONFEXP) },
169*1618Srie 		{ 0,			0 }
170*1618Srie 	};
1710Sstevel@tonic-gate 
1720Sstevel@tonic-gate 	if (flags == 0)
1730Sstevel@tonic-gate 		return (MSG_ORIG(MSG_GBL_ZERO));
1740Sstevel@tonic-gate 
175*1618Srie 	(void) strlcpy(string, MSG_ORIG(MSG_GBL_OSQBRKT), FEATSZ);
176*1618Srie 	if (conv_expn_field(string, FEATSZ, vda, flags, flags, 0, 0))
177*1618Srie 		(void) strlcat(string, MSG_ORIG(MSG_GBL_CSQBRKT), FEATSZ);
1780Sstevel@tonic-gate 
179*1618Srie 	return ((const char *)string);
1800Sstevel@tonic-gate }
1810Sstevel@tonic-gate 
1820Sstevel@tonic-gate const char *
183*1618Srie conv_dyn_tag(Xword tag, Half mach)
1840Sstevel@tonic-gate {
185*1618Srie 	static char		string[CONV_INV_STRSIZE];
186*1618Srie 	static const Msg	tags[DT_MAXPOSTAGS] = {
187*1618Srie 		MSG_DYN_NULL,		MSG_DYN_NEEDED,
188*1618Srie 		MSG_DYN_PLTRELSZ,	MSG_DYN_PLTGOT,
189*1618Srie 		MSG_DYN_HASH,		MSG_DYN_STRTAB,
190*1618Srie 		MSG_DYN_SYMTAB,		MSG_DYN_RELA,
191*1618Srie 		MSG_DYN_RELASZ,		MSG_DYN_RELAENT,
192*1618Srie 		MSG_DYN_STRSZ,		MSG_DYN_SYMENT,
193*1618Srie 		MSG_DYN_INIT,		MSG_DYN_FINI,
194*1618Srie 		MSG_DYN_SONAME,		MSG_DYN_RPATH,
195*1618Srie 		MSG_DYN_SYMBOLIC,	MSG_DYN_REL,
196*1618Srie 		MSG_DYN_RELSZ,		MSG_DYN_RELENT,
197*1618Srie 		MSG_DYN_PLTREL,		MSG_DYN_DEBUG,
198*1618Srie 		MSG_DYN_TEXTREL,	MSG_DYN_JMPREL,
199*1618Srie 		MSG_DYN_BIND_NOW,	MSG_DYN_INIT_ARRAY,
200*1618Srie 		MSG_DYN_FINI_ARRAY,	MSG_DYN_INIT_ARRAYSZ,
201*1618Srie 		MSG_DYN_FINI_ARRAYSZ,	MSG_DYN_RUNPATH,
202*1618Srie 		MSG_DYN_FLAGS,		MSG_DYN_NULL,
203*1618Srie 		MSG_DYN_PREINIT_ARRAY,	MSG_DYN_PREINIT_ARRAYSZ
204*1618Srie 	};
2050Sstevel@tonic-gate 
2060Sstevel@tonic-gate 	if (tag < DT_MAXPOSTAGS) {
2070Sstevel@tonic-gate 		/*
2080Sstevel@tonic-gate 		 * Generic dynamic tags.
2090Sstevel@tonic-gate 		 */
210*1618Srie 		return (MSG_ORIG(tags[tag]));
2110Sstevel@tonic-gate 	} else {
2120Sstevel@tonic-gate 		/*
2130Sstevel@tonic-gate 		 * SUNW: DT_LOOS -> DT_HIOS range.
2140Sstevel@tonic-gate 		 */
2150Sstevel@tonic-gate 		if (tag == DT_SUNW_AUXILIARY)
2160Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_SUNW_AUXILIARY));
2170Sstevel@tonic-gate 		else if (tag == DT_SUNW_RTLDINF)
2180Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_SUNW_RTLDINF));
2190Sstevel@tonic-gate 		else if (tag == DT_SUNW_FILTER)
2200Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_SUNW_FILTER));
2210Sstevel@tonic-gate 		else if (tag == DT_SUNW_CAP)
2220Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_SUNW_CAP));
2230Sstevel@tonic-gate 
2240Sstevel@tonic-gate 		/*
2250Sstevel@tonic-gate 		 * SUNW: DT_VALRNGLO - DT_VALRNGHI range.
2260Sstevel@tonic-gate 		 */
2270Sstevel@tonic-gate 		else if (tag == DT_CHECKSUM)
2280Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_CHECKSUM));
2290Sstevel@tonic-gate 		else if (tag == DT_PLTPADSZ)
2300Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_PLTPADSZ));
2310Sstevel@tonic-gate 		else if (tag == DT_MOVEENT)
2320Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_MOVEENT));
2330Sstevel@tonic-gate 		else if (tag == DT_MOVESZ)
2340Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_MOVESZ));
2350Sstevel@tonic-gate 		else if (tag == DT_FEATURE_1)
2360Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_FEATURE_1));
2370Sstevel@tonic-gate 		else if (tag == DT_POSFLAG_1)
2380Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_POSFLAG_1));
2390Sstevel@tonic-gate 		else if (tag == DT_SYMINSZ)
2400Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_SYMINSZ));
2410Sstevel@tonic-gate 		else if (tag == DT_SYMINENT)
2420Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_SYMINENT));
2430Sstevel@tonic-gate 
2440Sstevel@tonic-gate 		/*
2450Sstevel@tonic-gate 		 * SUNW: DT_ADDRRNGLO - DT_ADDRRNGHI range.
2460Sstevel@tonic-gate 		 */
2470Sstevel@tonic-gate 		else if (tag == DT_CONFIG)
2480Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_CONFIG));
2490Sstevel@tonic-gate 		else if (tag == DT_DEPAUDIT)
2500Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_DEPAUDIT));
2510Sstevel@tonic-gate 		else if (tag == DT_AUDIT)
2520Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_AUDIT));
2530Sstevel@tonic-gate 		else if (tag == DT_PLTPAD)
2540Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_PLTPAD));
2550Sstevel@tonic-gate 		else if (tag == DT_MOVETAB)
2560Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_MOVETAB));
2570Sstevel@tonic-gate 		else if (tag == DT_SYMINFO)
2580Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_SYMINFO));
2590Sstevel@tonic-gate 
2600Sstevel@tonic-gate 		/*
2610Sstevel@tonic-gate 		 * SUNW: generic range.
2620Sstevel@tonic-gate 		 */
2630Sstevel@tonic-gate 		else if (tag == DT_VERSYM)
2640Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_VERSYM));
2650Sstevel@tonic-gate 		else if (tag == DT_RELACOUNT)
2660Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_RELACOUNT));
2670Sstevel@tonic-gate 		else if (tag == DT_RELCOUNT)
2680Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_RELCOUNT));
2690Sstevel@tonic-gate 		else if (tag == DT_FLAGS_1)
2700Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_FLAGS_1));
2710Sstevel@tonic-gate 		else if (tag == DT_VERDEF)
2720Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_VERDEF));
2730Sstevel@tonic-gate 		else if (tag == DT_VERDEFNUM)
2740Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_VERDEFNUM));
2750Sstevel@tonic-gate 		else if (tag == DT_VERNEED)
2760Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_VERNEED));
2770Sstevel@tonic-gate 		else if (tag == DT_VERNEEDNUM)
2780Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_VERNEEDNUM));
2790Sstevel@tonic-gate 		else if (tag == DT_AUXILIARY)
2800Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_AUXILIARY));
2810Sstevel@tonic-gate 		else if (tag == DT_USED)
2820Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_USED));
2830Sstevel@tonic-gate 		else if (tag == DT_FILTER)
2840Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_FILTER));
2850Sstevel@tonic-gate 
2860Sstevel@tonic-gate 		/*
2870Sstevel@tonic-gate 		 * SUNW: machine specific range.
2880Sstevel@tonic-gate 		 */
2890Sstevel@tonic-gate 		else if (((mach == EM_SPARC) || (mach == EM_SPARCV9) ||
2900Sstevel@tonic-gate 		    (mach == EM_SPARC32PLUS)) && (tag == DT_SPARC_REGISTER))
2910Sstevel@tonic-gate 			/* this is so x86 can display a sparc binary */
2920Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_REGISTER));
2930Sstevel@tonic-gate 		else if (tag == DT_DEPRECATED_SPARC_REGISTER)
2940Sstevel@tonic-gate 			return (MSG_ORIG(MSG_DYN_REGISTER));
2950Sstevel@tonic-gate 		else
296*1618Srie 			return (conv_invalid_val(string, CONV_INV_STRSIZE,
297*1618Srie 			    tag, 0));
2980Sstevel@tonic-gate 	}
2990Sstevel@tonic-gate }
300280Srie 
301*1618Srie #define	BINDTSZ	MSG_GBL_OSQBRKT_SIZE + \
302280Srie 		MSG_BND_NEEDED_SIZE + \
303280Srie 		MSG_BND_REFER_SIZE + \
304280Srie 		MSG_BND_FILTER_SIZE + \
305*1618Srie 		CONV_INV_STRSIZE + MSG_GBL_CSQBRKT_SIZE
306280Srie 
307280Srie const char *
308*1618Srie conv_bnd_type(uint_t flags)
309280Srie {
310*1618Srie 	static char	string[BINDTSZ];
311*1618Srie 	static Val_desc vda[] = {
312*1618Srie 		{ BND_NEEDED,		MSG_ORIG(MSG_BND_NEEDED) },
313*1618Srie 		{ BND_REFER,		MSG_ORIG(MSG_BND_REFER) },
314*1618Srie 		{ BND_FILTER,		MSG_ORIG(MSG_BND_FILTER) },
315*1618Srie 		{ 0,			0 }
316*1618Srie 	};
317280Srie 
318*1618Srie 	if (flags == 0)
319*1618Srie 		return (MSG_ORIG(MSG_STR_EMPTY));
320280Srie 
321*1618Srie 	(void) strlcpy(string, MSG_ORIG(MSG_GBL_OSQBRKT), BINDTSZ);
322*1618Srie 	if (conv_expn_field(string, BINDTSZ, vda, flags, flags, 0, 0))
323*1618Srie 		(void) strlcat(string, MSG_ORIG(MSG_GBL_CSQBRKT), BINDTSZ);
324*1618Srie 
325*1618Srie 	return ((const char *)string);
326280Srie }
327280Srie 
328*1618Srie #define	BINDOSZ	MSG_GBL_OSQBRKT_SIZE + \
329280Srie 		MSG_BND_ADDED_SIZE + \
330280Srie 		MSG_BND_REEVAL_SIZE + \
331280Srie 		MSG_GBL_CSQBRKT_SIZE
332280Srie 
333280Srie const char *
334*1618Srie conv_bnd_obj(uint_t flags)
335280Srie {
336*1618Srie 	static char	string[BINDOSZ];
337*1618Srie 	static Val_desc vda[] = {
338*1618Srie 		{ LML_FLG_OBJADDED,	MSG_ORIG(MSG_BND_ADDED) },
339*1618Srie 		{ LML_FLG_OBJREEVAL,	MSG_ORIG(MSG_BND_REEVAL) },
340*1618Srie 		{ LML_FLG_OBJDELETED,	MSG_ORIG(MSG_BND_DELETED) },
341*1618Srie 		{ LML_FLG_ATEXIT,	MSG_ORIG(MSG_BND_ATEXIT) },
342*1618Srie 		{ 0,			0 }
343*1618Srie 	};
344*1618Srie 
345*1618Srie 	if (flags == 0)
346*1618Srie 		return (MSG_ORIG(MSG_STR_EMPTY));
347280Srie 
348280Srie 	/*
349*1618Srie 	 * Note, we're not worried about unknown flags for this family, only
350*1618Srie 	 * the selected flags are of interest.
351280Srie 	 */
352*1618Srie 	(void) strlcpy(string, MSG_ORIG(MSG_GBL_OSQBRKT), BINDOSZ);
353*1618Srie 	if (conv_expn_field(string, BINDOSZ, vda, flags, 0, 0, 0))
354*1618Srie 		(void) strlcat(string, MSG_ORIG(MSG_GBL_CSQBRKT), BINDOSZ);
355280Srie 
356*1618Srie 	return ((const char *)string);
357280Srie }
358