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

Issue 186263: code review 186263: eliminate the package global name space assumption in o... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 2 months ago by rsc
Modified:
15 years, 2 months ago
Reviewers:
CC:
ken2, r, ken3, golang-dev
Visibility:
Public.

Description

eliminate the package global name space assumption in object files 5g/6g/8g: add import statements to export metadata, mapping package path to package name. recognize "" as the path of the package in export metadata. use "" as the path of the package in object symbol names. 5c/6c/8c, 5a/6a/8a: rewrite leading . to "". so that ·Sin means Sin in this package. 5l/6l/8l: rewrite "" in symbol names as object files are read. gotest: handle new symbol names. gopack: handle new import lines in export metadata. Collectively, these changes eliminate the assumption of a global name space in the object file formats. Higher level pieces such as reflect and the computation of type hashes still depend on the assumption; we're not done yet.

Patch Set 1 #

Patch Set 2 : code review 186263: eliminate the package global name space assumption in o... #

Total comments: 5

Patch Set 3 : code review 186263: eliminate the package global name space assumption in o... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+674 lines, -417 lines) Patch
M src/cmd/5g/ggen.c View 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/5g/gobj.c View 2 chunks +2 lines, -2 lines 0 comments Download
M src/cmd/5g/gsubr.c View 1 chunk +2 lines, -2 lines 0 comments Download
M src/cmd/5l/obj.c View 3 chunks +7 lines, -3 lines 0 comments Download
M src/cmd/6g/ggen.c View 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/6g/gobj.c View 2 chunks +2 lines, -2 lines 0 comments Download
M src/cmd/6g/gsubr.c View 1 chunk +2 lines, -2 lines 0 comments Download
M src/cmd/6g/reg.c View 1 chunk +4 lines, -4 lines 0 comments Download
M src/cmd/6l/obj.c View 3 chunks +8 lines, -4 lines 0 comments Download
M src/cmd/8g/ggen.c View 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/8g/gobj.c View 2 chunks +2 lines, -2 lines 0 comments Download
M src/cmd/8g/gsubr.c View 1 chunk +2 lines, -2 lines 0 comments Download
M src/cmd/8g/reg.c View 1 chunk +4 lines, -4 lines 0 comments Download
M src/cmd/8l/obj.c View 4 chunks +8 lines, -4 lines 0 comments Download
M src/cmd/cc/lex.c View 1 2 2 chunks +8 lines, -1 line 0 comments Download
M src/cmd/cc/lexbody View 1 chunk +7 lines, -1 line 0 comments Download
M src/cmd/gc/align.c View 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/gc/builtin.c.boot View 1 chunk +84 lines, -84 lines 0 comments Download
M src/cmd/gc/dcl.c View 1 2 8 chunks +9 lines, -10 lines 0 comments Download
M src/cmd/gc/export.c View 8 chunks +22 lines, -10 lines 0 comments Download
M src/cmd/gc/gen.c View 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/gc/go.h View 11 chunks +33 lines, -15 lines 0 comments Download
M src/cmd/gc/go.y View 13 chunks +43 lines, -46 lines 0 comments Download
M src/cmd/gc/init.c View 3 chunks +3 lines, -3 lines 0 comments Download
M src/cmd/gc/lex.c View 10 chunks +45 lines, -31 lines 0 comments Download
M src/cmd/gc/obj.c View 3 chunks +3 lines, -5 lines 0 comments Download
M src/cmd/gc/reflect.c View 11 chunks +29 lines, -15 lines 0 comments Download
M src/cmd/gc/subr.c View 1 2 12 chunks +113 lines, -56 lines 0 comments Download
M src/cmd/gc/typecheck.c View 2 chunks +2 lines, -2 lines 0 comments Download
M src/cmd/gc/unsafe.c View 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/gopack/ar.c View 5 chunks +31 lines, -29 lines 0 comments Download
M src/cmd/gotest/gotest View 1 chunk +23 lines, -2 lines 0 comments Download
M src/cmd/ld/go.c View 9 chunks +52 lines, -39 lines 0 comments Download
M src/cmd/ld/lib.h View 3 chunks +15 lines, -7 lines 0 comments Download
M src/cmd/ld/lib.c View 1 2 15 chunks +103 lines, -24 lines 0 comments Download

Messages

Total messages: 5
rsc
Hello ken2, r (cc: golang-dev@googlegroups.com), I'd like you to review this change.
15 years, 2 months ago (2010-01-21 23:39:40 UTC) #1
ken3
LGTM On 2010/01/21 23:39:40, rsc wrote: > Hello ken2, r (cc: mailto:golang-dev@googlegroups.com), > > I'd ...
15 years, 2 months ago (2010-01-22 00:00:44 UTC) #2
r
LGTM http://codereview.appspot.com/186263/diff/1001/1016 File src/cmd/cc/lex.c (right): http://codereview.appspot.com/186263/diff/1001/1016#newcode419 src/cmd/cc/lex.c:419: memmove(symb+2, symb, w-symb); i presume there's known to ...
15 years, 2 months ago (2010-01-22 00:02:26 UTC) #3
rsc
> http://codereview.appspot.com/186263/diff/1001/1033#newcode125 > src/cmd/gotest/gotest:125: pkg=$(sed -n 's/^ .* in package > "\(.*\)".*/\1/p' $i | sed ...
15 years, 2 months ago (2010-01-23 00:13:33 UTC) #4
rsc
15 years, 2 months ago (2010-01-23 01:06:24 UTC) #5
*** Submitted as http://code.google.com/p/go/source/detail?r=ac4d67277b86 ***

eliminate the package global name space assumption in object files

5g/6g/8g: add import statements to export metadata, mapping package path to
package name.
	recognize "" as the path of the package in export metadata.
	use "" as the path of the package in object symbol names.

5c/6c/8c, 5a/6a/8a: rewrite leading . to "". so that ·Sin means Sin in this
package.

5l/6l/8l: rewrite "" in symbol names as object files are read.

gotest: handle new symbol names.

gopack: handle new import lines in export metadata.

Collectively, these changes eliminate the assumption of a global
name space in the object file formats.  Higher level pieces such as
reflect and the computation of type hashes still depend on the
assumption; we're not done yet.

R=ken2, r, ken3
CC=golang-dev
http://codereview.appspot.com/186263

Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.

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