patch to fix nm.c(print_object_filename_bsd) on FreeBSD

Ian Lance Taylor ian@zembu.com
Tue Apr 18 21:15:00 GMT 2000


   Date: Tue, 18 Apr 2000 14:44:13 -0700
   From: "David O'Brien" <obrien@FreeBSD.org>

   nm's output is wrong in this respect and causes problems for FreeBSD's
   ``lorder''.  This patch may easily not be acceptable as is.  If not,
   please give direction for how to fix the problem in nm.

   2000-04-18  David O'Brien  <obrien@FreeBSD.org>

	   * nm.c (print_object_filename_bsd): Fix test to properly format
	   output.


   Index: nm.c
   ===================================================================
   RCS file: /cvs/src/src/binutils/nm.c,v
   retrieving revision 1.7
   diff -u -r1.7 nm.c
   --- nm.c	2000/04/07 04:34:50	1.7
   +++ nm.c	2000/04/18 21:28:03
   @@ -1268,7 +1268,11 @@
    print_object_filename_bsd (filename)
	 char *filename;
    {
   -  if (filename_per_file && !filename_per_symbol)
   +  if (filename_per_file 
   +#ifndef __FreeBSD__
   +		  && !filename_per_symbol
   +#endif
   +  )
	printf ("\n%s:\n", filename);
    }

This patch may be correct for all hosts.  I'm not sure.  The default
output for nm should match that of the traditional BSD nm.

I gather that what you are saying here is that nm -o, if invoked with
multiple files, should print the filename on a separate line as well
as printing it on the line with every symbol.

Can anybody please check other BSD systems?  Is that how the BSD nm
behaves elsewhere as well?  That is, what is the output of
    nm -o foo.o bar.o
?

Ian


More information about the Binutils mailing list