]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cc: emit gc bitmaps in read-only memory
authorRuss Cox <rsc@golang.org>
Thu, 3 Apr 2014 23:04:15 +0000 (19:04 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 3 Apr 2014 23:04:15 +0000 (19:04 -0400)
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

src/cmd/cc/pgen.c
src/cmd/ld/symtab.c

index d3fc4193e017ed9f28f17602c1f3c1d6d943f39e..10bebc196d193e77278606574e505b01c6fb019c 100644 (file)
@@ -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;
 }
 
index 1d55119935f909ba3ad99be3f0b252a008c91e44..6d321c0bb94ed046560ba095c14bc524c937c02d 100644 (file)
@@ -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;