github.com/yanyiwu/go@v0.0.0-20150106053140-03d6637dbb7f/src/cmd/nm/doc.go (about)

     1  // Copyright 2013 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Nm lists the symbols defined or used by an object file, archive, or executable.
     6  //
     7  // Usage:
     8  //	go tool nm [options] file...
     9  //
    10  // The default output prints one line per symbol, with three space-separated
    11  // fields giving the address (in hexadecimal), type (a character), and name of
    12  // the symbol. The types are:
    13  //
    14  //	T	text (code) segment symbol
    15  //	t	static text segment symbol
    16  //	R	read-only data segment symbol
    17  //	r	static read-only data segment symbol
    18  //	D	data segment symbol
    19  //	d	static data segment symbol
    20  //	B	bss segment symbol
    21  //	b	static bss segment symbol
    22  //	C	constant address
    23  //	U	referenced but undefined symbol
    24  //
    25  // Following established convention, the address is omitted for undefined
    26  // symbols (type U).
    27  //
    28  // The options control the printed output:
    29  //
    30  //	-n
    31  //		an alias for -sort address (numeric),
    32  //		for compatibility with other nm commands
    33  //	-size
    34  //		print symbol size in decimal between address and type
    35  //	-sort {address,name,none,size}
    36  //		sort output in the given order (default name)
    37  //		size orders from largest to smallest
    38  //	-type
    39  //		print symbol type after name
    40  //
    41  package main