diff options
author | Russ Cox <rsc@golang.org> | 2010-01-22 17:06:20 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2010-01-22 17:06:20 -0800 |
commit | a5b02d4bb66ff7269bdaca033382498c2a64eee9 (patch) | |
tree | c53ac65c567f463be044834b10f08f7f77dd405e /src/cmd/5g/gobj.c | |
parent | ca3ec49f2cbf333bb7acb104778ec18693cf7038 (diff) | |
download | golang-a5b02d4bb66ff7269bdaca033382498c2a64eee9.tar.gz |
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>
Diffstat (limited to 'src/cmd/5g/gobj.c')
-rw-r--r-- | src/cmd/5g/gobj.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/5g/gobj.c b/src/cmd/5g/gobj.c index 33cd123a4..fffba011d 100644 --- a/src/cmd/5g/gobj.c +++ b/src/cmd/5g/gobj.c @@ -354,7 +354,7 @@ datastring(char *s, int len, Addr *a) tmp.lit.s[len] = '\0'; len++; snprint(namebuf, sizeof(namebuf), "\"%Z\"", &tmp.lit); - ao.sym = pkglookup(namebuf, "string"); + ao.sym = pkglookup(namebuf, stringpkg); ao.name = D_EXTERN; } *a = ao; @@ -436,7 +436,7 @@ datagostring(Strlit *sval, Addr *a) // so that multiple modules using the same string // can share it. snprint(namebuf, sizeof(namebuf), "\"%Z\"", sval); - ao.sym = pkglookup(namebuf, "go.string"); + ao.sym = pkglookup(namebuf, gostringpkg); ao.name = D_EXTERN; } |