Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1984)

Issue 40600043: code review 40600043: cmd/nm: reimplement in Go (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 4 months ago by rsc
Modified:
10 years, 4 months ago
Reviewers:
r
CC:
golang-dev, r, iant, brainman
Visibility:
Public.

Description

cmd/nm: reimplement in Go 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.

Patch Set 1 #

Patch Set 2 : diff -r 1053bd434eaa https://code.google.com/p/go/ #

Patch Set 3 : diff -r 1053bd434eaa https://code.google.com/p/go/ #

Patch Set 4 : diff -r 1053bd434eaa https://code.google.com/p/go/ #

Patch Set 5 : diff -r 1053bd434eaa https://code.google.com/p/go/ #

Total comments: 4

Patch Set 6 : diff -r c0c2d0b05a77 https://code.google.com/p/go/ #

Patch Set 7 : diff -r c0c2d0b05a77 https://code.google.com/p/go/ #

Patch Set 8 : diff -r c0c2d0b05a77 https://code.google.com/p/go/ #

Total comments: 7

Patch Set 9 : diff -r 5130190e81b5 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+456 lines, -428 lines) Patch
M src/cmd/dist/build.c View 1 2 chunks +1 line, -3 lines 0 comments Download
M src/cmd/go/pkg.go View 1 2 1 chunk +1 line, -0 lines 0 comments Download
R src/cmd/nm/Makefile View 1 1 chunk +0 lines, -5 lines 0 comments Download
M src/cmd/nm/doc.go View 1 2 3 4 5 6 1 chunk +33 lines, -19 lines 0 comments Download
A src/cmd/nm/elf.go View 1 2 3 4 5 6 7 1 chunk +54 lines, -0 lines 0 comments Download
A src/cmd/nm/goobj.go View 1 2 3 4 5 6 7 8 1 chunk +68 lines, -0 lines 0 comments Download
A src/cmd/nm/macho.go View 1 2 3 4 5 6 7 1 chunk +69 lines, -0 lines 0 comments Download
R src/cmd/nm/nm.c View 1 1 chunk +0 lines, -401 lines 0 comments Download
A src/cmd/nm/nm.go View 1 2 3 4 5 6 1 chunk +176 lines, -0 lines 0 comments Download
A src/cmd/nm/pe.go View 1 2 3 4 5 6 7 1 chunk +54 lines, -0 lines 0 comments Download

Messages

Total messages: 11
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
10 years, 4 months ago (2013-12-11 02:59:21 UTC) #1
r
https://codereview.appspot.com/40600043/diff/80001/src/cmd/nm/nm.go File src/cmd/nm/nm.go (right): https://codereview.appspot.com/40600043/diff/80001/src/cmd/nm/nm.go#newcode25 src/cmd/nm/nm.go:25: printType = flag.Bool("T", false, "print type") since we have ...
10 years, 4 months ago (2013-12-11 03:43:12 UTC) #2
rsc
PTAL https://codereview.appspot.com/40600043/diff/80001/src/cmd/nm/nm.go File src/cmd/nm/nm.go (right): https://codereview.appspot.com/40600043/diff/80001/src/cmd/nm/nm.go#newcode25 src/cmd/nm/nm.go:25: printType = flag.Bool("T", false, "print type") On 2013/12/11 ...
10 years, 4 months ago (2013-12-11 18:13:18 UTC) #3
r
LGTM https://codereview.appspot.com/40600043/diff/130001/src/cmd/nm/goobj.go File src/cmd/nm/goobj.go (right): https://codereview.appspot.com/40600043/diff/130001/src/cmd/nm/goobj.go#newcode5 src/cmd/nm/goobj.go:5: package main // Parsing of Go intermediate files ...
10 years, 4 months ago (2013-12-11 18:22:03 UTC) #4
iant
https://codereview.appspot.com/40600043/diff/130001/src/cmd/nm/elf.go File src/cmd/nm/elf.go (right): https://codereview.appspot.com/40600043/diff/130001/src/cmd/nm/elf.go#newcode45 src/cmd/nm/elf.go:45: sym.Code = 'R' The code 'R' is not documented ...
10 years, 4 months ago (2013-12-11 23:25:43 UTC) #5
brainman
I am probably wrong but ... Your new command is vastly different from the old ...
10 years, 4 months ago (2013-12-11 23:58:03 UTC) #6
rsc
https://codereview.appspot.com/40600043/diff/130001/src/cmd/nm/nm.go File src/cmd/nm/nm.go (right): https://codereview.appspot.com/40600043/diff/130001/src/cmd/nm/nm.go#newcode140 src/cmd/nm/nm.go:140: fmt.Fprintf(w, "%8s", "") On 2013/12/11 23:25:43, iant wrote: > ...
10 years, 4 months ago (2013-12-11 23:58:04 UTC) #7
brainman
On 2013/12/11 23:58:03, brainman wrote: That is what I see: C:\go\root\src\pkg\archive\zip>go tool nm zip.test.exe <- ...
10 years, 4 months ago (2013-12-12 00:03:29 UTC) #8
rsc
On Wed, Dec 11, 2013 at 3:58 PM, <alex.brainman@gmail.com> wrote: > I am probably wrong ...
10 years, 4 months ago (2013-12-12 00:13:42 UTC) #9
r
Once symtab goes away, it will show only 3 symbols. Now that's progress. -rob
10 years, 4 months ago (2013-12-12 00:18:47 UTC) #10
rsc
10 years, 4 months ago (2013-12-16 17:52:14 UTC) #11
*** Submitted as https://code.google.com/p/go/source/detail?r=547e140f5c3c ***

cmd/nm: reimplement in Go

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://codereview.appspot.com/40600043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b