cmd/ld: don't allocate unused garbage space in pclntab file table

Fixes #6319.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13539043
This commit is contained in:
Ian Lance Taylor 2013-09-04 13:26:49 -07:00
parent 97d6a1e130
commit d011f0aa89
2 changed files with 6 additions and 1 deletions

View file

@ -376,6 +376,12 @@ symgrow(Sym *s, int32 siz)
if(s->np >= siz)
return;
if(s->np > s->maxp) {
cursym = s;
diag("corrupt symbol data: np=%lld > maxp=%lld", (vlong)s->np, (vlong)s->maxp);
errorexit();
}
if(s->maxp < siz) {
if(s->maxp == 0)
s->maxp = 8;

View file

@ -2348,7 +2348,6 @@ ftabaddstring(Sym *ftab, char *s)
start = ftab->np;
symgrow(ftab, start+n+1);
strcpy((char*)ftab->p + start, s);
ftab->np += n+1;
return start;
}