@@ -139,22 +139,22 @@ int cmd_parse_options(int argc, const char **argv, const char * const usage[])
139139static bool opts_valid (void )
140140{
141141 if (opts .mnop && !opts .mcount ) {
142- WARN ("--mnop requires --mcount" );
142+ ERROR ("--mnop requires --mcount" );
143143 return false;
144144 }
145145
146146 if (opts .noinstr && !opts .link ) {
147- WARN ("--noinstr requires --link" );
147+ ERROR ("--noinstr requires --link" );
148148 return false;
149149 }
150150
151151 if (opts .ibt && !opts .link ) {
152- WARN ("--ibt requires --link" );
152+ ERROR ("--ibt requires --link" );
153153 return false;
154154 }
155155
156156 if (opts .unret && !opts .link ) {
157- WARN ("--unret requires --link" );
157+ ERROR ("--unret requires --link" );
158158 return false;
159159 }
160160
@@ -171,7 +171,7 @@ static bool opts_valid(void)
171171 opts .static_call ||
172172 opts .uaccess ) {
173173 if (opts .dump_orc ) {
174- WARN ("--dump can't be combined with other actions" );
174+ ERROR ("--dump can't be combined with other actions" );
175175 return false;
176176 }
177177
@@ -181,7 +181,7 @@ static bool opts_valid(void)
181181 if (opts .dump_orc )
182182 return true;
183183
184- WARN ("At least one action required" );
184+ ERROR ("At least one action required" );
185185 return false;
186186}
187187
@@ -194,30 +194,30 @@ static int copy_file(const char *src, const char *dst)
194194
195195 src_fd = open (src , O_RDONLY );
196196 if (src_fd == -1 ) {
197- WARN ("can't open %s for reading: %s" , src , strerror (errno ));
197+ ERROR ("can't open %s for reading: %s" , src , strerror (errno ));
198198 return 1 ;
199199 }
200200
201201 dst_fd = open (dst , O_WRONLY | O_CREAT | O_TRUNC , 0400 );
202202 if (dst_fd == -1 ) {
203- WARN ("can't open %s for writing: %s" , dst , strerror (errno ));
203+ ERROR ("can't open %s for writing: %s" , dst , strerror (errno ));
204204 return 1 ;
205205 }
206206
207207 if (fstat (src_fd , & stat ) == -1 ) {
208- WARN_GLIBC ("fstat" );
208+ ERROR_GLIBC ("fstat" );
209209 return 1 ;
210210 }
211211
212212 if (fchmod (dst_fd , stat .st_mode ) == -1 ) {
213- WARN_GLIBC ("fchmod" );
213+ ERROR_GLIBC ("fchmod" );
214214 return 1 ;
215215 }
216216
217217 for (to_copy = stat .st_size ; to_copy > 0 ; to_copy -= copied ) {
218218 copied = sendfile (dst_fd , src_fd , & offset , to_copy );
219219 if (copied == -1 ) {
220- WARN_GLIBC ("sendfile" );
220+ ERROR_GLIBC ("sendfile" );
221221 return 1 ;
222222 }
223223 }
@@ -231,14 +231,14 @@ static void save_argv(int argc, const char **argv)
231231{
232232 orig_argv = calloc (argc , sizeof (char * ));
233233 if (!orig_argv ) {
234- WARN_GLIBC ("calloc" );
234+ ERROR_GLIBC ("calloc" );
235235 exit (1 );
236236 }
237237
238238 for (int i = 0 ; i < argc ; i ++ ) {
239239 orig_argv [i ] = strdup (argv [i ]);
240240 if (!orig_argv [i ]) {
241- WARN_GLIBC ("strdup(%s)" , argv [i ]);
241+ ERROR_GLIBC ("strdup(%s)" , argv [i ]);
242242 exit (1 );
243243 }
244244 };
@@ -257,7 +257,7 @@ void print_args(void)
257257 */
258258 backup = malloc (strlen (objname ) + strlen (ORIG_SUFFIX ) + 1 );
259259 if (!backup ) {
260- WARN_GLIBC ("malloc" );
260+ ERROR_GLIBC ("malloc" );
261261 goto print ;
262262 }
263263
@@ -319,7 +319,7 @@ int objtool_run(int argc, const char **argv)
319319 return 1 ;
320320
321321 if (!opts .link && has_multiple_files (file -> elf )) {
322- WARN ("Linked object requires --link" );
322+ ERROR ("Linked object requires --link" );
323323 return 1 ;
324324 }
325325
0 commit comments