mirror of
https://github.com/golang/go
synced 2024-11-22 04:34:39 -07:00
ld: fix alignment of rodata section on Plan 9
This was causing a panic in the reflect package since type.* pointers with their low bits set are assumed to have certain flags set that disallow the use of reflection. Thanks to Pavel and Taru for help tracking down this bug. R=rsc, paulzhol, taruti CC=golang-dev https://golang.org/cl/4511041
This commit is contained in:
parent
f58d911698
commit
4fca395321
@ -188,7 +188,7 @@ main(int argc, char *argv[])
|
||||
if(INITDAT == -1)
|
||||
INITDAT = 0;
|
||||
if(INITRND == -1)
|
||||
INITRND = 1;
|
||||
INITRND = 4096;
|
||||
break;
|
||||
case Hmsdoscom: /* MS-DOS .COM */
|
||||
HEADR = 0;
|
||||
|
@ -899,10 +899,8 @@ address(void)
|
||||
segdata.fileoff = va - segtext.vaddr + segtext.fileoff;
|
||||
if(HEADTYPE == Hwindows)
|
||||
segdata.fileoff = segtext.fileoff + rnd(segtext.len, PEFILEALIGN);
|
||||
if(HEADTYPE == Hplan9x32) {
|
||||
segdata.vaddr = va = rnd(va, 4096);
|
||||
if(HEADTYPE == Hplan9x32)
|
||||
segdata.fileoff = segtext.fileoff + segtext.filelen;
|
||||
}
|
||||
for(s=segdata.sect; s != nil; s=s->next) {
|
||||
s->vaddr = va;
|
||||
va += s->len;
|
||||
|
Loading…
Reference in New Issue
Block a user