{
bfd_nonfatal (bfd_get_filename (abfd));
if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
- {
- list_matching_formats (matching);
- free (matching);
- }
+ list_matching_formats (matching);
xexit (1);
}
{
bfd_nonfatal (archive_filename);
if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
- {
- list_matching_formats (matching);
- free (matching);
- }
+ list_matching_formats (matching);
xexit (1);
}
{
bfd_nonfatal (archname);
if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
- {
- list_matching_formats (matching);
- free (matching);
- }
+ list_matching_formats (matching);
xexit (1);
}
/* After a FALSE return from bfd_check_format_matches with
bfd_get_error () == bfd_error_file_ambiguously_recognized, print
- the possible matching targets. */
+ the possible matching targets and free the list of targets. */
void
-list_matching_formats (char **p)
+list_matching_formats (char **matching)
{
fflush (stdout);
fprintf (stderr, _("%s: Matching formats:"), program_name);
+ char **p = matching;
while (*p)
fprintf (stderr, " %s", *p++);
+ free (matching);
fputc ('\n', stderr);
}
bfd_nonfatal (input_file);
if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
- {
- list_matching_formats (matching);
- free (matching);
- }
+ list_matching_formats (matching);
exit (1);
}
{
bfd_nonfatal (bfd_get_filename (arfile));
if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
- {
- list_matching_formats (matching);
- free (matching);
- }
+ list_matching_formats (matching);
}
if (last_arfile != NULL)
{
bfd_nonfatal (filename);
if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
- {
- list_matching_formats (matching);
- free (matching);
- }
+ list_matching_formats (matching);
retval = false;
}
bfd_nonfatal_message (input_filename, NULL, NULL, NULL);
if (obj_error == bfd_error_file_ambiguously_recognized)
- {
- list_matching_formats (obj_matching);
- free (obj_matching);
- }
+ list_matching_formats (obj_matching);
if (core_error == bfd_error_file_ambiguously_recognized)
- {
- list_matching_formats (core_matching);
- free (core_matching);
- }
+ list_matching_formats (core_matching);
status = 1;
}
{
nonfatal (bfd_get_filename (abfd));
list_matching_formats (matching);
- free (matching);
return;
}
nonfatal (bfd_get_filename (abfd));
if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
- {
- list_matching_formats (matching);
- free (matching);
- }
+ list_matching_formats (matching);
}
static void
{
bfd_nonfatal (bfd_get_filename (abfd));
list_matching_formats (matching);
- free (matching);
return_code = 3;
return;
}
bfd_nonfatal (bfd_get_filename (abfd));
if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
- {
- list_matching_formats (matching);
- free (matching);
- }
+ list_matching_formats (matching);
return_code = 3;
}
bfd_nonfatal (input_file);
if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
- {
- list_matching_formats (matching);
- free (matching);
- }
+ list_matching_formats (matching);
exit (1);
}
/* See if the emulation has some special knowledge. */
if (ldemul_unrecognized_file (entry))
- return true;
+ {
+ if (err == bfd_error_file_ambiguously_recognized)
+ free (matching);
+ return true;
+ }
if (err == bfd_error_file_ambiguously_recognized)
{
" matching formats:"), entry->the_bfd);
for (p = matching; *p != NULL; p++)
einfo (" %s", *p);
+ free (matching);
einfo ("%F\n");
}
else if (err != bfd_error_file_not_recognized