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
https://golang.org/cl/186263
diff --git a/src/cmd/6l/obj.c b/src/cmd/6l/obj.c
index 9ecdf6e..e29cdb9 100644
--- a/src/cmd/6l/obj.c
+++ b/src/cmd/6l/obj.c
@@ -347,7 +347,7 @@
 	lastp = firstp;
 
 	while(*argv)
-		objfile(*argv++);
+		objfile(*argv++, "main");
 
 	if(!debug['l'])
 		loadlib();
@@ -485,14 +485,14 @@
 }
 
 void
-ldobj1(Biobuf *f, int64 len, char *pn)
+ldobj1(Biobuf *f, char *pkg, int64 len, char *pn)
 {
 	vlong ipc;
 	Prog *p, *t;
 	int v, o, r, skip, mode;
 	Sym *h[NSYM], *s, *di;
 	uint32 sig;
-	char *name;
+	char *name, *x;
 	int ntext;
 	vlong eof;
 	char src[1024];
@@ -542,7 +542,11 @@
 			}
 			goto eof;
 		}
-		s = lookup(name, r);
+		x = expandpkg(name, pkg);
+		s = lookup(x, r);
+		if(x != name)
+			free(x);
+		name = nil;
 
 		if(debug['S'] && r == 0)
 			sig = 1729;