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