@c man begin SYNOPSIS nm
nm [@option{-a}|@option{--debug-syms}] [@option{-g}|@option{--extern-only}]
[@option{-B}] [@option{-C}|@option{--demangle}[=@var{style}]] [@option{-D}|@option{--dynamic}]
- [@option{-s}|@option{--print-armap}] [@option{-A}|@option{-o}|@option{--print-file-name}]
+ [@option{-S}|@option{--print-size}] [@option{-s}|@option{--print-armap}]
+ [@option{-A}|@option{-o}|@option{--print-file-name}]
[@option{-n}|@option{-v}|@option{--numeric-sort}] [@option{-p}|@option{--no-sort}]
[@option{-r}|@option{--reverse-sort}] [@option{--size-sort}] [@option{-u}|@option{--undefined-only}]
[@option{-t} @var{radix}|@option{--radix=}@var{radix}] [@option{-P}|@option{--portability}]
Use the POSIX.2 standard output format instead of the default format.
Equivalent to @samp{-f posix}.
+@item -S
+@itemx --print-size
+Print size of defined symbols for the @code{bsd} output format.
+
@item -s
@itemx --print-armap
@cindex symbol index, listing
static int no_sort = 0; /* Don't sort; print syms in order found. */
static int print_debug_syms = 0;/* Print debugger-only symbols too. */
static int print_armap = 0; /* Describe __.SYMDEF data in archive files. */
+static int print_size = 0; /* Print size of defined symbols. */
static int reverse_sort = 0; /* Sort in downward(alpha or numeric) order. */
static int sort_numerically = 0;/* Sort in numeric rather than alpha order. */
static int sort_by_size = 0; /* Sort by size of symbol. */
{"portability", no_argument, 0, 'P'},
{"print-armap", no_argument, &print_armap, 1},
{"print-file-name", no_argument, 0, 'o'},
+ {"print-size", no_argument, 0, 'S'},
{"radix", required_argument, 0, 't'},
{"reverse-sort", no_argument, &reverse_sort, 1},
{"size-sort", no_argument, &sort_by_size, 1},
-p, --no-sort Do not sort the symbols\n\
-P, --portability Same as --format=posix\n\
-r, --reverse-sort Reverse the sense of the sort\n\
+ -S, --print-size Print size of defined symbols\n\
-s, --print-armap Include index for symbols from archive members\n\
--size-sort Sort symbols by size\n\
-t, --radix=RADIX Use RADIX for printing symbol values\n\
bfd_init ();
set_default_bfd_target ();
- while ((c = getopt_long (argc, argv, "aABCDef:gHhlnopPrst:uvVvX:",
+ while ((c = getopt_long (argc, argv, "aABCDef:gHhlnopPrSst:uvVvX:",
long_options, (int *) 0)) != EOF)
{
switch (c)
case 's':
print_armap = 1;
break;
+ case 'S':
+ print_size = 1;
+ break;
case 't':
set_print_radix (optarg);
break;
{
print_value (abfd, SYM_VALUE (info));
- if (SYM_SIZE (info))
+ if (print_size && SYM_SIZE (info))
{
printf(" ");
print_value (abfd, SYM_SIZE (info));