xref: /titanic_50/usr/src/cmd/sgs/libconv/common/llib-lconv (revision 024b0a258461f282a92b1b1283c3b8b083f9f33f)
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 2008 Sun Microsystems, Inc.  All rights reserved.
24 * Use is subject to license terms.
25 */
26/* LINTLIBRARY */
27/* PROTOLIB1 */
28
29#pragma ident	"%Z%%M%	%I%	%E% SMI"
30
31#include	<stdlib.h>
32#include	<libelf.h>
33#include	<_machelf.h>
34#include	<sgs.h>
35#include	<libld.h>
36#include	<conv.h>
37
38/*
39 * Define all generic interfaces.
40 */
41uchar_t		conv_check_native(char **, char **);
42const char      *conv_config_feat(int, Conv_config_feat_buf_t *);
43const char	*conv_config_obj(ushort_t, Conv_config_obj_buf_t *);
44const char	*conv_config_upm(const char *, const char *, const char *,
45		    size_t);
46const char	*conv_def_tag(Symref, Conv_inv_buf_t *);
47const char	*conv_demangle_name(const char *);
48const char	*conv_dl_flag(int, int, Conv_dl_flag_buf_t *);
49const char	*conv_dl_mode(int, int, Conv_dl_mode_buf_t *);
50const char	*conv_dwarf_ehe(uint_t, Conv_dwarf_ehe_buf_t *);
51const char	*conv_elfdata_type(Elf_Type, Conv_inv_buf_t *);
52int		conv_expn_field(CONV_EXPN_FIELD_ARG *, Conv_fmt_flags_t);
53const char	*conv_grphdl_flags(uint_t, Conv_grphdl_flags_buf_t *);
54const char	*conv_grpdesc_flags(uint_t, Conv_grpdesc_flags_buf_t *);
55Isa_desc	*conv_isalist(void);
56const char	*conv_lddstub(int);
57const char	*conv_seg_flags(Half, Conv_seg_flags_buf_t *);
58int		conv_sys_eclass(void);
59Uts_desc	*conv_uts(void);
60const char	*conv_ver_flags(Half);
61const char	*conv_ver_index(Versym, int, Conv_inv_buf_t *);
62
63
64/*
65 * Define all class specific routines.
66 */
67const char	*conv32_bnd_obj(uint_t, Conv32_bnd_obj_buf_t *);
68const char	*conv64_bnd_obj(uint_t, Conv64_bnd_obj_buf_t *);
69const char	*conv32_bnd_type(uint_t, Conv32_bnd_type_buf_t *);
70const char	*conv64_bnd_type(uint_t, Conv64_bnd_type_buf_t *);
71const char	*conv32_cap_tag(Elf32_Word, Conv32_inv_buf_t *);
72const char	*conv64_cap_tag(Elf64_Xword, Conv64_inv_buf_t *);
73const char	*conv32_cap_val(Elf32_Word, Elf32_Word, Half,
74		    Conv32_cap_val_buf_t *);
75const char	*conv64_cap_val(Elf64_Xword, Elf64_Xword, Half,
76		    Conv64_cap_val_buf_t *);
77const char	*conv32_cap_val_hw1(Elf32_Word, Half, Conv_fmt_flags_t,
78		    Conv32_cap_val_hw1_buf_t *);
79const char	*conv64_cap_val_hw1(Elf64_Xword, Half, Conv_fmt_flags_t,
80		    Conv64_cap_val_hw1_buf_t *);
81const char	*conv32_cap_val_sf1(Elf32_Word, Half, Conv_fmt_flags_t,
82		    Conv32_cap_val_sf1_buf_t *);
83const char	*conv64_cap_val_sf1(Elf64_Xword, Half, Conv_fmt_flags_t,
84		    Conv64_cap_val_sf1_buf_t *);
85const char	*conv32_dyn_flag1(Elf32_Word, Conv_fmt_flags_t,
86		    Conv32_dyn_flag1_buf_t *);
87const char	*conv64_dyn_flag1(Elf64_Xword, Conv_fmt_flags_t,
88		    Conv64_dyn_flag1_buf_t *);
89const char	*conv32_dyn_flag(Elf32_Word, int, Conv32_dyn_flag_buf_t *);
90const char	*conv64_dyn_flag(Elf64_Xword, int, Conv64_dyn_flag_buf_t *);
91const char	*conv32_dyn_posflag1(Elf32_Word, int,
92		    Conv32_dyn_posflag1_buf_t *);
93const char	*conv64_dyn_posflag1(Elf64_Xword, int,
94		    Conv64_dyn_posflag1_buf_t *);
95const char	*conv32_dyn_tag(Elf32_Word, Elf32_Half, int,
96		    Conv32_inv_buf_t *);
97const char	*conv64_dyn_tag(Elf64_Xword, Elf64_Half, int,
98		    Conv64_inv_buf_t *);
99const char	*conv32_dyn_feature1(Elf32_Word, int,
100		    Conv32_dyn_feature1_buf_t *);
101const char	*conv64_dyn_feature1(Elf64_Xword, int,
102		    Conv64_dyn_feature1_buf_t *);
103const char	*conv32_ehdr_class(uchar_t, int, Conv32_inv_buf_t *);
104const char	*conv64_ehdr_class(uchar_t, int, Conv64_inv_buf_t *);
105const char	*conv32_ehdr_data(uchar_t, int, Conv32_inv_buf_t *);
106const char	*conv64_ehdr_data(uchar_t, int, Conv64_inv_buf_t *);
107const char	*conv32_ehdr_flags(Elf32_Half, Elf32_Word, Conv_fmt_flags_t,
108		    Conv32_ehdr_flags_buf_t *);
109const char	*conv64_ehdr_flags(Elf64_Half, Elf64_Word, Conv_fmt_flags_t,
110		    Conv64_ehdr_flags_buf_t *);
111const char	*conv32_ehdr_mach(Elf32_Half, int, Conv32_inv_buf_t *);
112const char	*conv64_ehdr_mach(Elf64_Half, int, Conv64_inv_buf_t *);
113const char	*conv32_ehdr_type(Elf32_Half, int, Conv32_inv_buf_t *);
114const char	*conv64_ehdr_type(Elf64_Half, int, Conv64_inv_buf_t *);
115const char	*conv32_ehdr_vers(Elf32_Word, int, Conv32_inv_buf_t *);
116const char	*conv64_ehdr_vers(Elf64_Word, int, Conv64_inv_buf_t *);
117const char	*conv32_invalid_val(Conv32_inv_buf_t *, Elf32_Word, int);
118const char	*conv64_invalid_val(Conv64_inv_buf_t *, Elf64_Xword, int);
119const char	*conv32_phdr_flags(Word,  Conv_fmt_flags_t,
120		    Conv32_phdr_flags_buf_t *);
121const char	*conv64_phdr_flags(Word,  Conv_fmt_flags_t,
122		    Conv64_phdr_flags_buf_t *);
123const char	*conv32_phdr_type(Elf32_Half, Word, int, Conv32_inv_buf_t *);
124const char	*conv64_phdr_type(Elf64_Half, Word, int, Conv64_inv_buf_t *);
125const char	*conv32_reject_desc(Rej_desc *, Conv32_reject_desc_buf_t *,
126		    Elf32_Half);
127const char	*conv64_reject_desc(Rej_desc *, Conv64_reject_desc_buf_t *,
128		    Elf64_Half);
129const char	*conv32_reloc_type(Half, Word, int, Conv32_inv_buf_t *);
130const char	*conv64_reloc_type(Half, Word, int, Conv64_inv_buf_t *);
131const char	*conv32_reloc_type_static(Half, Word, int);
132const char	*conv64_reloc_type_static(Half, Word, int);
133const char	*conv32_reloc_386_type(Word, int, Conv32_inv_buf_t *);
134const char	*conv64_reloc_386_type(Word, int, Conv64_inv_buf_t *);
135const char	*conv32_reloc_amd64_type(Word, int, Conv32_inv_buf_t *);
136const char	*conv64_reloc_amd64_type(Word, int, Conv64_inv_buf_t *);
137const char	*conv32_reloc_SPARC_type(Word, int, Conv32_inv_buf_t *);
138const char	*conv64_reloc_SPARC_type(Word, int, Conv64_inv_buf_t *);
139const char	*conv32_sec_flags(Elf32_Word, Conv_fmt_flags_t,
140		    Conv32_sec_flags_buf_t *);
141const char	*conv64_sec_flags(Elf64_Xword, Conv_fmt_flags_t,
142		    Conv64_sec_flags_buf_t *);
143const char	*conv32_sec_linkinfo(Elf32_Word, Elf32_Word,
144		    Conv32_inv_buf_t *);
145const char	*conv64_sec_linkinfo(Elf64_Word, Elf64_Xword,
146		    Conv64_inv_buf_t *);
147const char	*conv32_sec_type(Elf32_Half, Elf32_Word, int,
148		    Conv32_inv_buf_t *);
149const char	*conv64_sec_type(Elf64_Half, Elf64_Word, int,
150		    Conv64_inv_buf_t *);
151const char	*conv32_sym_info_bind(uchar_t, int, Conv32_inv_buf_t *);
152const char	*conv64_sym_info_bind(uchar_t, int, Conv64_inv_buf_t *);
153const char	*conv32_sym_info_type(Elf32_Half, uchar_t, int,
154		    Conv32_inv_buf_t *);
155const char	*conv64_sym_info_type(Elf64_Half, uchar_t, int,
156		    Conv64_inv_buf_t *);
157const char	*conv32_sym_shndx(Elf32_Half, Conv32_inv_buf_t *);
158const char	*conv64_sym_shndx(Elf64_Half, Conv64_inv_buf_t *);
159const char	*conv32_sym_other(uchar_t, Conv32_inv_buf_t *);
160const char	*conv64_sym_other(uchar_t, Conv64_inv_buf_t *);
161const char	*conv32_sym_value(Elf32_Half, uchar_t, Elf32_Addr,
162		    Conv32_inv_buf_t *);
163const char	*conv64_sym_value(Elf64_Half, uchar_t, Elf64_Addr,
164		    Conv64_inv_buf_t *);
165const char	*conv32_sym_SPARC_value(Elf32_Addr, int, Conv32_inv_buf_t *);
166const char	*conv64_sym_SPARC_value(Elf64_Addr, int, Conv64_inv_buf_t *);
167