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

Issue 51260045: code review 51260045: cmd/link: implement and test automatic symbols (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:
iant
CC:
iant, golang-codereviews
Visibility:
Public.

Description

cmd/link: implement and test automatic symbols Related changes included in this CL: - Add explicit start symbol to Prog. - Add omitRuntime bool to Prog. - Introduce p.Packages[""] to hold automatic symbols - Add SymOrder to Prog to preserve symbol order. - Add layout test (and fix bug that was putting everything in text section).

Patch Set 1 #

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

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

Total comments: 4

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+557 lines, -56 lines) Patch
A src/cmd/link/auto.go View 1 2 1 chunk +117 lines, -0 lines 0 comments Download
A src/cmd/link/auto_test.go View 1 1 chunk +72 lines, -0 lines 0 comments Download
M src/cmd/link/layout.go View 1 2 6 chunks +37 lines, -15 lines 0 comments Download
A src/cmd/link/layout_test.go View 1 2 1 chunk +45 lines, -0 lines 0 comments Download
M src/cmd/link/link_test.go View 1 1 chunk +11 lines, -8 lines 0 comments Download
M src/cmd/link/load.go View 1 4 chunks +27 lines, -7 lines 0 comments Download
M src/cmd/link/macho.go View 1 1 chunk +1 line, -6 lines 0 comments Download
M src/cmd/link/macho_test.go View 1 4 chunks +4 lines, -0 lines 0 comments Download
M src/cmd/link/prog.go View 1 2 8 chunks +45 lines, -9 lines 0 comments Download
M src/cmd/link/scan.go View 1 6 chunks +78 lines, -10 lines 0 comments Download
A src/cmd/link/testdata/autosection.6 View 1 Binary file 0 comments Download
A src/cmd/link/testdata/autosection.s View 1 1 chunk +60 lines, -0 lines 0 comments Download
A src/cmd/link/testdata/autoweak.6 View 1 Binary file 0 comments Download
A src/cmd/link/testdata/autoweak.s View 1 1 chunk +30 lines, -0 lines 0 comments Download
A src/cmd/link/testdata/layout.6 View 1 Binary file 0 comments Download
A src/cmd/link/testdata/layout.s View 1 1 chunk +29 lines, -0 lines 0 comments Download
M src/cmd/link/write.go View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3
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-13 16:28:58 UTC) #1
iant
LGTM https://codereview.appspot.com/51260045/diff/40001/src/cmd/link/layout_test.go File src/cmd/link/layout_test.go (right): https://codereview.appspot.com/51260045/diff/40001/src/cmd/link/layout_test.go#newcode23 src/cmd/link/layout_test.go:23: if len(p.Dead) > 0 { I don't see ...
11 years, 2 months ago (2014-01-13 19:17:45 UTC) #2
rsc
11 years, 2 months ago (2014-01-14 04:08:00 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=7276108715ff ***

cmd/link: implement and test automatic symbols

Related changes included in this CL:

 - Add explicit start symbol to Prog.
 - Add omitRuntime bool to Prog.
 - Introduce p.Packages[""] to hold automatic symbols
 - Add SymOrder to Prog to preserve symbol order.
 - Add layout test (and fix bug that was putting everything in text section).

R=iant
CC=golang-codereviews
https://codereview.appspot.com/51260045

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

https://codereview.appspot.com/51260045/diff/40001/src/cmd/link/layout_test.g...
src/cmd/link/layout_test.go:23: if len(p.Dead) > 0 {
On 2014/01/13 19:17:45, iant wrote:
> I don't see anything in the dead code CL that sets p.Dead.

Sorry, that is in the dead code CL (but only in a more recent upload than you
saw).

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

https://codereview.appspot.com/51260045/diff/40001/src/cmd/link/prog.go#newco...
src/cmd/link/prog.go:103: Bytes      []byte   // symbol data, for internally
defined symbols
On 2014/01/13 19:17:45, iant wrote:
> Just a comment: as programs get larger, the size of the linker symbol table
> increasingly dominates the time it takes to link.  Here you are adding 24
bytes
> to each entry in the symbol table for a rarely used case.  The goobj.Sym
struct
> also has data that is rarely used.  At some point we're going to want to
reduce
> this size.

Thanks. I was tempted to address that now, but I decided to wait until we're
optimizing. I expect that there will need to be a separate map[*Sym][]byte for
the few symbols that will have one of these. The Package and Section fields can
similarly be cut to int32 indexes into tables in the Prog, and perhaps the
goobj.Sym should be inlined instead of an allocation (it's always there), and
perhaps even trimmed.
Sign in to reply to this message.

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