This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Commit: nm: -D, no symbols and multiple files
- From: Nick Clifton <nickc at redhat dot com>
- To: gingold at adacore dot com, binutils at sourceware dot org
- Date: Thu, 24 Oct 2013 10:44:03 +0100
- Subject: Commit: nm: -D, no symbols and multiple files
- Authentication-results: sourceware.org; auth=none
Hi Guys,
There is a small bug in nm - when it is displaying the dynamic symbols
in multiple files and it encounters a file with no symbols in it
(dynamic or otherwise), it stops rather than carrying on to process
the next file.
The fix is simple - catch the bfd_error_no_symbols error code - so I
am applying the patch below to the mainline.
Tristan - is this OK for the 2.24 branch ?
Cheers
Nick
binutils/ChangeLog
2013-10-24 Nick Clifton <nickc@redhat.com>
* nm.c (display_rel_file): Treat bfd_error_no_symbols as
non-fatal.
Index: binutils/nm.c
===================================================================
RCS file: /cvs/src/src/binutils/nm.c,v
retrieving revision 1.71
diff -u -3 -p -r1.71 nm.c
--- binutils/nm.c 19 Aug 2013 15:08:52 -0000 1.71
+++ binutils/nm.c 24 Oct 2013 09:40:25 -0000
@@ -1010,7 +1010,15 @@ display_rel_file (bfd *abfd, bfd *archiv
symcount = bfd_read_minisymbols (abfd, dynamic, &minisyms, &size);
if (symcount < 0)
- bfd_fatal (bfd_get_filename (abfd));
+ {
+ if (dynamic && bfd_get_error () == bfd_error_no_symbols)
+ {
+ non_fatal (_("%s: no symbols"), bfd_get_filename (abfd));
+ return;
+ }
+
+ bfd_fatal (bfd_get_filename (abfd));
+ }
if (symcount == 0)
{