xref: /titanic_44/usr/src/cmd/sgs/libconv/common/dynamic.c (revision 672986541be54a7a471bb088e60780c37e371d7e)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 #pragma ident	"%Z%%M%	%I%	%E% SMI"
27 
28 /*
29  * String conversion routine for .dynamic tag entries.
30  */
31 #include	<stdio.h>
32 #include	<string.h>
33 #include	<sys/elf_SPARC.h>
34 #include	"rtld.h"
35 #include	"_conv.h"
36 #include	"dynamic_msg.h"
37 
38 
39 
40 /* Instantiate a local copy of conv_map2str() from _conv.h */
41 DEFINE_conv_map2str
42 
43 
44 
45 #define	POSSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
46 		MSG_DFP_LAZYLOAD_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
47 		MSG_DFP_GROUPPERM_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
48 		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
49 
50 const char *
51 conv_dyn_posflag1(Xword flags, int fmt_flags)
52 {
53 	static char	string[POSSZ];
54 	static Val_desc vda[] = {
55 		{ DF_P1_LAZYLOAD,	MSG_ORIG(MSG_DFP_LAZYLOAD) },
56 		{ DF_P1_GROUPPERM,	MSG_ORIG(MSG_DFP_GROUPPERM) },
57 		{ 0,			0 }
58 	};
59 	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda };
60 	static Val_desc vda_alt[] = {
61 		{ DF_P1_LAZYLOAD,	MSG_ORIG(MSG_DFP_LAZYLOAD_ALT) },
62 		{ DF_P1_GROUPPERM,	MSG_ORIG(MSG_DFP_GROUPPERM) },
63 		{ 0,			0 }
64 	};
65 	static CONV_EXPN_FIELD_ARG conv_arg_alt = { string, sizeof (string),
66 		vda_alt, NULL, 0, 0, MSG_ORIG(MSG_STR_EMPTY), NULL,
67 		MSG_ORIG(MSG_STR_EMPTY) };
68 
69 	CONV_EXPN_FIELD_ARG *arg;
70 
71 	if (flags == 0)
72 		return (MSG_ORIG(MSG_GBL_ZERO));
73 
74 	arg = (fmt_flags & CONV_FMT_ALTDUMP) ? &conv_arg_alt : &conv_arg;
75 	arg->oflags = arg->rflags = flags;
76 	(void) conv_expn_field(arg);
77 
78 	return ((const char *)string);
79 }
80 
81 #define	FLAGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
82 		MSG_DF_ORIGIN_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
83 		MSG_DF_SYMBOLIC_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
84 		MSG_DF_TEXTREL_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
85 		MSG_DF_BIND_NOW_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
86 		MSG_DF_STATIC_TLS_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
87 		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
88 
89 const char *
90 conv_dyn_flag(Xword flags, int fmt_flags)
91 {
92 	static char	string[FLAGSZ];
93 	static Val_desc vda[] = {
94 		{ DF_ORIGIN,		MSG_ORIG(MSG_DF_ORIGIN) },
95 		{ DF_SYMBOLIC,		MSG_ORIG(MSG_DF_SYMBOLIC) },
96 		{ DF_TEXTREL,		MSG_ORIG(MSG_DF_TEXTREL) },
97 		{ DF_BIND_NOW,		MSG_ORIG(MSG_DF_BIND_NOW) },
98 		{ DF_STATIC_TLS,	MSG_ORIG(MSG_DF_STATIC_TLS) },
99 		{ 0,			0 }
100 	};
101 	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda };
102 
103 	if (flags == 0)
104 		return (MSG_ORIG(MSG_GBL_ZERO));
105 
106 	conv_arg.oflags = conv_arg.rflags = flags;
107 	if (fmt_flags & CONV_FMT_ALTDUMP) {
108 		conv_arg.prefix = conv_arg.suffix = MSG_ORIG(MSG_STR_EMPTY);
109 	} else {
110 		conv_arg.prefix = conv_arg.suffix = NULL;
111 	}
112 	(void) conv_expn_field(&conv_arg);
113 
114 	return ((const char *)string);
115 }
116 
117 #define	FLAG1SZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
118 		MSG_DF1_NOW_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
119 		MSG_DF1_GLOBAL_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
120 		MSG_DF1_GROUP_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
121 		MSG_DF1_NODELETE_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
122 		MSG_DF1_LOADFLTR_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
123 		MSG_DF1_INITFIRST_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
124 		MSG_DF1_NOOPEN_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
125 		MSG_DF1_ORIGIN_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
126 		MSG_DF1_DIRECT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
127 		MSG_DF1_TRANS_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
128 		MSG_DF1_INTERPOSE_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
129 		MSG_DF1_NODEFLIB_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
130 		MSG_DF1_NODUMP_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
131 		MSG_DF1_CONFALT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
132 		MSG_DF1_ENDFILTEE_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
133 		MSG_DF1_DISPRELPND_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
134 		MSG_DF1_DISPRELDNE_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
135 		MSG_DF1_NODIRECT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
136 		MSG_DF1_IGNMULDEF_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
137 		MSG_DF1_NOKSYMS_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
138 		MSG_DF1_NOHDR_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
139 		MSG_DF1_NORELOC_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
140 		MSG_DF1_SYMINTPOSE_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
141 		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
142 
143 const char *
144 conv_dyn_flag1(Xword flags)
145 {
146 	static char	string[FLAG1SZ];
147 	static Val_desc vda[] = {
148 		{ DF_1_NOW,		MSG_ORIG(MSG_DF1_NOW) },
149 		{ DF_1_GLOBAL,		MSG_ORIG(MSG_DF1_GLOBAL) },
150 		{ DF_1_GROUP,		MSG_ORIG(MSG_DF1_GROUP) },
151 		{ DF_1_NODELETE,	MSG_ORIG(MSG_DF1_NODELETE) },
152 		{ DF_1_LOADFLTR,	MSG_ORIG(MSG_DF1_LOADFLTR) },
153 		{ DF_1_INITFIRST,	MSG_ORIG(MSG_DF1_INITFIRST) },
154 		{ DF_1_NOOPEN,		MSG_ORIG(MSG_DF1_NOOPEN) },
155 		{ DF_1_ORIGIN,		MSG_ORIG(MSG_DF1_ORIGIN) },
156 		{ DF_1_DIRECT,		MSG_ORIG(MSG_DF1_DIRECT) },
157 		{ DF_1_TRANS,		MSG_ORIG(MSG_DF1_TRANS) },
158 		{ DF_1_INTERPOSE,	MSG_ORIG(MSG_DF1_INTERPOSE) },
159 		{ DF_1_NODEFLIB,	MSG_ORIG(MSG_DF1_NODEFLIB) },
160 		{ DF_1_NODUMP,		MSG_ORIG(MSG_DF1_NODUMP) },
161 		{ DF_1_CONFALT,		MSG_ORIG(MSG_DF1_CONFALT) },
162 		{ DF_1_ENDFILTEE,	MSG_ORIG(MSG_DF1_ENDFILTEE) },
163 		{ DF_1_DISPRELDNE,	MSG_ORIG(MSG_DF1_DISPRELDNE) },
164 		{ DF_1_DISPRELPND,	MSG_ORIG(MSG_DF1_DISPRELPND) },
165 		{ DF_1_NODIRECT,	MSG_ORIG(MSG_DF1_NODIRECT) },
166 		{ DF_1_IGNMULDEF,	MSG_ORIG(MSG_DF1_IGNMULDEF) },
167 		{ DF_1_NOKSYMS,		MSG_ORIG(MSG_DF1_NOKSYMS) },
168 		{ DF_1_NOHDR,		MSG_ORIG(MSG_DF1_NOHDR) },
169 		{ DF_1_EDITED,		MSG_ORIG(MSG_DF1_EDITED) },
170 		{ DF_1_NORELOC,		MSG_ORIG(MSG_DF1_NORELOC) },
171 		{ DF_1_SYMINTPOSE,	MSG_ORIG(MSG_DF1_SYMINTPOSE) },
172 		{ 0,			0 }
173 	};
174 	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda };
175 
176 	if (flags == 0)
177 		return (MSG_ORIG(MSG_GBL_ZERO));
178 
179 	conv_arg.oflags = conv_arg.rflags = flags;
180 	(void) conv_expn_field(&conv_arg);
181 
182 	return ((const char *)string);
183 }
184 
185 #define	FEATSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
186 		MSG_DTF_PARINIT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
187 		MSG_DTF_CONFEXP_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
188 		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
189 
190 const char *
191 conv_dyn_feature1(Xword flags, int fmt_flags)
192 {
193 	static char	string[FEATSZ];
194 	static Val_desc vda[] = {
195 		{ DTF_1_PARINIT,	MSG_ORIG(MSG_DTF_PARINIT) },
196 		{ DTF_1_CONFEXP,	MSG_ORIG(MSG_DTF_CONFEXP) },
197 		{ 0,			0 }
198 	};
199 	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda };
200 
201 	if (flags == 0)
202 		return (MSG_ORIG(MSG_GBL_ZERO));
203 
204 	conv_arg.oflags = conv_arg.rflags = flags;
205 	if (fmt_flags & CONV_FMT_ALTDUMP) {
206 		conv_arg.prefix = conv_arg.suffix = MSG_ORIG(MSG_STR_EMPTY);
207 	} else {
208 		conv_arg.prefix = conv_arg.suffix = NULL;
209 	}
210 	(void) conv_expn_field(&conv_arg);
211 
212 	return ((const char *)string);
213 }
214 
215 const char *
216 conv_dyn_tag(Xword tag, Half mach, int fmt_flags)
217 {
218 	static Conv_inv_buf_t	string;
219 
220 	/*
221 	 * Dynamic tag values are sparse, cover a wide range, and have
222 	 * holes. To handle this efficiently, we fall through a series
223 	 * of tests below, in increasing tag order, returning at the first
224 	 * match.
225 	 *
226 	 * If we fall all the way to the end, the tag is unknown,
227 	 * and its numeric value is printed.
228 	 */
229 
230 	/*
231 	 * Most of the tag values are clustered in contiguous ranges.
232 	 * Each contiguous range of defined values is handled with
233 	 * an array that contains the message index corresponding to
234 	 * each value in that range. The DYN_RANGE macro checks the
235 	 * tag value against range of values starting at _start_tag.
236 	 * If there is a match, the index of the appropriate name is
237 	 * pulled from _array and returned to the caller.
238 	 */
239 #define	DYN_RANGE(_start_tag, _array) \
240 	if ((tag >= _start_tag) && (tag < (_start_tag + ARRAY_NELTS(_array)))) \
241 		return (MSG_ORIG(_array[tag - _start_tag]));
242 
243 
244 	/*
245 	 * Generic dynamic tags:
246 	 *	- Note hole between DT_FLAGS and DT_PREINIT_ARRAY
247 	 *	- The first range has alternative names for dump,
248 	 *	  requiring a second array.
249 	 */
250 	static const Msg	tags_null[] = {
251 		MSG_DYN_NULL,		MSG_DYN_NEEDED,
252 		MSG_DYN_PLTRELSZ,	MSG_DYN_PLTGOT,
253 		MSG_DYN_HASH,		MSG_DYN_STRTAB,
254 		MSG_DYN_SYMTAB,		MSG_DYN_RELA,
255 		MSG_DYN_RELASZ,		MSG_DYN_RELAENT,
256 		MSG_DYN_STRSZ,		MSG_DYN_SYMENT,
257 		MSG_DYN_INIT,		MSG_DYN_FINI,
258 		MSG_DYN_SONAME,		MSG_DYN_RPATH,
259 		MSG_DYN_SYMBOLIC,	MSG_DYN_REL,
260 		MSG_DYN_RELSZ,		MSG_DYN_RELENT,
261 		MSG_DYN_PLTREL,		MSG_DYN_DEBUG,
262 		MSG_DYN_TEXTREL,	MSG_DYN_JMPREL,
263 		MSG_DYN_BIND_NOW,	MSG_DYN_INIT_ARRAY,
264 		MSG_DYN_FINI_ARRAY,	MSG_DYN_INIT_ARRAYSZ,
265 		MSG_DYN_FINI_ARRAYSZ,	MSG_DYN_RUNPATH,
266 		MSG_DYN_FLAGS
267 	};
268 	static const Msg	tags_null_alt[] = {
269 		MSG_DYN_NULL,		MSG_DYN_NEEDED,
270 		MSG_DYN_PLTRELSZ_ALT,	MSG_DYN_PLTGOT,
271 		MSG_DYN_HASH,		MSG_DYN_STRTAB,
272 		MSG_DYN_SYMTAB,		MSG_DYN_RELA,
273 		MSG_DYN_RELASZ,		MSG_DYN_RELAENT,
274 		MSG_DYN_STRSZ,		MSG_DYN_SYMENT,
275 		MSG_DYN_INIT,		MSG_DYN_FINI,
276 		MSG_DYN_SONAME,		MSG_DYN_RPATH,
277 		MSG_DYN_SYMBOLIC_ALT,	MSG_DYN_REL,
278 		MSG_DYN_RELSZ,		MSG_DYN_RELENT,
279 		MSG_DYN_PLTREL,		MSG_DYN_DEBUG,
280 		MSG_DYN_TEXTREL,	MSG_DYN_JMPREL,
281 		MSG_DYN_BIND_NOW,	MSG_DYN_INIT_ARRAY,
282 		MSG_DYN_FINI_ARRAY,	MSG_DYN_INIT_ARRAYSZ,
283 		MSG_DYN_FINI_ARRAYSZ,	MSG_DYN_RUNPATH,
284 		MSG_DYN_FLAGS
285 	};
286 	static const Msg	tags_preinit_array[] = {
287 		MSG_DYN_PREINIT_ARRAY,	MSG_DYN_PREINIT_ARRAYSZ
288 	};
289 
290 	/*
291 	 * SUNW: DT_LOOS -> DT_HIOS range. Note hole between DT_SUNW_TLSSORTSZ
292 	 * and DT_SUNW_STRPAD. We handle DT_SUNW_STRPAD as a single value below.
293 	 */
294 	static const Msg	tags_sunw_auxiliary[] = {
295 		MSG_DYN_SUNW_AUXILIARY,	MSG_DYN_SUNW_RTLDINF,
296 		MSG_DYN_SUNW_FILTER,	MSG_DYN_SUNW_CAP,
297 		MSG_DYN_SUNW_SYMTAB,	MSG_DYN_SUNW_SYMSZ,
298 		MSG_DYN_SUNW_SORTENT,	MSG_DYN_SUNW_SYMSORT,
299 		MSG_DYN_SUNW_SYMSORTSZ,	MSG_DYN_SUNW_TLSSORT,
300 		MSG_DYN_SUNW_TLSSORTSZ
301 	};
302 
303 	/*
304 	 * SUNW: DT_VALRNGLO - DT_VALRNGHI range.
305 	 */
306 	static const Msg	tags_checksum[] = {
307 		MSG_DYN_CHECKSUM,	MSG_DYN_PLTPADSZ,
308 		MSG_DYN_MOVEENT,	MSG_DYN_MOVESZ,
309 		MSG_DYN_FEATURE_1,	MSG_DYN_POSFLAG_1,
310 		MSG_DYN_SYMINSZ,	MSG_DYN_SYMINENT
311 	};
312 
313 	/*
314 	 * SUNW: DT_ADDRRNGLO - DT_ADDRRNGHI range.
315 	 */
316 	static const Msg	tags_config[] = {
317 		MSG_DYN_CONFIG,		MSG_DYN_DEPAUDIT,
318 		MSG_DYN_AUDIT,		MSG_DYN_PLTPAD,
319 		MSG_DYN_MOVETAB,	MSG_DYN_SYMINFO
320 	};
321 
322 	/*
323 	 * SUNW: generic range. Note hole between DT_VERSYM and DT_RELACOUNT.
324 	 * We handle DT_VERSYM as a single value below.
325 	 */
326 	static const Msg	tags_relacount[] = {
327 		MSG_DYN_RELACOUNT,	MSG_DYN_RELCOUNT,
328 		MSG_DYN_FLAGS_1,	MSG_DYN_VERDEF,
329 		MSG_DYN_VERDEFNUM,	MSG_DYN_VERNEED,
330 		MSG_DYN_VERNEEDNUM
331 	};
332 
333 	/*
334 	 * DT_LOPROC - DT_HIPROC range.
335 	 */
336 	static const Msg	tags_auxiliary[] = {
337 		MSG_DYN_AUXILIARY,	MSG_DYN_USED,
338 		MSG_DYN_FILTER
339 	};
340 
341 
342 
343 
344 	if (tag <= DT_FLAGS)
345 		return (conv_map2str(string, sizeof (string), tag,
346 			fmt_flags, ARRAY_NELTS(tags_null), tags_null,
347 			tags_null_alt, NULL));
348 	DYN_RANGE(DT_PREINIT_ARRAY, tags_preinit_array);
349 	DYN_RANGE(DT_SUNW_AUXILIARY, tags_sunw_auxiliary);
350 	if (tag == DT_SUNW_STRPAD)
351 		return (MSG_ORIG(MSG_DYN_SUNW_STRPAD));
352 	DYN_RANGE(DT_CHECKSUM, tags_checksum);
353 	DYN_RANGE(DT_CONFIG, tags_config);
354 	if (tag == DT_VERSYM)
355 		return (MSG_ORIG(MSG_DYN_VERSYM));
356 	DYN_RANGE(DT_RELACOUNT, tags_relacount);
357 	DYN_RANGE(DT_AUXILIARY, tags_auxiliary);
358 
359 	/*
360 	 * SUNW: machine specific range.
361 	 */
362 	if (((mach == EM_SPARC) || (mach == EM_SPARCV9) ||
363 	    (mach == EM_SPARC32PLUS)) && (tag == DT_SPARC_REGISTER))
364 		/* this is so x86 can display a sparc binary */
365 		return (MSG_ORIG(MSG_DYN_REGISTER));
366 
367 	if (tag == DT_DEPRECATED_SPARC_REGISTER)
368 		return (MSG_ORIG(MSG_DYN_REGISTER));
369 
370 	/* Unknown item */
371 	return (conv_invalid_val(string, CONV_INV_STRSIZE, tag, fmt_flags));
372 
373 #undef DYN_RANGE
374 }
375 
376 #define	BINDTSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
377 		MSG_BND_NEEDED_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
378 		MSG_BND_REFER_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
379 		MSG_BND_FILTER_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
380 		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
381 
382 const char *
383 conv_bnd_type(uint_t flags)
384 {
385 	static char	string[BINDTSZ];
386 	static Val_desc vda[] = {
387 		{ BND_NEEDED,		MSG_ORIG(MSG_BND_NEEDED) },
388 		{ BND_REFER,		MSG_ORIG(MSG_BND_REFER) },
389 		{ BND_FILTER,		MSG_ORIG(MSG_BND_FILTER) },
390 		{ 0,			0 }
391 	};
392 	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda };
393 
394 	if (flags == 0)
395 		return (MSG_ORIG(MSG_STR_EMPTY));
396 
397 	conv_arg.oflags = conv_arg.rflags = flags;
398 	(void) conv_expn_field(&conv_arg);
399 
400 	return ((const char *)string);
401 }
402 
403 /*
404  * Note, conv_bnd_obj() is called with either:
405  *	LML_FLG_OBJADDED (possibly with LML_FLG_OBJREEVAL added), or
406  *	LML_FLG_OBJDELETED, or
407  *	LML_FLG_ATEXIT.
408  */
409 #define	BINDOSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
410 		MSG_BND_ADDED_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
411 		MSG_BND_REEVAL_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
412 		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
413 
414 const char *
415 conv_bnd_obj(uint_t flags)
416 {
417 	static char	string[BINDOSZ];
418 	static Val_desc vda[] = {
419 		{ LML_FLG_OBJADDED,	MSG_ORIG(MSG_BND_ADDED) },
420 		{ LML_FLG_OBJREEVAL,	MSG_ORIG(MSG_BND_REEVAL) },
421 		{ LML_FLG_OBJDELETED,	MSG_ORIG(MSG_BND_DELETED) },
422 		{ LML_FLG_ATEXIT,	MSG_ORIG(MSG_BND_ATEXIT) },
423 		{ 0,			0 }
424 	};
425 	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda };
426 
427 	if ((flags & (LML_FLG_OBJADDED | LML_FLG_OBJREEVAL |
428 	    LML_FLG_OBJDELETED | LML_FLG_ATEXIT)) == 0)
429 		return (MSG_ORIG(MSG_BND_REVISIT));
430 
431 	/*
432 	 * Note, we're not worried about unknown flags for this family, only
433 	 * the selected flags are of interest, so we leave conv_arg.rflags
434 	 * set to 0.
435 	 */
436 	conv_arg.oflags = flags;
437 	(void) conv_expn_field(&conv_arg);
438 
439 	return ((const char *)string);
440 }
441