xref: /titanic_50/usr/src/cmd/sgs/include/conv.h (revision 67318e4a54c292d543e6b077199ce492b3d3a049)
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 (c) 1988 AT&T
24  *	  All Rights Reserved
25  *
26  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
27  * Use is subject to license terms.
28  */
29 
30 #ifndef	_CONV_H
31 #define	_CONV_H
32 
33 #pragma ident	"%Z%%M%	%I%	%E% SMI"
34 
35 /*
36  * Global include file for conversion library.
37  */
38 
39 #include <stdlib.h>
40 #include <libelf.h>
41 #include <dlfcn.h>
42 #include <libld.h>
43 #include <sgs.h>
44 
45 #ifdef	__cplusplus
46 extern "C" {
47 #endif
48 
49 /*
50  * Configuration features available - maintained here (instead of debug.h)
51  * to save libconv from having to include debug.h which results in numerous
52  * "declared but not used or defined" lint errors.
53  */
54 #define	CONF_EDLIBPATH	0x000100	/* ELF default library path */
55 #define	CONF_ESLIBPATH	0x000200	/* ELF secure library path */
56 #define	CONF_ADLIBPATH	0x000400	/* AOUT default library path */
57 #define	CONF_ASLIBPATH	0x000800	/* AOUT secure library path */
58 #define	CONF_DIRCFG	0x001000	/* directory configuration available */
59 #define	CONF_OBJALT	0x002000	/* object alternatives available */
60 #define	CONF_MEMRESV	0x004000	/* memory reservation required */
61 #define	CONF_ENVS	0x008000	/* environment variables available */
62 #define	CONF_FLTR	0x010000	/* filter information available */
63 #define	CONF_FEATMSK	0xffff00
64 
65 /*
66  * Buffer types:
67  *
68  * Many of the routines in this module require the user to supply a
69  * buffer into which the desired strings may be written. These are
70  * all arrays of characters, and might be defined as simple arrays
71  * of char. The problem with that approach is that when such an array
72  * is passed to a function, the C language considers it to have the
73  * type (char *), without any regard to its length. Not all of our
74  * buffers have the same length, and we want to ensure that the compiler
75  * will refuse to compile code that passes the wrong type of buffer to
76  * a given routine. The solution is to define the buffers as unions
77  * that contain the needed array, and then to pass the given union
78  * by address. The compiler will catch attempts to pass the wrong type
79  * of pointer, and the size of a structure/union is implicit in its type.
80  *
81  * A nice side effect of this approach is that we can use a union with
82  * multiple buffers to handle the cases where a given routine needs
83  * more than one type of buffer. The end result is a single buffer large
84  * enough to handle any of the subcases, but no larger.
85  */
86 
87 /*
88  * Size of buffer used by conv_invalid_val():
89  *
90  * Various values that can't be matched to a symbolic definition are converted
91  * to a numeric string.
92  *
93  * The buffer size reflects the maximum number of digits needed to
94  * display an integer as text, plus a trailing null, and with room for
95  * a leading "0x" if hexidecimal display is selected.
96  */
97 #define	CONV32_INV_BUFSIZE	12
98 typedef union {
99 	char			buf[CONV32_INV_BUFSIZE];
100 } Conv32_inv_buf_t;
101 
102 #define	CONV64_INV_BUFSIZE	22
103 typedef union {
104 	char			buf[CONV64_INV_BUFSIZE];
105 } Conv64_inv_buf_t;
106 
107 
108 
109 /* conv_ehdr_flags() */
110 #define	CONV_EHDR_FLAGS_BASE_BUFSIZE	69
111 #define	CONV32_EHDR_FLAGS_BUFSIZE	\
112 	(CONV_EHDR_FLAGS_BASE_BUFSIZE + CONV32_INV_BUFSIZE)
113 typedef union {
114 	Conv32_inv_buf_t	inv_buf;
115 	char			buf[CONV32_EHDR_FLAGS_BUFSIZE];
116 } Conv32_ehdr_flags_buf_t;
117 
118 #define	CONV64_EHDR_FLAGS_BUFSIZE	\
119 	(CONV_EHDR_FLAGS_BASE_BUFSIZE + CONV64_INV_BUFSIZE)
120 typedef union {
121 	Conv64_inv_buf_t	inv_buf;
122 	char			buf[CONV64_EHDR_FLAGS_BUFSIZE];
123 } Conv64_ehdr_flags_buf_t;
124 
125 
126 /* conv_reject_desc() */
127 typedef union {
128 	Conv32_inv_buf_t	inv_buf;
129 	Conv32_ehdr_flags_buf_t	flags_buf;
130 } Conv32_reject_desc_buf_t;
131 
132 typedef union {
133 	Conv64_inv_buf_t	inv_buf;
134 	Conv64_ehdr_flags_buf_t	flags_buf;
135 } Conv64_reject_desc_buf_t;
136 
137 
138 /*
139  * conv_cap_val_hw1()
140  *
141  * This size is based on the maximum number of hardware capabilities
142  * that exist.  See common/elfcap.
143  */
144 #define	CONV_CAP_VAL_HW1_BUFSIZE	195
145 
146 typedef union {
147 	Conv32_inv_buf_t	inv_buf;
148 	char			buf[CONV_CAP_VAL_HW1_BUFSIZE];
149 } Conv32_cap_val_hw1_buf_t;
150 
151 typedef union {
152 	Conv64_inv_buf_t	inv_buf;
153 	char			buf[CONV_CAP_VAL_HW1_BUFSIZE];
154 } Conv64_cap_val_hw1_buf_t;
155 
156 
157 /*
158  * conv_cap_val_sf1()
159  *
160  * This size is based on the maximum number of software capabilities
161  * that exist.  See common/elfcap.
162  */
163 #define	CONV_CAP_VAL_SF1_BUFSIZE	45
164 
165 typedef union {
166 	Conv32_inv_buf_t	inv_buf;
167 	char			buf[CONV_CAP_VAL_SF1_BUFSIZE];
168 } Conv32_cap_val_sf1_buf_t;
169 
170 typedef union {
171 	Conv64_inv_buf_t	inv_buf;
172 	char			buf[CONV_CAP_VAL_SF1_BUFSIZE];
173 } Conv64_cap_val_sf1_buf_t;
174 
175 
176 
177 /* conv_cap_val_buf() */
178 typedef union {
179 	Conv32_inv_buf_t		inv_buf;
180 	Conv32_cap_val_hw1_buf_t	cap_val_hw1_buf;
181 	Conv32_cap_val_sf1_buf_t	cap_val_sf1_buf;
182 } Conv32_cap_val_buf_t;
183 
184 typedef union {
185 	Conv64_inv_buf_t		inv_buf;
186 	Conv64_cap_val_hw1_buf_t	cap_val_hw1_buf;
187 	Conv64_cap_val_sf1_buf_t	cap_val_sf1_buf;
188 } Conv64_cap_val_buf_t;
189 
190 
191 /* conv_config_feat() */
192 #define	CONV_CONFIG_FEAT_BUFSIZE	194
193 
194 typedef union {
195 	Conv32_inv_buf_t	inv_buf;
196 	char			buf[CONV_CONFIG_FEAT_BUFSIZE];
197 } Conv32_config_feat_buf_t;
198 
199 typedef union {
200 	Conv64_inv_buf_t	inv_buf;
201 	char			buf[CONV_CONFIG_FEAT_BUFSIZE];
202 } Conv64_config_feat_buf_t;
203 
204 
205 /* conv_config_obj() */
206 #define	CONV_CONFIG_OBJ_BUFSIZE		154
207 
208 typedef union {
209 	Conv32_inv_buf_t	inv_buf;
210 	char			buf[CONV_CONFIG_OBJ_BUFSIZE];
211 } Conv32_config_obj_buf_t;
212 
213 typedef union {
214 	Conv64_inv_buf_t	inv_buf;
215 	char			buf[CONV_CONFIG_OBJ_BUFSIZE];
216 } Conv64_config_obj_buf_t;
217 
218 
219 /* conv_dl_mode() */
220 #define	CONV_DL_MODE_BUFSIZE		122
221 
222 typedef union {
223 	Conv32_inv_buf_t	inv_buf;
224 	char			buf[CONV_DL_MODE_BUFSIZE];
225 } Conv32_dl_mode_buf_t;
226 
227 typedef union {
228 	Conv64_inv_buf_t	inv_buf;
229 	char			buf[CONV_DL_MODE_BUFSIZE];
230 } Conv64_dl_mode_buf_t;
231 
232 
233 /* conv_dl_flag() */
234 #define	CONV_DL_FLAG_BUFSIZE		175
235 
236 typedef union {
237 	Conv32_inv_buf_t	inv_buf;
238 	char			buf[CONV_DL_FLAG_BUFSIZE];
239 } Conv32_dl_flag_buf_t;
240 
241 typedef union {
242 	Conv64_inv_buf_t	inv_buf;
243 	char			buf[CONV_DL_FLAG_BUFSIZE];
244 } Conv64_dl_flag_buf_t;
245 
246 
247 /* conv_grphdl_flags() */
248 #define	CONV_GRPHDL_FLAGS_BUFSIZE	82
249 
250 typedef union {
251 	Conv32_inv_buf_t	inv_buf;
252 	char			buf[CONV_GRPHDL_FLAGS_BUFSIZE];
253 } Conv32_grphdl_flags_buf_t;
254 
255 typedef union {
256 	Conv64_inv_buf_t	inv_buf;
257 	char			buf[CONV_GRPHDL_FLAGS_BUFSIZE];
258 } Conv64_grphdl_flags_buf_t;
259 
260 
261 /* conv_grpdesc_flags() */
262 #define	CONV_GRPDESC_FLAGS_BUFSIZE	92
263 
264 typedef union {
265 	Conv32_inv_buf_t	inv_buf;
266 	char			buf[CONV_GRPDESC_FLAGS_BUFSIZE];
267 } Conv32_grpdesc_flags_buf_t;
268 
269 typedef union {
270 	Conv64_inv_buf_t	inv_buf;
271 	char			buf[CONV_GRPDESC_FLAGS_BUFSIZE];
272 } Conv64_grpdesc_flags_buf_t;
273 
274 
275 /* conv_seg_flags() */
276 #define	CONV_SEG_FLAGS_BUFSIZE		186
277 
278 typedef union {
279 	Conv32_inv_buf_t	inv_buf;
280 	char			buf[CONV_SEG_FLAGS_BUFSIZE];
281 } Conv32_seg_flags_buf_t;
282 
283 typedef union {
284 	Conv64_inv_buf_t	inv_buf;
285 	char			buf[CONV_SEG_FLAGS_BUFSIZE];
286 } Conv64_seg_flags_buf_t;
287 
288 
289 /* conv_dyn_posflag1() */
290 #define	CONV_DYN_POSFLAG1_BASE_BUFSIZE	23
291 #define	CONV32_DYN_POSFLAG1_BUFSIZE	\
292 	(CONV_DYN_POSFLAG1_BASE_BUFSIZE + CONV32_INV_BUFSIZE)
293 typedef union {
294 	Conv32_inv_buf_t	inv_buf;
295 	char			buf[CONV32_DYN_POSFLAG1_BUFSIZE];
296 } Conv32_dyn_posflag1_buf_t;
297 
298 #define	CONV64_DYN_POSFLAG1_BUFSIZE	\
299 	(CONV_DYN_POSFLAG1_BASE_BUFSIZE + CONV64_INV_BUFSIZE)
300 typedef union {
301 	Conv64_inv_buf_t	inv_buf;
302 	char			buf[CONV64_DYN_POSFLAG1_BUFSIZE];
303 } Conv64_dyn_posflag1_buf_t;
304 
305 
306 /* conv_dyn_flag() */
307 #define	CONV_DYN_FLAG_BASE_BUFSIZE	48
308 #define	CONV32_DYN_FLAG_BUFSIZE	\
309 	(CONV_DYN_FLAG_BASE_BUFSIZE + CONV32_INV_BUFSIZE)
310 typedef union {
311 	Conv32_inv_buf_t	inv_buf;
312 	char			buf[CONV32_DYN_FLAG_BUFSIZE];
313 } Conv32_dyn_flag_buf_t;
314 
315 #define	CONV64_DYN_FLAG_BUFSIZE	\
316 	(CONV_DYN_FLAG_BASE_BUFSIZE + CONV64_INV_BUFSIZE)
317 typedef union {
318 	Conv64_inv_buf_t	inv_buf;
319 	char			buf[CONV64_DYN_FLAG_BUFSIZE];
320 } Conv64_dyn_flag_buf_t;
321 
322 
323 /* conv_dyn_flag1() */
324 #define	CONV_DYN_FLAG1_BASE_BUFSIZE	265
325 #define	CONV32_DYN_FLAG1_BUFSIZE	\
326 	(CONV_DYN_FLAG1_BASE_BUFSIZE + CONV32_INV_BUFSIZE)
327 typedef union {
328 	Conv32_inv_buf_t	inv_buf;
329 	char			buf[CONV32_DYN_FLAG1_BUFSIZE];
330 } Conv32_dyn_flag1_buf_t;
331 
332 #define	CONV64_DYN_FLAG1_BUFSIZE	\
333 	(CONV_DYN_FLAG1_BASE_BUFSIZE + CONV64_INV_BUFSIZE)
334 typedef union {
335 	Conv64_inv_buf_t	inv_buf;
336 	char			buf[CONV64_DYN_FLAG1_BUFSIZE];
337 } Conv64_dyn_flag1_buf_t;
338 
339 
340 /* conv_dyn_feature1() */
341 #define	CONV_DYN_FEATURE1_BASE_BUFSIZE	20
342 #define	CONV32_DYN_FEATURE1_BUFSIZE	\
343 	(CONV_DYN_FEATURE1_BASE_BUFSIZE + CONV32_INV_BUFSIZE)
344 typedef union {
345 	Conv32_inv_buf_t	inv_buf;
346 	char			buf[CONV32_DYN_FEATURE1_BUFSIZE];
347 } Conv32_dyn_feature1_buf_t;
348 
349 #define	CONV64_DYN_FEATURE1_BUFSIZE	\
350 	(CONV_DYN_FEATURE1_BASE_BUFSIZE + CONV64_INV_BUFSIZE)
351 typedef union {
352 	Conv64_inv_buf_t	inv_buf;
353 	char			buf[CONV64_DYN_FEATURE1_BUFSIZE];
354 } Conv64_dyn_feature1_buf_t;
355 
356 
357 /* conv_bnd_type() */
358 #define	CONV_BND_TYPE_BASE_BUFSIZE	29
359 #define	CONV32_BND_TYPE_BUFSIZE	\
360 	(CONV_BND_TYPE_BASE_BUFSIZE + CONV32_INV_BUFSIZE)
361 typedef union {
362 	Conv32_inv_buf_t	inv_buf;
363 	char			buf[CONV32_BND_TYPE_BUFSIZE];
364 } Conv32_bnd_type_buf_t;
365 
366 #define	CONV64_BND_TYPE_BUFSIZE	\
367 	(CONV_BND_TYPE_BASE_BUFSIZE + CONV64_INV_BUFSIZE)
368 typedef union {
369 	Conv64_inv_buf_t	inv_buf;
370 	char			buf[CONV64_BND_TYPE_BUFSIZE];
371 } Conv64_bnd_type_buf_t;
372 
373 
374 /* conv_bnd_obj() */
375 #define	CONV_BND_OBJ_BASE_BUFSIZE	38
376 #define	CONV32_BND_OBJ_BUFSIZE	\
377 	(CONV_BND_OBJ_BASE_BUFSIZE + CONV32_INV_BUFSIZE)
378 typedef union {
379 	Conv32_inv_buf_t	inv_buf;
380 	char			buf[CONV32_BND_OBJ_BUFSIZE];
381 } Conv32_bnd_obj_buf_t;
382 
383 #define	CONV64_BND_OBJ_BUFSIZE	\
384 	(CONV_BND_OBJ_BASE_BUFSIZE + CONV64_INV_BUFSIZE)
385 typedef union {
386 	Conv64_inv_buf_t	inv_buf;
387 	char			buf[CONV64_BND_OBJ_BUFSIZE];
388 } Conv64_bnd_obj_buf_t;
389 
390 
391 /* conv_phdr_flags() */
392 #define	CONV_PHDR_FLAGS_BASE_BUFSIZE	35
393 #define	CONV32_PHDR_FLAGS_BUFSIZE	\
394 	(CONV_PHDR_FLAGS_BASE_BUFSIZE + CONV32_INV_BUFSIZE)
395 typedef union {
396 	Conv32_inv_buf_t	inv_buf;
397 	char			buf[CONV32_PHDR_FLAGS_BUFSIZE];
398 } Conv32_phdr_flags_buf_t;
399 
400 #define	CONV64_PHDR_FLAGS_BUFSIZE	\
401 	(CONV_PHDR_FLAGS_BASE_BUFSIZE + CONV64_INV_BUFSIZE)
402 typedef union {
403 	Conv64_inv_buf_t	inv_buf;
404 	char			buf[CONV64_PHDR_FLAGS_BUFSIZE];
405 } Conv64_phdr_flags_buf_t;
406 
407 
408 /* conv_sec_flags() */
409 #define	CONV_SEC_FLAGS_BASE_BUFSIZE	168
410 #define	CONV32_SEC_FLAGS_BUFSIZE	\
411 	(CONV_SEC_FLAGS_BASE_BUFSIZE + CONV32_INV_BUFSIZE)
412 typedef union {
413 	Conv32_inv_buf_t	inv_buf;
414 	char			buf[CONV32_SEC_FLAGS_BUFSIZE];
415 } Conv32_sec_flags_buf_t;
416 
417 #define	CONV64_SEC_FLAGS_BUFSIZE	\
418 	(CONV_SEC_FLAGS_BASE_BUFSIZE + CONV64_INV_BUFSIZE)
419 typedef union {
420 	Conv64_inv_buf_t	inv_buf;
421 	char			buf[CONV64_SEC_FLAGS_BUFSIZE];
422 } Conv64_sec_flags_buf_t;
423 
424 
425 /* conv_dwarf_ehe() */
426 #define	CONV_DWARF_EHE_BUFSIZE		33
427 typedef union {
428 	Conv32_inv_buf_t	inv_buf;
429 	char			buf[CONV_DWARF_EHE_BUFSIZE];
430 } Conv32_dwarf_ehe_buf_t;
431 typedef union {
432 	Conv64_inv_buf_t	inv_buf;
433 	char			buf[CONV_DWARF_EHE_BUFSIZE];
434 } Conv64_dwarf_ehe_buf_t;
435 
436 
437 /* conv_syminfo_flags() */
438 #define	CONV_SYMINFO_FLAGS_BASE_BUFSIZE	36
439 #define	CONV32_SYMINFO_FLAGS_BUFSIZE	\
440 	(CONV_SYMINFO_FLAGS_BASE_BUFSIZE + CONV32_INV_BUFSIZE)
441 typedef union {
442 	Conv32_inv_buf_t	inv_buf;
443 	char			buf[CONV32_SYMINFO_FLAGS_BUFSIZE];
444 } Conv32_syminfo_flags_buf_t;
445 
446 #define	CONV64_SYMINFO_FLAGS_BUFSIZE	\
447 	(CONV_SYMINFO_FLAGS_BASE_BUFSIZE + CONV64_INV_BUFSIZE)
448 typedef union {
449 	Conv64_inv_buf_t	inv_buf;
450 	char			buf[CONV64_SYMINFO_FLAGS_BUFSIZE];
451 } Conv64_syminfo_flags_buf_t;
452 
453 
454 /* conv_cnote_pr_flags() */
455 #define	CONV_CNOTE_PR_FLAGS_BUFSIZE	244
456 typedef union {
457 	Conv32_inv_buf_t	inv_buf;
458 	char			buf[CONV_CNOTE_PR_FLAGS_BUFSIZE];
459 } Conv32_cnote_pr_flags_buf_t;
460 typedef union {
461 	Conv64_inv_buf_t	inv_buf;
462 	char			buf[CONV_CNOTE_PR_FLAGS_BUFSIZE];
463 } Conv64_cnote_pr_flags_buf_t;
464 
465 
466 /* conv_cnote_old_pr_flags() */
467 #define	CONV_CNOTE_OLD_PR_FLAGS_BUFSIZE	164
468 typedef union {
469 	Conv32_inv_buf_t	inv_buf;
470 	char			buf[CONV_CNOTE_OLD_PR_FLAGS_BUFSIZE];
471 } Conv32_cnote_old_pr_flags_buf_t;
472 typedef union {
473 	Conv64_inv_buf_t	inv_buf;
474 	char			buf[CONV_CNOTE_OLD_PR_FLAGS_BUFSIZE];
475 } Conv64_cnote_old_pr_flags_buf_t;
476 
477 
478 /* conv_cnote_proc_flag() */
479 #define	CONV_CNOTE_PROC_FLAG_BUFSIZE	29
480 typedef union {
481 	Conv32_inv_buf_t	inv_buf;
482 	char			buf[CONV_CNOTE_PROC_FLAG_BUFSIZE];
483 } Conv32_cnote_proc_flag_buf_t;
484 typedef union {
485 	Conv64_inv_buf_t	inv_buf;
486 	char			buf[CONV_CNOTE_PROC_FLAG_BUFSIZE];
487 } Conv64_cnote_proc_flag_buf_t;
488 
489 
490 /* conv_cnote_sigset() */
491 #define	CONV_CNOTE_SIGSET_BUFSIZE	629
492 typedef union {
493 	Conv32_inv_buf_t	inv_buf;
494 	char			buf[CONV_CNOTE_SIGSET_BUFSIZE];
495 } Conv32_cnote_sigset_buf_t;
496 typedef union {
497 	Conv64_inv_buf_t	inv_buf;
498 	char			buf[CONV_CNOTE_SIGSET_BUFSIZE];
499 } Conv64_cnote_sigset_buf_t;
500 
501 
502 /* conv_cnote_fltset() */
503 #define	CONV_CNOTE_FLTSET_BUFSIZE	501
504 typedef union {
505 	Conv32_inv_buf_t	inv_buf;
506 	char			buf[CONV_CNOTE_FLTSET_BUFSIZE];
507 } Conv32_cnote_fltset_buf_t;
508 typedef union {
509 	Conv64_inv_buf_t	inv_buf;
510 	char			buf[CONV_CNOTE_FLTSET_BUFSIZE];
511 } Conv64_cnote_fltset_buf_t;
512 
513 
514 /* conv_cnote_sysset() */
515 #define	CONV_CNOTE_SYSSET_BUFSIZE	3212
516 typedef union {
517 	Conv32_inv_buf_t	inv_buf;
518 	char			buf[CONV_CNOTE_SYSSET_BUFSIZE];
519 } Conv32_cnote_sysset_buf_t;
520 typedef union {
521 	Conv64_inv_buf_t	inv_buf;
522 	char			buf[CONV_CNOTE_SYSSET_BUFSIZE];
523 } Conv64_cnote_sysset_buf_t;
524 
525 
526 /* conv_cnote_sa_flags() */
527 #define	CONV_CNOTE_SA_FLAGS_BUFSIZE	99
528 typedef union {
529 	Conv32_inv_buf_t	inv_buf;
530 	char			buf[CONV_CNOTE_SA_FLAGS_BUFSIZE];
531 } Conv32_cnote_sa_flags_buf_t;
532 typedef union {
533 	Conv64_inv_buf_t	inv_buf;
534 	char			buf[CONV_CNOTE_SA_FLAGS_BUFSIZE];
535 } Conv64_cnote_sa_flags_buf_t;
536 
537 
538 /* conv_cnote_ss_flags() */
539 #define	CONV_CNOTE_SS_FLAGS_BUFSIZE	38
540 typedef union {
541 	Conv32_inv_buf_t	inv_buf;
542 	char			buf[CONV_CNOTE_SS_FLAGS_BUFSIZE];
543 } Conv32_cnote_ss_flags_buf_t;
544 typedef union {
545 	Conv64_inv_buf_t	inv_buf;
546 	char			buf[CONV_CNOTE_SS_FLAGS_BUFSIZE];
547 } Conv64_cnote_ss_flags_buf_t;
548 
549 
550 /* conv_cnote_cc_content() */
551 #define	CONV_CNOTE_CC_CONTENT_BUFSIZE	87
552 typedef union {
553 	Conv32_inv_buf_t	inv_buf;
554 	char			buf[CONV_CNOTE_CC_CONTENT_BUFSIZE];
555 } Conv32_cnote_cc_content_buf_t;
556 typedef union {
557 	Conv64_inv_buf_t	inv_buf;
558 	char			buf[CONV_CNOTE_CC_CONTENT_BUFSIZE];
559 } Conv64_cnote_cc_content_buf_t;
560 
561 
562 /* conv_cnote_auxv_af() */
563 #define	CONV_CNOTE_AUXV_AF_BUFSIZE	63
564 typedef union {
565 	Conv32_inv_buf_t	inv_buf;
566 	char			buf[CONV_CNOTE_AUXV_AF_BUFSIZE];
567 } Conv32_cnote_auxv_af_buf_t;
568 typedef union {
569 	Conv64_inv_buf_t	inv_buf;
570 	char			buf[CONV_CNOTE_AUXV_AF_BUFSIZE];
571 } Conv64_cnote_auxv_af_buf_t;
572 
573 
574 
575 /*
576  * Generic names for class specific buffer types above
577  */
578 #if	defined(_ELF64)
579 #define	CONV_INV_BUFSIZE		CONV64_INV_BUFSIZE
580 #define	CONV_EHDR_FLAGS_BUFSIZE		CONV64_EHDR_FLAGS_BUFSIZE
581 #define	CONV_DYN_POSFLAG1_BUFSIZE	CONV64_DYN_POSFLAG1_BUFSIZE
582 #define	CONV_DYN_FLAG_BUFSIZE		CONV64_DYN_FLAG_BUFSIZE
583 #define	CONV_DYN_FLAG1_BUFSIZE		CONV64_DYN_FLAG1_BUFSIZE
584 #define	CONV_DYN_FEATURE1_BUFSIZE	CONV64_DYN_FEATURE1_BUFSIZE
585 #define	CONV_BND_TYPE_BUFSIZE		CONV64_BND_TYPE_BUFSIZE
586 #define	CONV_BND_OBJ_BUFSIZE		CONV64_BND_OBJ_BUFSIZE
587 #define	CONV_PHDR_FLAGS_BUFSIZE		CONV64_PHDR_FLAGS_BUFSIZE
588 #define	CONV_SEC_FLAGS_BUFSIZE		CONV64_SEC_FLAGS_BUFSIZE
589 #define	CONV_SYMINFO_FLAGS_BUFSIZE	CONV64_SYMINFO_FLAGS_BUFSIZE
590 
591 #define	Conv_inv_buf_t			Conv64_inv_buf_t
592 #define	Conv_ehdr_flags_buf_t		Conv64_ehdr_flags_buf_t
593 #define	Conv_reject_desc_buf_t		Conv64_reject_desc_buf_t
594 #define	Conv_cap_val_hw1_buf_t		Conv64_cap_val_hw1_buf_t
595 #define	Conv_cap_val_sf1_buf_t		Conv64_cap_val_sf1_buf_t
596 #define	Conv_cap_val_buf_t		Conv64_cap_val_buf_t
597 #define	Conv_config_feat_buf_t		Conv64_config_feat_buf_t
598 #define	Conv_config_obj_buf_t		Conv64_config_obj_buf_t
599 #define	Conv_dl_mode_buf_t		Conv64_dl_mode_buf_t
600 #define	Conv_dl_flag_buf_t		Conv64_dl_flag_buf_t
601 #define	Conv_grphdl_flags_buf_t		Conv64_grphdl_flags_buf_t
602 #define	Conv_grpdesc_flags_buf_t	Conv64_grpdesc_flags_buf_t
603 #define	Conv_seg_flags_buf_t		Conv64_seg_flags_buf_t
604 #define	Conv_dyn_posflag1_buf_t		Conv64_dyn_posflag1_buf_t
605 #define	Conv_dyn_flag_buf_t		Conv64_dyn_flag_buf_t
606 #define	Conv_dyn_flag1_buf_t		Conv64_dyn_flag1_buf_t
607 #define	Conv_dyn_feature1_buf_t		Conv64_dyn_feature1_buf_t
608 #define	Conv_bnd_type_buf_t		Conv64_bnd_type_buf_t
609 #define	Conv_bnd_obj_buf_t		Conv64_bnd_obj_buf_t
610 #define	Conv_phdr_flags_buf_t		Conv64_phdr_flags_buf_t
611 #define	Conv_sec_flags_buf_t		Conv64_sec_flags_buf_t
612 #define	Conv_dwarf_ehe_buf_t		Conv64_dwarf_ehe_buf_t
613 #define	Conv_syminfo_flags_buf_t	Conv64_syminfo_flags_buf_t
614 #define	Conv_cnote_pr_flags_buf_t	Conv64_cnote_pr_flags_buf_t
615 #define	Conv_cnote_old_pr_flags_buf_t	Conv64_cnote_old_pr_flags_buf_t
616 #define	Conv_cnote_proc_flag_buf_t	Conv64_cnote_proc_flag_buf_t
617 #define	Conv_cnote_sigset_buf_t		Conv64_cnote_sigset_buf_t
618 #define	Conv_cnote_fltset_buf_t		Conv64_cnote_fltset_buf_t
619 #define	Conv_cnote_sysset_buf_t		Conv64_cnote_sysset_buf_t
620 #define	Conv_cnote_sa_flags_buf_t	Conv64_cnote_sa_flags_buf_t
621 #define	Conv_cnote_ss_flags_buf_t	Conv64_cnote_ss_flags_buf_t
622 #define	Conv_cnote_cc_content_buf_t	Conv64_cnote_cc_content_buf_t
623 #define	Conv_cnote_auxv_af_buf_t	Conv64_cnote_auxv_af_buf_t
624 #else
625 #define	CONV_INV_BUFSIZE		CONV32_INV_BUFSIZE
626 #define	CONV_EHDR_FLAGS_BUFSIZE		CONV32_EHDR_FLAGS_BUFSIZE
627 #define	CONV_DYN_POSFLAG1_BUFSIZE	CONV32_DYN_POSFLAG1_BUFSIZE
628 #define	CONV_DYN_FLAG_BUFSIZE		CONV32_DYN_FLAG_BUFSIZE
629 #define	CONV_DYN_FLAG1_BUFSIZE		CONV32_DYN_FLAG1_BUFSIZE
630 #define	CONV_DYN_FEATURE1_BUFSIZE	CONV32_DYN_FEATURE1_BUFSIZE
631 #define	CONV_BND_TYPE_BUFSIZE		CONV32_BND_TYPE_BUFSIZE
632 #define	CONV_BND_OBJ_BUFSIZE		CONV32_BND_OBJ_BUFSIZE
633 #define	CONV_PHDR_FLAGS_BUFSIZE		CONV32_PHDR_FLAGS_BUFSIZE
634 #define	CONV_SEC_FLAGS_BUFSIZE		CONV32_SEC_FLAGS_BUFSIZE
635 #define	CONV_SYMINFO_FLAGS_BUFSIZE	CONV32_SYMINFO_FLAGS_BUFSIZE
636 
637 #define	Conv_inv_buf_t			Conv32_inv_buf_t
638 #define	Conv_ehdr_flags_buf_t		Conv32_ehdr_flags_buf_t
639 #define	Conv_reject_desc_buf_t		Conv32_reject_desc_buf_t
640 #define	Conv_cap_val_hw1_buf_t		Conv32_cap_val_hw1_buf_t
641 #define	Conv_cap_val_sf1_buf_t		Conv32_cap_val_sf1_buf_t
642 #define	Conv_cap_val_buf_t		Conv32_cap_val_buf_t
643 #define	Conv_config_feat_buf_t		Conv32_config_feat_buf_t
644 #define	Conv_config_obj_buf_t		Conv32_config_obj_buf_t
645 #define	Conv_dl_mode_buf_t		Conv32_dl_mode_buf_t
646 #define	Conv_dl_flag_buf_t		Conv32_dl_flag_buf_t
647 #define	Conv_grphdl_flags_buf_t		Conv32_grphdl_flags_buf_t
648 #define	Conv_grpdesc_flags_buf_t	Conv32_grpdesc_flags_buf_t
649 #define	Conv_seg_flags_buf_t		Conv32_seg_flags_buf_t
650 #define	Conv_dyn_posflag1_buf_t		Conv32_dyn_posflag1_buf_t
651 #define	Conv_dyn_flag_buf_t		Conv32_dyn_flag_buf_t
652 #define	Conv_dyn_flag1_buf_t		Conv32_dyn_flag1_buf_t
653 #define	Conv_dyn_feature1_buf_t		Conv32_dyn_feature1_buf_t
654 #define	Conv_bnd_type_buf_t		Conv32_bnd_type_buf_t
655 #define	Conv_bnd_obj_buf_t		Conv32_bnd_obj_buf_t
656 #define	Conv_phdr_flags_buf_t		Conv32_phdr_flags_buf_t
657 #define	Conv_sec_flags_buf_t		Conv32_sec_flags_buf_t
658 #define	Conv_dwarf_ehe_buf_t		Conv32_dwarf_ehe_buf_t
659 #define	Conv_syminfo_flags_buf_t	Conv32_syminfo_flags_buf_t
660 #define	Conv_cnote_pr_flags_buf_t	Conv32_cnote_pr_flags_buf_t
661 #define	Conv_cnote_old_pr_flags_buf_t	Conv32_cnote_old_pr_flags_buf_t
662 #define	Conv_cnote_proc_flag_buf_t	Conv32_cnote_proc_flag_buf_t
663 #define	Conv_cnote_sigset_buf_t		Conv32_cnote_sigset_buf_t
664 #define	Conv_cnote_fltset_buf_t		Conv32_cnote_fltset_buf_t
665 #define	Conv_cnote_sysset_buf_t		Conv32_cnote_sysset_buf_t
666 #define	Conv_cnote_sa_flags_buf_t	Conv32_cnote_sa_flags_buf_t
667 #define	Conv_cnote_ss_flags_buf_t	Conv32_cnote_ss_flags_buf_t
668 #define	Conv_cnote_cc_content_buf_t	Conv32_cnote_cc_content_buf_t
669 #define	Conv_cnote_auxv_af_buf_t	Conv32_cnote_auxv_af_buf_t
670 #endif
671 
672 
673 
674 
675 /*
676  * Many conversion routines accept a fmt_flags argument of this type
677  * to allow the caller to modify the output. There are two parts to
678  * this value:
679  *
680  *	(1) Format requests (decimal vs hex, etc...)
681  *	(2) The low order bits specified by CONV_MASK_FMT_ALT
682  *		and retrieved by CONV_TYPE_FMT_ALT are integer
683  *		values that specify that an alternate set of
684  *		strings should be used. This is necessary because
685  *		different utilities evolved to use different strings,
686  *		and there are backward compatability guarantees in
687  *		place that prevent changing them.
688  *
689  * These values are designed such that a caller can always supply a
690  * simple 0 in order to receive "default" behavior.
691  */
692 typedef int Conv_fmt_flags_t;
693 
694 /*
695  * The bottom 8 bits of Conv_fmt_flags_t are used to encode
696  * alternative strings.
697  *
698  * If a given conversion routine does not support alternative strings
699  * for a given CONV_FMT_ALT type, it silently ignores the request and
700  * supplies the default set. This means that a utility like dump(1) is
701  * free to specify its special type in every conversion routine call,
702  * without regard to whether it has any special meaning for that particular
703  * routine. It will receive its special strings if there are any, and
704  * the defaults otherwise.
705  */
706 #define	CONV_MASK_FMT_ALT		0xff
707 #define	CONV_TYPE_FMT_ALT(fmt_flags)	(fmt_flags & CONV_MASK_FMT_ALT)
708 
709 #define	CONV_FMT_ALT_DEFAULT	0	/* "Standard" strings */
710 #define	CONV_FMT_ALT_DUMP	1	/* Style of strings used by dump(1) */
711 #define	CONV_FMT_ALT_FILE	2	/* Style of strings used by file(1) */
712 #define	CONV_FMT_ALT_CRLE	3	/* Style of strings used by crle(1) */
713 #define	CONV_FMT_ALT_FULLNAME	4	/* Strings should be full #define */
714 					/* 	(e.g. STB_LOCAL, not LOCL) */
715 
716 /*
717  * Flags that alter standard formatting for conversion routines.
718  * These bits start after the range occupied by CONV_MASK_FMT_ALT.
719  */
720 #define	CONV_FMT_DECIMAL	0x0100	/* conv_invalid_val() should print */
721 					/*    integer print as decimal */
722 					/*    (default is hex) */
723 #define	CONV_FMT_SPACE		0x0200	/* conv_invalid_val() should append */
724 					/*    a space after the number.  */
725 #define	CONV_FMT_NOBKT		0x0400	/* conv_expn_field() should omit */
726 					/*    prefix and suffix strings */
727 
728 
729 /*
730  * The expansion of bit-field data items is driven from a value descriptor and
731  * the conv_expn_field() routine.
732  */
733 typedef struct {
734 	Xword		v_val;		/* expansion value */
735 	const char	*v_msg;		/* associated message string */
736 } Val_desc;
737 
738 /*
739  * conv_expn_field() is willing to supply default strings for the
740  * prefix, separator, and suffix arguments, if they are passed as NULL.
741  * The caller needs to know how much room to allow for these items.
742  * These values supply those sizes.
743  */
744 #define	CONV_EXPN_FIELD_DEF_PREFIX_SIZE	2	/* Default is "[ " */
745 #define	CONV_EXPN_FIELD_DEF_SEP_SIZE	1	/* Default is " " */
746 #define	CONV_EXPN_FIELD_DEF_SUFFIX_SIZE	2	/* Default is " ]" */
747 
748 /*
749  * conv_expn_field() requires a large number of inputs, many of which
750  * can be NULL to accept default behavior. An argument of the following
751  * type is used to supply them.
752  */
753 typedef struct {
754 	char *buf;		/* Buffer to receive generated string */
755 	size_t bufsize;		/* sizeof(buf) */
756 	const Val_desc *vdp;	/* Array of value descriptors, giving the */
757 				/*	possible bit values, and their */
758 				/*	corresponding strings. Note that the */
759 				/*	final element must contain only NULL */
760 				/*	values. This terminates the list. */
761 	const char **lead_str;	/* NULL, or array of pointers to strings to */
762 				/*	be output at the head of the list. */
763 				/*	Last entry must be NULL. */
764 	Xword oflags;		/* Bits for which output strings are desired */
765 	Xword rflags;		/* Bits for which a numeric value should be */
766 				/*	output if vdp does not provide str. */
767 				/*	Must be a proper subset of oflags */
768 	const char *prefix;	/* NULL, or string to prefix output with */
769 				/*	If NULL, "[ " is used. */
770 	const char *sep;	/* NULL, or string to separate output items */
771 				/*	with. If NULL, " " is used. */
772 	const char *suffix;	/* NULL, or string to suffix output with */
773 				/*	If NULL, " ]" is used. */
774 } CONV_EXPN_FIELD_ARG;
775 
776 
777 /*
778  * Callback function for conv_str_to_c_literal(). A user supplied function
779  * of this type is called by conv_str_to_c_literal() in order to dispatch
780  * the translated output characters.
781  *
782  *	buf - Pointer to output text
783  *	n - # of characters to output
784  *	uvalue - User value argument to conv_str_to_c_literal(),
785  *		passed through without interpretation.
786  */
787 typedef	void		Conv_str_to_c_literal_func_t(const void *ptr,
788 			    size_t size, void *uvalue);
789 
790 /*
791  * Define all generic interfaces.
792  */
793 extern	uchar_t		conv_check_native(char **, char **);
794 extern	const char	*conv_config_feat(int, Conv_config_feat_buf_t *);
795 extern	const char	*conv_config_obj(ushort_t, Conv_config_obj_buf_t *);
796 extern	const char	*conv_config_upm(const char *, const char *,
797 			    const char *, size_t);
798 extern	const char	*conv_cnote_auxv_af(Word, Conv_fmt_flags_t,
799 			    Conv_cnote_auxv_af_buf_t *);
800 extern	const char	*conv_cnote_auxv_type(Word, Conv_fmt_flags_t,
801 			    Conv_inv_buf_t *);
802 extern	const char	*conv_cnote_cc_content(Lword, Conv_fmt_flags_t,
803 			    Conv_cnote_cc_content_buf_t *);
804 extern	const char	*conv_cnote_errno(int, Conv_fmt_flags_t,
805 			    Conv_inv_buf_t *);
806 extern	const char	*conv_cnote_fault(Word, Conv_fmt_flags_t,
807 			    Conv_inv_buf_t *);
808 extern	const char	*conv_cnote_fltset(uint32_t *, int,
809 			    Conv_fmt_flags_t, Conv_cnote_fltset_buf_t *);
810 extern	const char	*conv_cnote_old_pr_flags(int, Conv_fmt_flags_t,
811 			    Conv_cnote_old_pr_flags_buf_t *);
812 extern	const char	*conv_cnote_pr_dmodel(Word, Conv_fmt_flags_t,
813 			    Conv_inv_buf_t *);
814 extern	const char	*conv_cnote_pr_flags(int, Conv_fmt_flags_t,
815 			    Conv_cnote_pr_flags_buf_t *);
816 extern	const char	*conv_cnote_proc_flag(int, Conv_fmt_flags_t,
817 			    Conv_cnote_proc_flag_buf_t *);
818 extern	const char	*conv_cnote_pr_regname(Half, int, Conv_fmt_flags_t,
819 			    Conv_inv_buf_t *inv_buf);
820 extern	const char	*conv_cnote_pr_stype(Word, Conv_fmt_flags_t,
821 			    Conv_inv_buf_t *);
822 extern	const char	*conv_cnote_pr_what(short, short, Conv_fmt_flags_t,
823 			    Conv_inv_buf_t *);
824 extern	const char	*conv_cnote_pr_why(short, Conv_fmt_flags_t,
825 			    Conv_inv_buf_t *);
826 extern	const char	*conv_cnote_priv(int, Conv_fmt_flags_t,
827 			    Conv_inv_buf_t *);
828 extern	const char	*conv_cnote_psetid(int, Conv_fmt_flags_t,
829 			    Conv_inv_buf_t *);
830 extern	const char	*conv_cnote_sa_flags(int, Conv_fmt_flags_t,
831 			    Conv_cnote_sa_flags_buf_t *);
832 extern	const char	*conv_cnote_signal(Word, Conv_fmt_flags_t,
833 			    Conv_inv_buf_t *);
834 extern	const char	*conv_cnote_si_code(Half, int, int, Conv_fmt_flags_t,
835 			    Conv_inv_buf_t *);
836 extern	const char	*conv_cnote_sigset(uint32_t *, int,
837 			    Conv_fmt_flags_t, Conv_cnote_sigset_buf_t *);
838 extern	const char	*conv_cnote_ss_flags(int, Conv_fmt_flags_t,
839 			    Conv_cnote_ss_flags_buf_t *);
840 extern	const char	*conv_cnote_syscall(Word, Conv_fmt_flags_t,
841 			    Conv_inv_buf_t *);
842 extern	const char	*conv_cnote_sysset(uint32_t *, int,
843 			    Conv_fmt_flags_t, Conv_cnote_sysset_buf_t *);
844 extern	const char	*conv_cnote_type(Word, Conv_fmt_flags_t,
845 			    Conv_inv_buf_t *);
846 extern	const char	*conv_def_tag(Symref, Conv_inv_buf_t *);
847 extern	const char	*conv_demangle_name(const char *);
848 extern	const char	*conv_dl_flag(int, Conv_fmt_flags_t,
849 			    Conv_dl_flag_buf_t *);
850 extern	const char	*conv_dl_mode(int, int, Conv_dl_mode_buf_t *);
851 extern	const char	*conv_dwarf_ehe(uint_t, Conv_dwarf_ehe_buf_t *);
852 extern	const char	*conv_elfdata_type(Elf_Type, Conv_inv_buf_t *);
853 extern	const char	*conv_grphdl_flags(uint_t, Conv_grphdl_flags_buf_t *);
854 extern	const char	*conv_grpdesc_flags(uint_t, Conv_grpdesc_flags_buf_t *);
855 extern	Isa_desc	*conv_isalist(void);
856 extern	const char	*conv_lddstub(int);
857 extern	const char	*conv_seg_flags(Half, Conv_seg_flags_buf_t *);
858 extern	int		conv_sys_eclass();
859 extern	void		conv_str_to_c_literal(const char *buf, size_t n,
860 			    Conv_str_to_c_literal_func_t *cb_func,
861 			    void *uvalue);
862 extern	Uts_desc	*conv_uts(void);
863 extern	const char	*conv_ver_flags(Half);
864 extern	const char	*conv_ver_index(Versym, int, Conv_inv_buf_t *);
865 
866 
867 /*
868  * Define all class specific routines.
869  */
870 #if	defined(_ELF64)
871 #define	conv_bnd_obj		conv64_bnd_obj
872 #define	conv_bnd_type		conv64_bnd_type
873 #define	conv_cap_tag		conv64_cap_tag
874 #define	conv_cap_val		conv64_cap_val
875 #define	conv_cap_val_hw1	conv64_cap_val_hw1
876 #define	conv_cap_val_sf1	conv64_cap_val_sf1
877 #define	conv_dyn_feature1	conv64_dyn_feature1
878 #define	conv_dyn_flag1		conv64_dyn_flag1
879 #define	conv_dyn_flag		conv64_dyn_flag
880 #define	conv_dyn_posflag1	conv64_dyn_posflag1
881 #define	conv_dyn_tag		conv64_dyn_tag
882 #define	conv_ehdr_class		conv64_ehdr_class
883 #define	conv_ehdr_data		conv64_ehdr_data
884 #define	conv_ehdr_flags		conv64_ehdr_flags
885 #define	conv_ehdr_mach		conv64_ehdr_mach
886 #define	conv_ehdr_osabi		conv64_ehdr_osabi
887 #define	conv_ehdr_type		conv64_ehdr_type
888 #define	conv_ehdr_vers		conv64_ehdr_vers
889 #define	conv_expn_field		conv64_expn_field
890 #define	conv_invalid_val	conv64_invalid_val
891 #define	conv_phdr_flags		conv64_phdr_flags
892 #define	conv_phdr_type		conv64_phdr_type
893 #define	conv_reject_desc	conv64_reject_desc
894 #define	conv_reloc_type		conv64_reloc_type
895 #define	conv_reloc_type_static	conv64_reloc_type_static
896 #define	conv_reloc_386_type	conv64_reloc_386_type
897 #define	conv_reloc_amd64_type	conv64_reloc_amd64_type
898 #define	conv_reloc_SPARC_type	conv64_reloc_SPARC_type
899 #define	conv_sec_flags		conv64_sec_flags
900 #define	conv_sec_linkinfo	conv64_sec_linkinfo
901 #define	conv_sec_type		conv64_sec_type
902 #define	conv_sym_info_bind	conv64_sym_info_bind
903 #define	conv_sym_info_type	conv64_sym_info_type
904 #define	conv_sym_shndx		conv64_sym_shndx
905 #define	conv_sym_other		conv64_sym_other
906 #define	conv_sym_other_vis	conv64_sym_other_vis
907 #define	conv_sym_value		conv64_sym_value
908 #define	conv_sym_SPARC_value	conv64_sym_SPARC_value
909 #define	conv_syminfo_flags	conv64_syminfo_flags
910 #else
911 #define	conv_bnd_obj		conv32_bnd_obj
912 #define	conv_bnd_type		conv32_bnd_type
913 #define	conv_cap_tag		conv32_cap_tag
914 #define	conv_cap_val		conv32_cap_val
915 #define	conv_cap_val_hw1	conv32_cap_val_hw1
916 #define	conv_cap_val_sf1	conv32_cap_val_sf1
917 #define	conv_dyn_feature1	conv32_dyn_feature1
918 #define	conv_dyn_flag1		conv32_dyn_flag1
919 #define	conv_dyn_flag		conv32_dyn_flag
920 #define	conv_dyn_posflag1	conv32_dyn_posflag1
921 #define	conv_dyn_tag		conv32_dyn_tag
922 #define	conv_ehdr_class		conv32_ehdr_class
923 #define	conv_ehdr_data		conv32_ehdr_data
924 #define	conv_ehdr_flags		conv32_ehdr_flags
925 #define	conv_ehdr_mach		conv32_ehdr_mach
926 #define	conv_ehdr_osabi		conv32_ehdr_osabi
927 #define	conv_ehdr_type		conv32_ehdr_type
928 #define	conv_ehdr_vers		conv32_ehdr_vers
929 #define	conv_expn_field		conv32_expn_field
930 #define	conv_invalid_val	conv32_invalid_val
931 #define	conv_phdr_flags		conv32_phdr_flags
932 #define	conv_phdr_type		conv32_phdr_type
933 #define	conv_reject_desc	conv32_reject_desc
934 #define	conv_reloc_type		conv32_reloc_type
935 #define	conv_reloc_type_static	conv32_reloc_type_static
936 #define	conv_reloc_386_type	conv32_reloc_386_type
937 #define	conv_reloc_amd64_type	conv32_reloc_amd64_type
938 #define	conv_reloc_SPARC_type	conv32_reloc_SPARC_type
939 #define	conv_sec_flags		conv32_sec_flags
940 #define	conv_sec_linkinfo	conv32_sec_linkinfo
941 #define	conv_sec_type		conv32_sec_type
942 #define	conv_sym_info_bind	conv32_sym_info_bind
943 #define	conv_sym_info_type	conv32_sym_info_type
944 #define	conv_sym_shndx		conv32_sym_shndx
945 #define	conv_sym_other		conv32_sym_other
946 #define	conv_sym_other_vis	conv32_sym_other_vis
947 #define	conv_sym_value		conv32_sym_value
948 #define	conv_sym_SPARC_value	conv32_sym_SPARC_value
949 #define	conv_syminfo_flags	conv32_syminfo_flags
950 #endif
951 
952 extern	const char	*conv_bnd_obj(uint_t, Conv_bnd_obj_buf_t *);
953 extern	const char	*conv_bnd_type(uint_t, Conv_bnd_type_buf_t *);
954 extern	const char	*conv_cap_tag(Xword, Conv_inv_buf_t *);
955 extern	const char	*conv_cap_val(Xword, Xword, Half, Conv_cap_val_buf_t *);
956 extern	const char	*conv_cap_val_hw1(Xword, Half, Conv_fmt_flags_t,
957 			    Conv_cap_val_hw1_buf_t *);
958 extern	const char	*conv_cap_val_sf1(Xword, Half, Conv_fmt_flags_t,
959 			    Conv_cap_val_sf1_buf_t *);
960 extern	const char	*conv_dyn_flag1(Xword, Conv_fmt_flags_t,
961 			    Conv_dyn_flag1_buf_t *);
962 extern	const char	*conv_dyn_flag(Xword, Conv_fmt_flags_t,
963 			    Conv_dyn_flag_buf_t *);
964 extern	const char	*conv_dyn_posflag1(Xword, Conv_fmt_flags_t,
965 			    Conv_dyn_posflag1_buf_t *);
966 extern	const char	*conv_dyn_tag(Xword, Half, Conv_fmt_flags_t,
967 			    Conv_inv_buf_t *);
968 extern	const char	*conv_dyn_feature1(Xword, Conv_fmt_flags_t,
969 			    Conv_dyn_feature1_buf_t *);
970 extern	const char	*conv_ehdr_class(uchar_t, Conv_fmt_flags_t,
971 			    Conv_inv_buf_t *);
972 extern	const char	*conv_ehdr_data(uchar_t, Conv_fmt_flags_t,
973 			    Conv_inv_buf_t *);
974 extern	const char	*conv_ehdr_flags(Half, Word, Conv_fmt_flags_t,
975 			    Conv_ehdr_flags_buf_t *);
976 extern	const char	*conv_ehdr_mach(Half, Conv_fmt_flags_t,
977 			    Conv_inv_buf_t *);
978 extern	const char	*conv_ehdr_osabi(uchar_t, Conv_fmt_flags_t,
979 			    Conv_inv_buf_t *);
980 extern	const char	*conv_ehdr_type(Half, Conv_fmt_flags_t,
981 			    Conv_inv_buf_t *);
982 extern	const char	*conv_ehdr_vers(Word, Conv_fmt_flags_t,
983 			    Conv_inv_buf_t *);
984 extern	int		conv_expn_field(CONV_EXPN_FIELD_ARG *,
985 			    Conv_fmt_flags_t);
986 extern	const char	*conv_invalid_val(Conv_inv_buf_t *, Xword,
987 			    Conv_fmt_flags_t);
988 extern	const char	*conv_phdr_flags(Word, Conv_fmt_flags_t fmt_flags,
989 			    Conv_phdr_flags_buf_t *);
990 extern	const char	*conv_phdr_type(Half, Word, Conv_fmt_flags_t,
991 			    Conv_inv_buf_t *);
992 extern	const char	*conv_reject_desc(Rej_desc *, Conv_reject_desc_buf_t *,
993 			    Half mach);
994 extern	const char	*conv_reloc_type(Half, Word, Conv_fmt_flags_t,
995 			    Conv_inv_buf_t *);
996 extern	const char	*conv_reloc_type_static(Half, Word, Conv_fmt_flags_t);
997 extern	const char	*conv_reloc_386_type(Word, Conv_fmt_flags_t,
998 			    Conv_inv_buf_t *);
999 extern	const char	*conv_reloc_amd64_type(Word, Conv_fmt_flags_t,
1000 			    Conv_inv_buf_t *);
1001 extern	const char	*conv_reloc_SPARC_type(Word, Conv_fmt_flags_t,
1002 			    Conv_inv_buf_t *);
1003 extern	const char	*conv_sec_flags(Xword, Conv_fmt_flags_t,
1004 			    Conv_sec_flags_buf_t *);
1005 extern	const char	*conv_sec_linkinfo(Word, Xword, Conv_inv_buf_t *);
1006 extern	const char	*conv_sec_type(Half, Word, Conv_fmt_flags_t,
1007 			    Conv_inv_buf_t *);
1008 extern	const char	*conv_sym_info_bind(uchar_t, Conv_fmt_flags_t,
1009 			    Conv_inv_buf_t *);
1010 extern	const char	*conv_sym_info_type(Half, uchar_t, Conv_fmt_flags_t,
1011 			    Conv_inv_buf_t *);
1012 extern	const char	*conv_sym_shndx(Half, Conv_inv_buf_t *);
1013 extern	const char	*conv_sym_other(uchar_t, Conv_inv_buf_t *);
1014 extern	const char	*conv_sym_other_vis(uchar_t, Conv_fmt_flags_t,
1015 			    Conv_inv_buf_t *);
1016 extern	const char	*conv_sym_value(Half, uchar_t, Addr, Conv_inv_buf_t *);
1017 extern	const char	*conv_sym_SPARC_value(Addr, Conv_fmt_flags_t,
1018 			    Conv_inv_buf_t *);
1019 extern	const char	*conv_syminfo_flags(Xword, Conv_fmt_flags_t,
1020 			    Conv_syminfo_flags_buf_t *);
1021 
1022 #ifdef	__cplusplus
1023 }
1024 #endif
1025 
1026 #endif /* _CONV_H */
1027