aboutsummaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-08-12 16:14:53 -0700
committerRuss Cox <rsc@golang.org>2009-08-12 16:14:53 -0700
commit57a9bd0ee3e0daaef6bc69f40436463afd855968 (patch)
treef21ba7b24967ad32cf6f3d52fba918c7a14a03b9 /src/cmd
parent3e98a407933c4f53ac825e927d152644b690ef92 (diff)
downloadgo-57a9bd0ee3e0daaef6bc69f40436463afd855968.tar.xz
change gotype in symbol table from
character string to machine address. not filled in, just carved out. R=austin DELTA=77 (11 added, 34 deleted, 32 changed) OCL=33122 CL=33124
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/6l/l.h2
-rw-r--r--src/cmd/6l/span.c15
-rw-r--r--src/cmd/8l/l.h2
-rw-r--r--src/cmd/8l/span.c27
-rw-r--r--src/cmd/ld/go.c5
-rw-r--r--src/cmd/nm/nm.c4
6 files changed, 25 insertions, 30 deletions
diff --git a/src/cmd/6l/l.h b/src/cmd/6l/l.h
index ea6f2c9b5c..5d0d2a3216 100644
--- a/src/cmd/6l/l.h
+++ b/src/cmd/6l/l.h
@@ -402,7 +402,7 @@ void follow(void);
void addstachmark(void);
void gethunk(void);
void gotypestrings(void);
-char* gotypefor(char*);
+vlong gotypefor(char*);
void histtoauto(void);
double ieeedtod(Ieee*);
int32 ieeedtof(Ieee*);
diff --git a/src/cmd/6l/span.c b/src/cmd/6l/span.c
index c0901dd429..82a28de084 100644
--- a/src/cmd/6l/span.c
+++ b/src/cmd/6l/span.c
@@ -150,9 +150,9 @@ xdefine(char *p, int t, vlong v)
}
void
-putsymb(char *s, int t, vlong v, int ver, char *go)
+putsymb(char *s, int t, vlong v, int ver, vlong go)
{
- int i, j, f, l;
+ int i, f, l;
if(t == 'f')
s++;
@@ -181,13 +181,10 @@ putsymb(char *s, int t, vlong v, int ver, char *go)
cput(s[i]);
cput(0);
}
- j = 0;
- if(go) {
- for(j=0; go[j]; j++)
- cput(go[j]);
- }
- cput(0);
- symsize += l + 1 + i + 1 + j + 1;
+ if(l == 8)
+ lputb(go>>32);
+ lputb(go);
+ symsize += l + 1 + i + 1 + l;
if(debug['n']) {
if(t == 'z' || t == 'Z') {
diff --git a/src/cmd/8l/l.h b/src/cmd/8l/l.h
index a1fcd2232a..baf484e02f 100644
--- a/src/cmd/8l/l.h
+++ b/src/cmd/8l/l.h
@@ -391,7 +391,7 @@ void whatsys(void);
* go.c
*/
void deadcode(void);
-char* gotypefor(char *name);
+vlong gotypefor(char *name);
void ldpkg(Biobuf *f, int64 len, char *filename);
diff --git a/src/cmd/8l/span.c b/src/cmd/8l/span.c
index 50b5bc0f8b..a14335b702 100644
--- a/src/cmd/8l/span.c
+++ b/src/cmd/8l/span.c
@@ -146,9 +146,9 @@ xdefine(char *p, int t, int32 v)
}
void
-putsymb(char *s, int t, int32 v, int ver, char *go)
+putsymb(char *s, int t, int32 v, int ver, vlong go)
{
- int i, j, f;
+ int i, f;
if(t == 'f')
s++;
@@ -172,14 +172,9 @@ putsymb(char *s, int t, int32 v, int ver, char *go)
cput(s[i]);
cput(0);
}
- j = 0;
- if(go) {
- for(j=0; go[j]; j++)
- cput(go[j]);
- }
- cput(0);
+ lput(go);
- symsize += 4 + 1 + i + 1 + j + 1;
+ symsize += 4 + 1 + i + 1 + 4;
if(debug['n']) {
if(t == 'z' || t == 'Z') {
@@ -208,7 +203,7 @@ asmsym(void)
s = lookup("etext", 0);
if(s->type == STEXT)
- putsymb(s->name, 'T', s->value, s->version, nil);
+ putsymb(s->name, 'T', s->value, s->version, 0);
for(h=0; h<NHASH; h++)
for(s=hash[h]; s!=S; s=s->link)
@@ -226,7 +221,7 @@ asmsym(void)
continue;
case SFILE:
- putsymb(s->name, 'f', s->value, s->version, nil);
+ putsymb(s->name, 'f', s->value, s->version, 0);
continue;
}
@@ -238,22 +233,22 @@ asmsym(void)
/* filenames first */
for(a=p->to.autom; a; a=a->link)
if(a->type == D_FILE)
- putsymb(a->asym->name, 'z', a->aoffset, 0, nil);
+ putsymb(a->asym->name, 'z', a->aoffset, 0, 0);
else
if(a->type == D_FILE1)
- putsymb(a->asym->name, 'Z', a->aoffset, 0, nil);
+ putsymb(a->asym->name, 'Z', a->aoffset, 0, 0);
putsymb(s->name, 'T', s->value, s->version, gotypefor(s->name));
/* frame, auto and param after */
- putsymb(".frame", 'm', p->to.offset+4, 0, nil);
+ putsymb(".frame", 'm', p->to.offset+4, 0, 0);
for(a=p->to.autom; a; a=a->link)
if(a->type == D_AUTO)
- putsymb(a->asym->name, 'a', -a->aoffset, 0, nil);
+ putsymb(a->asym->name, 'a', -a->aoffset, 0, 0);
else
if(a->type == D_PARAM)
- putsymb(a->asym->name, 'p', a->aoffset, 0, nil);
+ putsymb(a->asym->name, 'p', a->aoffset, 0, 0);
}
if(debug['v'] || debug['n'])
Bprint(&bso, "symsize = %lud\n", symsize);
diff --git a/src/cmd/ld/go.c b/src/cmd/ld/go.c
index 5a55384708..fef39c891d 100644
--- a/src/cmd/ld/go.c
+++ b/src/cmd/ld/go.c
@@ -62,9 +62,10 @@ ilookup(char *name)
return x;
}
-char*
+vlong
gotypefor(char *name)
{
+/*
Import *x;
char *s, *p;
@@ -81,6 +82,8 @@ gotypefor(char *name)
if(strcmp(x->prefix, "var") != 0 && strcmp(x->prefix, "func") != 0)
return nil;
return x->def;
+*/
+ return 0;
}
static void loadpkgdata(char*, char*, int);
diff --git a/src/cmd/nm/nm.c b/src/cmd/nm/nm.c
index 66748eef7c..57e6636a32 100644
--- a/src/cmd/nm/nm.c
+++ b/src/cmd/nm/nm.c
@@ -326,8 +326,8 @@ printsyms(Sym **symptr, long nsym)
else
Bprint(&bout, "%*s ", wid, "");
Bprint(&bout, "%c %s", s->type, cp);
- if(tflag && s->gotype && s->gotype[0])
- Bprint(&bout, " %s", s->gotype);
+ if(tflag && s->gotype)
+ Bprint(&bout, " %*llux", wid, s->gotype);
Bprint(&bout, "\n");
}
}