summaryrefslogtreecommitdiff
path: root/binutils/nm.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-03-17 10:14:07 +0000
committerNick Clifton <nickc@redhat.com>2003-03-17 10:14:07 +0000
commit0b523ad6a3f246d9e14a31c15797134722c6f68e (patch)
treec111a71b0c870507e0f8b995e5fa8259e12de548 /binutils/nm.c
parentf535a2a4722957ec8c1e96da9ce9213be1fe19d8 (diff)
downloadbinutils-redhat-0b523ad6a3f246d9e14a31c15797134722c6f68e.tar.gz
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.
Diffstat (limited to 'binutils/nm.c')
-rw-r--r--binutils/nm.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/binutils/nm.c b/binutils/nm.c
index 4f558c1f26..8463acb1ab 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));
}
}