Currently they are scanned conservatively.
But there is no reason to scan them. C world must not contain
pointers into Go heap. Moreover, we don't have enough information
to emit write barriers nor update pointers there in future.
The immediate need is that it breaks the new GC because
these are weird symbols as if with pointers but not necessary
pointer aligned.
LGTM=rsc
R=golang-codereviews, rlh, rsc
CC=golang-codereviews, iant, khr
https://golang.org/cl/
117000043
s->type = SRODATA;
break;
case ElfSectFlagAlloc + ElfSectFlagWrite:
- s->type = SDATA;
+ s->type = SNOPTRDATA;
break;
case ElfSectFlagAlloc + ElfSectFlagExec:
s->type = STEXT;
if(s->size < sym.size)
s->size = sym.size;
if(s->type == 0 || s->type == SXREF)
- s->type = SBSS;
+ s->type = SNOPTRBSS;
continue;
}
if(sym.shndx >= obj->nsect || sym.shndx == 0)
s->type = SRODATA;
} else {
if (strcmp(sect->name, "__bss") == 0) {
- s->type = SBSS;
+ s->type = SNOPTRBSS;
s->np = 0;
} else
- s->type = SDATA;
+ s->type = SNOPTRDATA;
}
sect->sym = s;
}
s->type = SRODATA;
break;
case IMAGE_SCN_CNT_UNINITIALIZED_DATA|IMAGE_SCN_MEM_READ|IMAGE_SCN_MEM_WRITE: //.bss
- s->type = SBSS;
+ s->type = SNOPTRBSS;
break;
case IMAGE_SCN_CNT_INITIALIZED_DATA|IMAGE_SCN_MEM_READ|IMAGE_SCN_MEM_WRITE: //.data
- s->type = SDATA;
+ s->type = SNOPTRDATA;
break;
case IMAGE_SCN_CNT_CODE|IMAGE_SCN_MEM_EXECUTE|IMAGE_SCN_MEM_READ: //.text
s->type = STEXT;
if(s->type == SDYNIMPORT)
s->plt = -2; // flag for dynimport in PE object files.
if (s->type == SXREF && sym->value > 0) {// global data
- s->type = SDATA;
+ s->type = SNOPTRDATA;
s->size = sym->value;
}
continue;