File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -334,11 +334,6 @@ warning: changing the shared text flag is dangerous"));
334334 error (EXIT_SUCCESS , 0 , _ ("\
335335(it normally requires recompilation)." ));
336336 }
337- if (!BE_SILENT && plus_bestfit )
338- {
339- error (EXIT_SUCCESS , 0 , _ ("\
340- warning: changing the bestfit flag is dangerous" ));
341- }
342337
343338 /* Calculate flags. */
344339 if (has_flags )
@@ -406,13 +401,21 @@ warning: changing the bestfit flag is dangerous"));
406401 for (i = fileind ; i < lastind ; i ++ )
407402 {
408403 const char * filename = files [i ];
409- struct mintbin_target * target = open_target (filename ,
410- (do_print ?
411- O_RDONLY : O_RDWR ) | O_BINARY );
404+ struct mintbin_target * target ;
412405 unsigned long new_flags ;
413406 char cflags [4 ];
414407 int had_error = 0 ;
415408
409+ if (!BE_SILENT && plus_bestfit )
410+ {
411+ char * p = strrchr (filename , '.' );
412+ if (p == NULL || strcasecmp (p , ".slb" ) != 0 )
413+ error (EXIT_SUCCESS , 0 , _ ("\
414+ %s: warning: changing the bestfit flag is dangerous" ), filename );
415+ }
416+
417+ target = open_target (filename , (do_print ? O_RDONLY : O_RDWR ) | O_BINARY );
418+
416419 if (target == NULL )
417420 {
418421 status = EXIT_FAILURE ;
You can’t perform that action at this time.
0 commit comments