1
0
mirror of https://github.com/golang/go synced 2024-11-20 00:34:43 -07:00

ld: fix Mach-O bss bug

Fixes #1559.

R=rsc
CC=golang-dev, peterGo, rog
https://golang.org/cl/4356046
This commit is contained in:
Mikkel Krautz 2011-04-07 13:17:28 -04:00 committed by Russ Cox
parent 88bbf4f1df
commit cf3323f511
2 changed files with 5 additions and 2 deletions

View File

@ -749,7 +749,7 @@ dodata(void)
}
for(s = datap; s != nil; s = s->next) {
if(s->np > 0 && s->type == SBSS) // TODO: necessary?
if(s->np > 0 && s->type == SBSS && s->file != nil) // TODO: necessary?
s->type = SDATA;
if(s->np > s->size)
diag("%s: initialize bounds (%lld < %d)",

View File

@ -581,7 +581,10 @@ ldmacho(Biobuf *f, char *pkg, int64 len, char *pn)
else
s->type = SRODATA;
} else {
s->type = SDATA;
if (strcmp(sect->name, "__bss") == 0)
s->type = SBSS;
else
s->type = SDATA;
}
if(s->type == STEXT) {
if(etextp)