Commit 4fca3953 authored by Anthony Martin's avatar Anthony Martin Committed by Russ Cox

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
parent f58d9116
......@@ -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;
......
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