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

Issue 48870044: code review 48870044: cmd/link: intial skeleton of linker written in Go (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 2 months ago by rsc
Modified:
11 years, 2 months ago
Reviewers:
u, iant
CC:
iant, golang-codereviews
Visibility:
Public.

Description

cmd/link: intial skeleton of linker written in Go

Patch Set 1 #

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

Total comments: 16

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

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+833 lines, -0 lines) Patch
M src/cmd/go/pkg.go View 1 1 chunk +1 line, -0 lines 0 comments Download
A src/cmd/link/dead.go View 1 1 chunk +11 lines, -0 lines 0 comments Download
A src/cmd/link/debug.go View 1 1 chunk +11 lines, -0 lines 0 comments Download
A src/cmd/link/layout.go View 1 2 1 chunk +158 lines, -0 lines 2 comments Download
A src/cmd/link/link_test.go View 1 1 chunk +32 lines, -0 lines 0 comments Download
A src/cmd/link/load.go View 1 2 1 chunk +98 lines, -0 lines 0 comments Download
A src/cmd/link/main.go View 1 1 chunk +9 lines, -0 lines 0 comments Download
A src/cmd/link/prog.go View 1 2 1 chunk +182 lines, -0 lines 0 comments Download
A src/cmd/link/prog_test.go View 1 1 chunk +161 lines, -0 lines 0 comments Download
A src/cmd/link/runtime.go View 1 1 chunk +11 lines, -0 lines 0 comments Download
A src/cmd/link/scan.go View 1 1 chunk +119 lines, -0 lines 1 comment Download
A src/cmd/link/testdata/hello.6 View 1 Binary file 0 comments Download
A src/cmd/link/testdata/hello.s View 1 1 chunk +15 lines, -0 lines 0 comments Download
A src/cmd/link/testdata/link.hello.darwin.amd64 View 1 Binary file 0 comments Download
A src/cmd/link/util.go View 1 1 chunk +11 lines, -0 lines 0 comments Download
A src/cmd/link/write.go View 1 1 chunk +14 lines, -0 lines 0 comments Download

Messages

Total messages: 5
rsc
Hello iant (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
11 years, 2 months ago (2014-01-08 05:00:21 UTC) #1
iant
LGTM https://codereview.appspot.com/48870044/diff/20001/src/cmd/link/layout.go File src/cmd/link/layout.go (right): https://codereview.appspot.com/48870044/diff/20001/src/cmd/link/layout.go#newcode14 src/cmd/link/layout.go:14: // final executable. Go binaries only have a ...
11 years, 2 months ago (2014-01-08 21:14:58 UTC) #2
rsc
https://codereview.appspot.com/48870044/diff/20001/src/cmd/link/layout.go File src/cmd/link/layout.go (right): https://codereview.appspot.com/48870044/diff/20001/src/cmd/link/layout.go#newcode14 src/cmd/link/layout.go:14: // final executable. Go binaries only have a fixed ...
11 years, 2 months ago (2014-01-09 22:00:50 UTC) #3
rsc
*** Submitted as https://code.google.com/p/go/source/detail?r=1df309e88440 *** cmd/link: intial skeleton of linker written in Go R=iant CC=golang-codereviews ...
11 years, 2 months ago (2014-01-10 00:29:19 UTC) #4
u
11 years, 2 months ago (2014-01-11 13:44:28 UTC) #5
Message was sent while issue was closed.
The skeleton structure for the new linker is really clean. Thank you very much
for starting this work!

https://codereview.appspot.com/48870044/diff/40001/src/cmd/link/layout.go
File src/cmd/link/layout.go (right):

https://codereview.appspot.com/48870044/diff/40001/src/cmd/link/layout.go#new...
src/cmd/link/layout.go:27: {Segment: "text", Section: "text", Kind:
goobj.STEXT},
It seems like Section is always a string interpretation of Kind. Would it be
possible to redefine the String method of goobj.SymKind to return "text", "data"
instead of "STEXT", "SDATA", etc?

https://codereview.appspot.com/48870044/diff/40001/src/cmd/link/layout.go#new...
src/cmd/link/layout.go:46: var layoutByKind []*layoutSection
Are lookup time in layoutByKind a bottle neck? If not a map from goobj.SymKind
to *layoutSection would be intuitive and simplify code such as "if kind < 0 ||
int(kind) >= len(layoutByKind) || layoutByKind[kind] == nil {" to "if
layoutByKind[kind] == nil {". It would also simplify init.

https://codereview.appspot.com/48870044/diff/40001/src/cmd/link/scan.go
File src/cmd/link/scan.go (right):

https://codereview.appspot.com/48870044/diff/40001/src/cmd/link/scan.go#newco...
src/cmd/link/scan.go:84: if p.Syms[r.Sym] != nil {
p.Syms is a map from SymID to *Sym. My suggestion is to rename the Sym member of
goobj.Reloc to SymID. This would make it consistent with "p.Syms[gs.SymID]". If
such a change is made goobj.FuncData should also use SymID instead of Sym.
Sign in to reply to this message.

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