aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--binutils/ChangeLog7
-rw-r--r--binutils/doc/binutils.texi5
-rw-r--r--binutils/nm.c11
3 files changed, 18 insertions, 5 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 0a7ebbc..fc57abf 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -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.
diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi
index fb23439..5c38b84 100644
--- a/binutils/doc/binutils.texi
+++ b/binutils/doc/binutils.texi
@@ -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.
diff --git a/binutils/nm.c b/binutils/nm.c
index 4f558c1..8463acb 100644
--- a/binutils/nm.c
+++ b/binutils/nm.c
@@ -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));
}
}