diff options
| author | Russ Cox <rsc@golang.org> | 2014-02-19 10:00:44 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2014-02-19 10:00:44 -0500 |
| commit | 2541cc81978dc5e41e2e2db6345d8ca7a365ca8c (patch) | |
| tree | d3bce989dd9bd9e4b0cb8e28f66d84083fa7a521 /src | |
| parent | 475e7d037299c3187054319f5e984c57524cabef (diff) | |
| download | go-2541cc81978dc5e41e2e2db6345d8ca7a365ca8c.tar.xz | |
cmd/ld: drop gcargs, gclocals symbols from symbol table
Update #6853
Every function now has a gcargs and gclocals symbol
holding associated garbage collection information.
Put them all in the same meta-symbol as the go.func data
and then drop individual entries from symbol table.
Removing gcargs and gclocals reduces the size of a
typical binary by 10%.
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/65870044
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/ld/symtab.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/ld/symtab.c b/src/cmd/ld/symtab.c index bd14d9be7a..c585f96e0f 100644 --- a/src/cmd/ld/symtab.c +++ b/src/cmd/ld/symtab.c @@ -409,5 +409,10 @@ 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) { + s->type = SGOFUNC; + s->hide = 1; + s->outer = symgofunc; + } } } |
