scc

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

scc-nm.1 (3781B)


      1 .TH 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 EXIT STATUS
    162 .TP
    163 .B 0
    164 Successful completion.
    165 .TP
    166 .B >0
    167 An error occurred.
    168 .SH EXAMPLES
    169 List symbols from an object file:
    170 .IP
    171 .EX
    172 scc-nm foo.o
    173 .EE
    174 .PP
    175 List only global (external) symbols from an archive:
    176 .IP
    177 .EX
    178 scc-nm \-g libfoo.a
    179 .EE
    180 .PP
    181 List only undefined symbols:
    182 .IP
    183 .EX
    184 scc-nm \-u foo.o
    185 .EE
    186 .PP
    187 List symbols sorted by value:
    188 .IP
    189 .EX
    190 scc-nm \-v foo.o
    191 .EE
    192 .PP
    193 List all symbols including debugging and section symbols:
    194 .IP
    195 .EX
    196 scc-nm \-f foo.o
    197 .EE
    198 .PP
    199 List symbols in POSIX format with decimal values:
    200 .IP
    201 .EX
    202 scc-nm \-P \-t d foo.o
    203 .EE
    204 .PP
    205 Prefix each output line with the filename when processing multiple files:
    206 .IP
    207 .EX
    208 scc-nm \-A foo.o bar.o
    209 .EE
    210 .SH STANDARDS
    211 The
    212 .B scc-nm
    213 utility is designed to conform to IEEE Std 1003.1-2008 (POSIX.1).
    214 .SH LICENSE
    215 See the LICENSE file for the terms of redistribution.
    216 .SH SEE ALSO
    217 .BR scc-ar (1),
    218 .BR scc-ranlib (1),
    219 .BR scc-ld (1),
    220 .BR scc-strip (1)