(print_symbol): Remove check for undefined_only.

(main): Print a warning message if --size-sort and --undefined-only are used
together.
This commit is contained in:
Nick Clifton 2003-03-04 16:23:46 +00:00
parent 2683747f86
commit e3b83c8f4d
2 changed files with 29 additions and 21 deletions

View file

@ -1,3 +1,12 @@
2003-03-04 Nick Clifton <nickc@redhat.com>
* nm.c (main): Print a warning message if --size-sort and
--undefined-only are used together.
2003-03-04 Elias Athanasopoulos <elathan@phys.uoa.gr>
* nm.c (print_symbol): Remove check for undefined_only.
2003-03-03 Nick Clifton <nickc@redhat.com> 2003-03-03 Nick Clifton <nickc@redhat.com>
* po/da.po: Installed latest translation. * po/da.po: Installed latest translation.

View file

@ -509,6 +509,13 @@ main (argc, argv)
if (show_version) if (show_version)
print_version ("nm"); print_version ("nm");
if (sort_by_size && undefined_only)
{
non_fatal (_("Using the --size-sort and --undefined-only options together"));
non_fatal (_("will produce no output, since undefined symbols have no size."));
return 0;
}
/* OK, all options now parsed. If no filename specified, do a.out. */ /* OK, all options now parsed. If no filename specified, do a.out. */
if (optind == argc) if (optind == argc)
return !display_file ("a.out"); return !display_file ("a.out");
@ -1214,20 +1221,13 @@ print_symbol (abfd, sym, ssize, archive_bfd)
bfd_vma ssize; bfd_vma ssize;
bfd *archive_bfd; bfd *archive_bfd;
{ {
symbol_info syminfo;
struct extended_symbol_info info;
PROGRESS (1); PROGRESS (1);
(*format->print_symbol_filename) (archive_bfd, abfd); (*format->print_symbol_filename) (archive_bfd, abfd);
if (undefined_only)
{
if (bfd_is_und_section (bfd_get_section (sym)))
print_symname ("%s", bfd_asymbol_name (sym), abfd);
}
else
{
symbol_info syminfo;
struct extended_symbol_info info;
bfd_get_symbol_info (abfd, sym, &syminfo); bfd_get_symbol_info (abfd, sym, &syminfo);
info.sinfo = &syminfo; info.sinfo = &syminfo;
info.ssize = ssize; info.ssize = ssize;
@ -1236,7 +1236,6 @@ print_symbol (abfd, sym, ssize, archive_bfd)
else else
info.elfinfo = NULL; info.elfinfo = NULL;
(*format->print_symbol_info) (&info, abfd); (*format->print_symbol_info) (&info, abfd);
}
if (line_numbers) if (line_numbers)
{ {
@ -1585,9 +1584,9 @@ print_symbol_info_sysv (info, abfd)
if (SYM_TYPE (info) == '-') if (SYM_TYPE (info) == '-')
{ {
/* A stab. */ /* A stab. */
printf ("%18s| ", SYM_STAB_NAME (info)); /* (C) Type */ printf ("%18s| ", SYM_STAB_NAME (info)); /* (C) Type. */
printf (desc_format, SYM_STAB_DESC (info)); /* Size */ printf (desc_format, SYM_STAB_DESC (info)); /* Size. */
printf ("| |"); /* Line, Section */ printf ("| |"); /* Line, Section. */
} }
else else
{ {