Commit cf3323f5 authored by Mikkel Krautz's avatar Mikkel Krautz Committed by Russ Cox

ld: fix Mach-O bss bug

Fixes #1559.

R=rsc
CC=golang-dev, peterGo, rog
https://golang.org/cl/4356046
parent 88bbf4f1
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment