scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

scc-nm.man (3642B)


      1 .TH SCC-NM 1 scc\-VERSION
      2 .SH NAME
      3 scc-nm \- list symbol table of object files
      4 .SH SYNOPSIS
      5 .B scc-nm
      6 .RB [ \-APfgauv ]
      7 .RB [ \-t
      8 .IR format ]
      9 .RI [ file ...]
     10 .SH DESCRIPTION
     11 .B scc-nm
     12 lists the symbol table of each object
     13 .I file
     14 specified.
     15 If no
     16 .I file
     17 arguments are given,
     18 .B scc-nm
     19 reads from
     20 .B a.out
     21 by default.
     22 .PP
     23 For each symbol,
     24 .B scc-nm
     25 writes to standard output the symbol value, type, and name.
     26 The symbol type is represented as a single character.
     27 Uppercase letters denote global (external) symbols;
     28 lowercase letters denote local symbols.
     29 The following type characters are commonly used:
     30 .PP
     31 .RS
     32 .PD 0
     33 .TP
     34 .B U
     35 Undefined symbol.
     36 .TP
     37 .B T t
     38 Symbol in the text (code) section.
     39 .TP
     40 .B D d
     41 Symbol in the initialised data section.
     42 .TP
     43 .B B b
     44 Symbol in the BSS (uninitialised data) section.
     45 .TP
     46 .B R r
     47 Symbol in the read-only data section.
     48 .TP
     49 .B N
     50 Debugging symbol.
     51 .TP
     52 .B ?
     53 Symbol of unknown type.
     54 .PD
     55 .RE
     56 .PP
     57 By default, symbols of type
     58 .BR ? ,
     59 .BR N ,
     60 section symbols, and file symbols are excluded from the output.
     61 The
     62 .B \-f
     63 option includes them.
     64 .PP
     65 In the default output format, each symbol is printed on one line as:
     66 .PP
     67 .RS
     68 .I value type name
     69 .RE
     70 .PP
     71 where
     72 .I value
     73 is a 16-digit number in the specified radix.
     74 For undefined symbols,
     75 .I value
     76 is printed as 16 spaces.
     77 .PP
     78 When processing multiple files, or when listing members of an archive,
     79 a header line consisting of the file or member name followed by a colon
     80 is printed before each group of symbols, unless
     81 .B \-A
     82 is specified.
     83 .SH OPTIONS
     84 .TP
     85 .B \-A
     86 Precede each output line with the pathname of the object file.
     87 For archive members, the format is
     88 .IB filename [ membname ]:
     89 followed by a space.
     90 .TP
     91 .B \-a
     92 Identical to
     93 .BR \-f .
     94 Include all symbols in the output.
     95 .TP
     96 .B \-f
     97 Include all symbols in the output, including symbols of unknown type
     98 .RB ( ? ),
     99 debugging symbols
    100 .RB ( N ),
    101 section symbols, and file symbols.
    102 Without this option, these symbols are excluded.
    103 .TP
    104 .B \-g
    105 Display only global (external) symbols.
    106 A symbol is global if its type character is uppercase.
    107 .TP
    108 .B \-P
    109 Write information in a portable output format as specified by POSIX.
    110 Each output line has the form:
    111 .PP
    112 .RS
    113 .RS
    114 .I name type
    115 .RE
    116 .RE
    117 .PP
    118 .RS
    119 For symbols that are not undefined, the value and size follow,
    120 both in the specified radix:
    121 .RE
    122 .PP
    123 .RS
    124 .RS
    125 .I name type value size
    126 .RE
    127 .RE
    128 .TP
    129 .BI \-t " format"
    130 Display symbol values and sizes using the specified numeric base.
    131 .I format
    132 must be one of:
    133 .RS
    134 .TP
    135 .B d
    136 Decimal.
    137 .TP
    138 .B o
    139 Octal.
    140 .TP
    141 .B x
    142 Hexadecimal (default).
    143 .RE
    144 .TP
    145 .B \-u
    146 Display only undefined symbols (type
    147 .BR U ).
    148 .TP
    149 .B \-v
    150 Sort symbols by value instead of by name.
    151 Undefined symbols are sorted before defined symbols when sorting by value.
    152 .SH OPERANDS
    153 .TP
    154 .I file
    155 A pathname of an object file or archive library whose symbol table is
    156 to be listed.
    157 If no operands are given,
    158 .B scc-nm
    159 reads from
    160 .BR a.out .
    161 .SH EXAMPLES
    162 List symbols from an object file:
    163 .IP
    164 .EX
    165 scc-nm foo.o
    166 .EE
    167 .PP
    168 List only global (external) symbols from an archive:
    169 .IP
    170 .EX
    171 scc-nm \-g libfoo.a
    172 .EE
    173 .PP
    174 List only undefined symbols:
    175 .IP
    176 .EX
    177 scc-nm \-u foo.o
    178 .EE
    179 .PP
    180 List symbols sorted by value:
    181 .IP
    182 .EX
    183 scc-nm \-v foo.o
    184 .EE
    185 .PP
    186 List all symbols including debugging and section symbols:
    187 .IP
    188 .EX
    189 scc-nm \-f foo.o
    190 .EE
    191 .PP
    192 List symbols in POSIX format with decimal values:
    193 .IP
    194 .EX
    195 scc-nm \-P \-t d foo.o
    196 .EE
    197 .PP
    198 Prefix each output line with the filename when processing multiple files:
    199 .IP
    200 .EX
    201 scc-nm \-A foo.o bar.o
    202 .EE
    203 .SH STANDARDS
    204 The
    205 .B scc-nm
    206 utility is designed to conform to IEEE Std 1003.1-2008 (POSIX.1).
    207 .SH SEE ALSO
    208 .BR scc-ar (1),
    209 .BR scc-ranlib (1),
    210 .BR scc-ld (1),
    211 .BR scc-strip (1)