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:
parent
88bbf4f1df
commit
cf3323f511
@ -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)",
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user