aboutsummaryrefslogtreecommitdiff
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
commit06a30c77e0dd15dc3adf2d261815580ecc534d27 (patch)
tree8abcfea7838125f2af740e23803ed42a12bc9b89 /binutils/nm.c
parent27adcae577a61dd830a5920b06832a9655b72386 (diff)
downloadgdb-06a30c77e0dd15dc3adf2d261815580ecc534d27.zip
gdb-06a30c77e0dd15dc3adf2d261815580ecc534d27.tar.gz
gdb-06a30c77e0dd15dc3adf2d261815580ecc534d27.tar.bz2
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 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));
}
}