More changes to print ambiguous matches and use the
abstracting macros.
This commit is contained in:
parent
139c8857be
commit
6f9dff07e1
|
@ -2,7 +2,7 @@ Wed Feb 2 13:42:23 1994 David J. Mackenzie (djm@thepub.cygnus.com)
|
||||||
|
|
||||||
* nlmconv.c (main): Use bfd_get_flavour instead of struct member.
|
* nlmconv.c (main): Use bfd_get_flavour instead of struct member.
|
||||||
* ar.c (print_contents, extract_file), size.c
|
* ar.c (print_contents, extract_file), size.c
|
||||||
(print_berkeley_format): Use bfd_get_filename and
|
(print_berkeley_format, print_sysv_format): Use bfd_get_filename and
|
||||||
bfd_my_archive instead of dereferencing the structs directly.
|
bfd_my_archive instead of dereferencing the structs directly.
|
||||||
|
|
||||||
* ar.c: Use bfd_fatal and bfd_nonfatal instead of bfd_perror and exit.
|
* ar.c: Use bfd_fatal and bfd_nonfatal instead of bfd_perror and exit.
|
||||||
|
@ -10,7 +10,8 @@ Wed Feb 2 13:42:23 1994 David J. Mackenzie (djm@thepub.cygnus.com)
|
||||||
|
|
||||||
* nlmconv.c (main), objcopy.c (copy_file): Print matching formats
|
* nlmconv.c (main), objcopy.c (copy_file): Print matching formats
|
||||||
if ambiguous match.
|
if ambiguous match.
|
||||||
* nm.c (display_file), size.c (display_bfd): Eliminate gotos.
|
* nm.c (display_file, display_archive), size.c (display_bfd):
|
||||||
|
Eliminate gotos.
|
||||||
Print matching formats if there is an ambiguous match. Use
|
Print matching formats if there is an ambiguous match. Use
|
||||||
bfd_nonfatal instead of hardcoded error message if nothing matches.
|
bfd_nonfatal instead of hardcoded error message if nothing matches.
|
||||||
|
|
||||||
|
|
|
@ -368,6 +368,7 @@ display_archive (file)
|
||||||
bfd *file;
|
bfd *file;
|
||||||
{
|
{
|
||||||
bfd *arfile = NULL;
|
bfd *arfile = NULL;
|
||||||
|
char **matching;
|
||||||
|
|
||||||
(*format->print_archive_filename) (bfd_get_filename (file));
|
(*format->print_archive_filename) (bfd_get_filename (file));
|
||||||
|
|
||||||
|
@ -385,14 +386,21 @@ display_archive (file)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bfd_check_format (arfile, bfd_object))
|
if (bfd_check_format_matches (arfile, bfd_object, &matching))
|
||||||
{
|
{
|
||||||
(*format->print_archive_member) (bfd_get_filename (file),
|
(*format->print_archive_member) (bfd_get_filename (file),
|
||||||
bfd_get_filename (arfile));
|
bfd_get_filename (arfile));
|
||||||
display_rel_file (arfile, file);
|
display_rel_file (arfile, file);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
printf ("%s: not an object file\n", arfile->filename);
|
{
|
||||||
|
bfd_nonfatal (bfd_get_filename (arfile));
|
||||||
|
if (bfd_error == file_ambiguously_recognized)
|
||||||
|
{
|
||||||
|
list_matching_formats (matching);
|
||||||
|
free (matching);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -404,8 +404,8 @@ print_sysv_format (file)
|
||||||
svi_total = 0;
|
svi_total = 0;
|
||||||
|
|
||||||
printf ("%s ", bfd_get_filename (file));
|
printf ("%s ", bfd_get_filename (file));
|
||||||
if (file->my_archive)
|
if (bfd_my_archive (file))
|
||||||
printf (" (ex %s)", file->my_archive->filename);
|
printf (" (ex %s)", bfd_get_filename (bfd_my_archive (file)));
|
||||||
|
|
||||||
puts (":\nsection\t\tsize\t addr");
|
puts (":\nsection\t\tsize\t addr");
|
||||||
bfd_map_over_sections (file, sysv_internal_printer, (PTR) NULL);
|
bfd_map_over_sections (file, sysv_internal_printer, (PTR) NULL);
|
||||||
|
|
Loading…
Reference in New Issue