Skip to content

Commit

Permalink
cmd/cc: emit gc bitmaps in read-only memory
Browse files Browse the repository at this point in the history
Cuts hello world by 70kB, because we don't write
those names into the symbol table.

Update #6853

LGTM=khr
R=khr
CC=golang-codereviews
https://golang.org/cl/80370045
  • Loading branch information
rsc committed Apr 3, 2014
1 parent b8851ad commit a26c01a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/cmd/cc/pgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ makefuncdatasym(char *namefmt, int64 funcdatakind)
nod.sym = sym;
nod.class = CSTATIC;
gins(AFUNCDATA, nodconst(funcdatakind), &nod);
linksym(sym)->type = SRODATA;
return sym;
}

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ld/symtab.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ symtab(void)
s->hide = 1;
s->outer = symgofunc;
}
if(strstr(s->name, ".gcargs·") != nil || strstr(s->name, ".gclocals·") != nil || strncmp(s->name, "gcargs·", 8) == 0 || strncmp(s->name, "gclocals·", 10) == 0) {
if(strncmp(s->name, "gcargs.", 7) == 0 || strncmp(s->name, "gclocals.", 9) == 0 || strncmp(s->name, "gclocals·", 10) == 0) {
s->type = SGOFUNC;
s->hide = 1;
s->outer = symgofunc;
Expand Down

0 comments on commit a26c01a

Please sign in to comment.