xref: /titanic_41/usr/src/cmd/sgs/elfedit/common/lintsup.c (revision 1bdd6c0e3710e91cb1f31aa78de33cb638494480)
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 2009 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 /* LINTLIBRARY */
27 /* PROTOLIB1 */
28 
29 /*
30  * Supplemental Pseudo-code to get lint to consider these symbols used.
31  */
32 #include	<msg.h>
33 #include	<debug.h>
34 #include	<elfedit.h>
35 
36 /*
37  * Lint doesn't understand that both elfedit{32|64}_init_obj_state()
38  * gets built, because it doesn't know that elfedit_machelf.c gets
39  * compiled twice. The difference between this case and the others
40  * is that we don't use macros to give them both the same name,
41  * because elfedit.c needs to know about both explictly. So,
42  * supply the "missing" one here, for lint's benefit.
43  *
44  * This dummy routine eliminates the "name used but not defined"
45  * errors that otherwise result.
46  */
47 #ifdef _ELF64
48 /*ARGSUSED*/
49 void
50 elfedit32_init_obj_state(const char *file, int fd, Elf *elf)
51 {
52 }
53 #else
54 /*ARGSUSED*/
55 void
56 elfedit64_init_obj_state(const char *file, int fd, Elf *elf)
57 {
58 }
59 #endif
60 
61 
62 void
63 foo()
64 {
65 	dbg_print(NULL, NULL, 0);
66 
67 	elfedit_array_elts_delete(NULL, NULL, 0, 0, 0, 0);
68 	elfedit_array_elts_move(NULL, NULL, 0, 0, 0, 0, 0, NULL);
69 
70 	(void) _elfedit_msg((Msg)&__elfedit_msg[0]);
71 
72 	(void) elfedit_atoi(NULL, NULL);
73 	(void) elfedit_atoui(NULL, NULL);
74 	(void) elfedit_atoconst(NULL, 0);
75 
76 	(void) elfedit_atoi2(NULL, NULL, NULL);
77 	(void) elfedit_atoui2(NULL, NULL, NULL);
78 	(void) elfedit_atoconst2(NULL, 0, NULL);
79 
80 	(void) elfedit_atoi_range(NULL, NULL, 0, 0, NULL);
81 	(void) elfedit_atoui_range(NULL, NULL, 0, 0, NULL);
82 	(void) elfedit_atoconst_range(NULL, NULL, 0, 0, 0);
83 
84 	(void) elfedit_atoi_range2(NULL, 0, 0, NULL, NULL);
85 	(void) elfedit_atoui_range2(NULL, 0, 0, NULL, NULL);
86 	(void) elfedit_atoconst_range2(NULL, 0, 0, 0, NULL);
87 
88 	(void) elfedit_atoi_value_to_str(NULL, 0, 0);
89 	(void) elfedit_atoui_value_to_str(NULL, 0, 0);
90 	(void) elfedit_atoconst_value_to_str(0, 0, 0);
91 
92 	(void) elfedit_atoshndx(NULL, 0);
93 
94 	(void) elfedit_cpl_atoi(NULL, NULL);
95 	(void) elfedit_cpl_atoui(NULL, NULL);
96 	(void) elfedit_cpl_atoconst(NULL, 0);
97 	(void) elfedit_cpl_ndx(NULL, 0);
98 
99 	(void) elfedit_dyn_offset_to_str(NULL, NULL);
100 	(void) elfedit_dynstr_insert(NULL, NULL, NULL, NULL);
101 	(void) elfedit_flags();
102 	(void) elfedit_modified_ehdr(NULL);
103 	(void) elfedit_modified_phdr(NULL);
104 	(void) elfedit_modified_shdr(NULL);
105 	(void) elfedit_name_to_shndx(NULL, NULL);
106 	(void) elfedit_name_to_symndx(NULL, NULL, NULL, ELFEDIT_MSG_ERR, NULL);
107 	(void) elfedit_outstyle();
108 	(void) elfedit_sec_get(NULL, NULL);
109 	(void) elfedit_sec_getcap(NULL, NULL, NULL);
110 	(void) elfedit_sec_getdyn(NULL, NULL, NULL);
111 	(void) elfedit_sec_getstr(NULL, 0, 0);
112 	(void) elfedit_sec_getsyminfo(NULL, NULL, NULL);
113 	(void) elfedit_sec_getsymtab(NULL, 0, 0, NULL, NULL, NULL, NULL);
114 	(void) elfedit_sec_getversym(NULL, NULL, NULL, NULL);
115 	(void) elfedit_sec_getxshndx(NULL, NULL, NULL, NULL);
116 	(void) elfedit_sec_msgprefix(NULL);
117 	(void) elfedit_shndx_to_name(NULL, NULL);
118 	elfedit_str_to_c_literal(NULL, NULL);
119 	(void) elfedit_strtab_insert(NULL, NULL, NULL, NULL);
120 	(void) elfedit_strtab_insert_test(NULL, NULL, NULL, NULL);
121 	(void) elfedit_type_to_shndx(NULL, 0);
122 }
123