Skip to content

Commit 2541cc8

Browse files
committed
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
1 parent 475e7d0 commit 2541cc8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -409,5 +409,10 @@ symtab(void)
409409
s->hide = 1;
410410
s->outer = symgofunc;
411411
}
412+
if(strstr(s->name, ".gcargs·") != nil || strstr(s->name, ".gclocals·") != nil || strncmp(s->name, "gcargs·", 8) == 0 || strncmp(s->name, "gclocals·", 10) == 0) {
413+
s->type = SGOFUNC;
414+
s->hide = 1;
415+
s->outer = symgofunc;
416+
}
412417
}
413418
}

0 commit comments

Comments
 (0)