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.
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.
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]
23 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
33 Dbg_ver_avail_title(Lm_list
*lml
, const char *file
)
35 if (DBG_NOTCLASS(DBG_C_VERSIONS
))
38 Dbg_util_nl(lml
, DBG_NL_STD
);
39 dbg_print(lml
, MSG_INTL(MSG_VER_AVAIL_1
), file
);
40 dbg_print(lml
, MSG_INTL(MSG_VER_AVAIL_2
));
44 Dbg_ver_def_title(Lm_list
*lml
, const char *file
)
46 if (DBG_NOTCLASS(DBG_C_VERSIONS
))
49 Dbg_util_nl(lml
, DBG_NL_STD
);
50 dbg_print(lml
, MSG_INTL(MSG_VER_DEF_TITLE
), file
);
51 Elf_ver_def_title(lml
);
55 Dbg_ver_need_title(Lm_list
*lml
, const char *file
)
57 if (DBG_NOTCLASS(DBG_C_VERSIONS
))
60 Dbg_util_nl(lml
, DBG_NL_STD
);
61 dbg_print(lml
, MSG_INTL(MSG_VER_NEED_TITLE
), file
);
62 Elf_ver_need_title(lml
, 0);
66 Dbg_ver_need_entry(Lm_list
*lml
, Half cnt
, const char *file
,
69 if (DBG_NOTCLASS(DBG_C_VERSIONS
))
73 Elf_ver_line_4(lml
, version
);
75 Elf_ver_line_5(lml
, file
, version
);
79 Dbg_ver_symbol(Lm_list
*lml
, const char *name
)
81 static Boolean ver_symbol_title
= TRUE
;
83 if (DBG_NOTCLASS(DBG_C_VERSIONS
| DBG_C_SYMBOLS
))
86 if (DBG_NOTCLASS(DBG_C_VERSIONS
))
87 if (ver_symbol_title
) {
88 ver_symbol_title
= FALSE
;
89 Dbg_util_nl(lml
, DBG_NL_STD
);
90 dbg_print(lml
, MSG_INTL(MSG_SYM_VERSION
));
93 Dbg_syms_created(lml
, name
);
97 * This function doesn't test for any specific debugging category, thus it will
98 * be generated for any debugging family.
101 Dbg_ver_nointerface(Lm_list
*lml
, const char *name
)
103 Dbg_util_nl(lml
, DBG_NL_STD
);
104 dbg_print(lml
, MSG_INTL(MSG_VER_NOINTERFACE
), name
);
105 Dbg_util_nl(lml
, DBG_NL_STD
);
109 Dbg_ver_desc_entry(Lm_list
*lml
, Ver_desc
*vdp
)
111 Conv_ver_flags_buf_t ver_flags_buf
;
113 Ver_desc
*_vdp
, *__vdp
;
117 if (DBG_NOTCLASS(DBG_C_VERSIONS
))
121 _vdp
= (Ver_desc
*)vdp
->vd_deps
->apl_data
[0];
125 dep
= MSG_ORIG(MSG_STR_EMPTY
);
127 (void) sprintf(index
, MSG_ORIG(MSG_FMT_INDEX
), vdp
->vd_ndx
);
128 Elf_ver_line_1(lml
, index
, vdp
->vd_name
, dep
,
129 conv_ver_flags(vdp
->vd_flags
, 0, &ver_flags_buf
));
132 * Loop through the dependency list in case there are more that one
135 for (APLIST_TRAVERSE(vdp
->vd_deps
, idx
, __vdp
)) {
138 Elf_ver_line_4(lml
, __vdp
->vd_name
);
143 Dbg_ver_avail_entry(Lm_list
*lml
, Ver_index
*vip
, const char *select
)
145 if (DBG_NOTCLASS(DBG_C_VERSIONS
))
150 dbg_print(lml
, MSG_ORIG(MSG_VER_SELECTED
),
151 vip
->vi_name
, select
);
153 dbg_print(lml
, MSG_ORIG(MSG_VER_L_SELECTED
),
154 vip
->vi_name
, select
);
157 dbg_print(lml
, MSG_ORIG(MSG_VER_ALL
), vip
->vi_name
);
159 dbg_print(lml
, MSG_ORIG(MSG_VER_L_ALL
), vip
->vi_name
);
164 Elf_ver_def_title(Lm_list
*lml
)
166 dbg_print(lml
, MSG_INTL(MSG_VER_DEF
));
171 * gnuver - If True (non-zero), the version rules used by the
172 * GNU ld are assumed. If False (0), Solaris ld rules apply.
175 Elf_ver_need_title(Lm_list
*lml
, int gnuver
)
178 dbg_print(lml
, MSG_INTL(MSG_VER_NEED_GNUVER
));
180 dbg_print(lml
, MSG_INTL(MSG_VER_NEED
));
184 Elf_ver_line_1(Lm_list
*lml
, const char *index
, const char *name
,
185 const char *dep
, const char *flags
)
188 dbg_print(lml
, MSG_INTL(MSG_VER_LINE_1
), index
, name
,
191 dbg_print(lml
, MSG_INTL(MSG_VER_LLINE_1
), index
, name
,
196 Elf_ver_line_2(Lm_list
*lml
, const char *name
, const char *dep
)
198 dbg_print(lml
, MSG_INTL(MSG_VER_LINE_2
), name
, dep
);
202 Elf_ver_line_3(Lm_list
*lml
, const char *name
, const char *dep
,
205 dbg_print(lml
, MSG_INTL(MSG_VER_LINE_3
), name
, dep
, flags
);
209 Elf_ver_line_4(Lm_list
*lml
, const char *version
)
211 dbg_print(lml
, MSG_INTL(MSG_VER_LINE_4
), version
);
215 Elf_ver_line_5(Lm_list
*lml
, const char *file
, const char *version
)
218 dbg_print(lml
, MSG_INTL(MSG_VER_LINE_5
), file
, version
);
220 dbg_print(lml
, MSG_INTL(MSG_VER_LLINE_5
), file
, version
);
224 * Called after final call to Dbg_ver_need() to inject final newline.
227 Dbg_ver_need_done(Lm_list
*lml
)
229 if (DBG_NOTCLASS(DBG_C_VERSIONS
))
232 Dbg_util_nl(lml
, DBG_NL_STD
);