aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/nm/nm.c
AgeCommit message (Collapse)Author
2013-12-16cmd/nm: reimplement in GoRuss Cox
The immediate goal is to support the new object file format, which libmach (nm's support library) does not understand. Rather than add code to libmach or reengineer liblink to support this new use, just write it in Go. The C version of nm reads the Plan 9 symbol table stored in Go binaries, now otherwise unused. This reimplementation uses the standard symbol table for the corresponding file format instead, bringing us one step closer to removing the Plan 9 symbol table from Go binaries. Tell cmd/dist not to build cmd/nm anymore. Tell cmd/go to install cmd/nm in the tool directory. R=golang-dev, r, iant, alex.brainman CC=golang-dev https://golang.org/cl/40600043
2013-09-16cmd/nm: make -S listing a bit more accurateRuss Cox
Hide container symbols like text and etext so that the individual pieces inside are shown instead. For example, if text and main.init have the same address, it was a toss-up which name was printed. R=golang-dev, iant CC=golang-dev https://golang.org/cl/13722046
2013-09-16cmd/nm: put the -S flag in the usage messageRob Pike
The -S flag reports symbol size, but is missing from the usage message. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/13660046
2013-04-03cmd/nm: don't add filename elements for m symbolsAnthony Martin
The compilers used to generate only one 'm' symbol to record the stack frame size for each function. In cmd/nm, the 'm' and 'f' symbols are handled in the same switch case with a special exception for the symbol described above called ".frame". Now that the compilers emit additional 'm' symbols for precise garbage collection of the stack, the current logic is incorrect. cmd/nm will attempt to interpret these new 'm' symbols as 'f' symbols and add them to the file name index table. This fails with an out-of-memory condition when zenter encounters an 'm' symbol with a very large value (usually the .args symbol indicating a variadic NOSPLIT function). R=iant CC=dave, gobot, golang-dev, rsc https://golang.org/cl/7962045
2012-09-13cmd/pack: rename __.SYMDEF to __.GOSYMDEFRuss Cox
This fixes a problem with ELF tools thinking they know the format of the symbol table, as we do not use any of the standard formats for that table. This change will probably annoy the Plan 9 users, but I believe there are other incompatibilities already that mean they have to use a Go-specific nm. Fixes #3473. R=golang-dev, iant CC=golang-dev https://golang.org/cl/6500117
2010-12-10nm: silently ignore .o files in .a filesRuss Cox
Update #1334. R=r CC=golang-dev https://golang.org/cl/3553041
2010-10-13various: avoid %ld etcRuss Cox
The Plan 9 tools assume that long is 32 bits. We converted all instances of long to int32 when importing the code but missed the print formats. Because int32 is always int on the compilers we use, it is never correct to use %lux, %ld, etc. Convert to %ux, %d, etc. (It matters because on 64-bit gcc, long is 64 bits, so we were printing 32-bit quantities with 64-bit formats.) R=ken2 CC=golang-dev https://golang.org/cl/2491041
2009-09-08add -S flag to print size of symbolRuss Cox
R=r DELTA=24 (15 added, 0 deleted, 9 changed) OCL=34447 CL=34458
2009-08-14rename libmach_amd64 libmachRob Pike
R=rsc OCL=33273 CL=33276
2009-08-12change gotype in symbol table fromRuss Cox
character string to machine address. not filled in, just carved out. R=austin DELTA=77 (11 added, 34 deleted, 32 changed) OCL=33122 CL=33124
2009-04-15fix gotest by fixing nm -s to print in file order by storing a sequence numberRob Pike
as the .6 file is read. now tests will be run in file order. R=rsc DELTA=9 (6 added, 1 deleted, 2 changed) OCL=27542 CL=27544
2008-11-20symbol table changesRuss Cox
* add gotype string to symbol table * fill in gotype in 6l for known funcs/vars * print gotype with nm -t * load symbol and pc/ln tables into memory at magic address 0x99<<32. * add sys.symdat() to retrieve raw bytes of symbol table and pc/ln table. most of this should be considered experimental and subject to change. R=r DELTA=157 (128 added, 0 deleted, 29 changed) OCL=19746 CL=19750
2008-08-03add nmRuss Cox
R=r DELTA=339 (339 added, 0 deleted, 0 changed) OCL=13786 CL=13794