nm.c (print_symbol_info_bsd): Print the symbol's size instead of the symbol's
authorNick Clifton <nickc@redhat.com>
Mon, 17 Mar 2003 10:14:07 +0000 (10:14 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 17 Mar 2003 10:14:07 +0000 (10:14 +0000)
value when --size-sort is used, unless -S is used.
doc/binutils.texi (--size-sort): For non-bsd formats both the value and size
of the symbols are displayed.

binutils/ChangeLog
binutils/doc/binutils.texi
binutils/nm.c

index 0a7ebbc8c238862647e8e88980fde195adc12c39..fc57abf7cb2820a2c1f4898b8ad649543f3d9b38 100644 (file)
@@ -1,3 +1,10 @@
+2003-03-16  Elias Athanasopoulos  <elathan@phys.uoa.gr>
+
+       * nm.c (print_symbol_info_bsd): Print the symbol's size instead of
+       the symbol's value when --size-sort is used, unless -S is used.
+       doc/binutils.texi (--size-sort): For non-bsd formats both the
+       value and size of the symbols are displayed.
+       
 2003-03-13  Nick Clifton  <nickc@redhat.com>
 
        * po/da.po: Update.
index fb234395222b52eee6fc78c32beac64227507c9d..5c38b84e73dbdd9e38db344220bdd101734188eb 100644 (file)
@@ -857,7 +857,7 @@ Equivalent to @samp{-f posix}.
 
 @item -S
 @itemx --print-size
-Print size of defined symbols for the @code{bsd} output format.
+Print size, not the value, of defined symbols for the @code{bsd} output format.
 
 @item -s
 @itemx --print-armap
@@ -874,8 +874,7 @@ last come first.
 @item --size-sort
 Sort symbols by size.  The size is computed as the difference between
 the value of the symbol and the value of the symbol with the next higher
-value.  The size of the symbol is printed, rather than the value.
-structure.  If the @code{bsd} output format is used the size of the symbol 
+value.  If the @code{bsd} output format is used the size of the symbol 
 is printed, rather than the value, and @samp{-S} must be used in order 
 both size and value to be printed.
 
index 4f558c1f26ce49a61eb9607e538234b5305e97c8..8463acb1abdd71a1b0391fafb3ff50e0fa6a3c2c 100644 (file)
@@ -1539,11 +1539,18 @@ print_symbol_info_bsd (info, abfd)
     }
   else
     {
-      print_value (abfd, SYM_VALUE (info));
+      /* Normally we print the value of the symbol.  If we are printing the
+        size or sorting by size then we print its size, execpt for the
+        (weird) special case where both flags are defined, in which case we
+        print both values.  This conforms to documented behaviour.  */
+      if (sort_by_size && !print_size)
+       print_value (abfd, SYM_SIZE (info));
+      else
+       print_value (abfd, SYM_VALUE (info));
 
       if (print_size && SYM_SIZE (info))
        {
-         printf(" ");
+         printf (" ");
          print_value (abfd, SYM_SIZE (info));
        }
     }
This page took 0.030254 seconds and 4 git commands to generate.