Skip to content

Commit a26c01a

Browse files
committed
cmd/cc: emit gc bitmaps in read-only memory
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
1 parent b8851ad commit a26c01a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Diff for: src/cmd/cc/pgen.c

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ makefuncdatasym(char *namefmt, int64 funcdatakind)
5151
nod.sym = sym;
5252
nod.class = CSTATIC;
5353
gins(AFUNCDATA, nodconst(funcdatakind), &nod);
54+
linksym(sym)->type = SRODATA;
5455
return sym;
5556
}
5657

Diff for: src/cmd/ld/symtab.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ symtab(void)
425425
s->hide = 1;
426426
s->outer = symgofunc;
427427
}
428-
if(strstr(s->name, ".gcargs·") != nil || strstr(s->name, ".gclocals·") != nil || strncmp(s->name, "gcargs·", 8) == 0 || strncmp(s->name, "gclocals·", 10) == 0) {
428+
if(strncmp(s->name, "gcargs.", 7) == 0 || strncmp(s->name, "gclocals.", 9) == 0 || strncmp(s->name, "gclocals·", 10) == 0) {
429429
s->type = SGOFUNC;
430430
s->hide = 1;
431431
s->outer = symgofunc;

0 commit comments

Comments
 (0)