doc.go 1.25 KB
Newer Older
Russ Cox's avatar
Russ Cox committed
1
// Copyright 2013 The Go Authors. All rights reserved.
2 3 4
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

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