Skip to content

Commit

Permalink
cmd/ld: drop gcargs, gclocals symbols from symbol table
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rsc committed Feb 19, 2014
1 parent 475e7d0 commit 2541cc8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cmd/ld/symtab.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

0 comments on commit 2541cc8

Please sign in to comment.