Commit 2c52881a authored by Russ Cox's avatar Russ Cox

fix ELF bugs found by iant

	- .text begins at INITTEXT, not 0
	   and does not include HEADR
	- .shstrtab, .gosymtab, .gopclntab have alignment 1
	- .gosymtab, .gopclntab have type SHT_PROGBITS

R=r
DELTA=9  (0 added, 0 deleted, 9 changed)
OCL=15953
CL=15956
parent a0e79372
......@@ -452,7 +452,7 @@ asmb(void)
INITRND); /* alignment */
linuxphdr(0x6474e551, /* gok - type = gok */
1L+2L+4L, /* gok - flags = PF_X+PF_R */
1L+2L+4L, /* gok - flags = PF_X+PF_W+PF_R */
0, /* file offset */
0, /* vaddr */
0, /* paddr */
......@@ -472,9 +472,9 @@ asmb(void)
0); /* entsize */
stroffset = 1; /* 0 means no name, so start at 1 */
fo = 0;
va = INITRND;
w = HEADR+textsize;
fo = HEADR;
va = (INITTEXT & ~((vlong)INITRND - 1)) + HEADR;
w = textsize;
linuxshdr(".text", /* name */
1, /* type */
......@@ -527,7 +527,7 @@ asmb(void)
w, /* size */
0, /* link */
0, /* info */
8, /* align */
1, /* align */
0); /* entsize */
if (debug['s'])
......@@ -537,28 +537,28 @@ asmb(void)
w = symsize;
linuxshdr(".gosymtab", /* name */
7, /* type */
1, /* type 1 = SHT_PROGBITS */
0, /* flags */
0, /* addr */
fo, /* off */
w, /* size */
0, /* link */
0, /* info */
8, /* align */
1, /* align */
24); /* entsize */
fo += w;
w = lcsize;
linuxshdr(".gopclntab", /* name */
7, /* type */
1, /* type 1 = SHT_PROGBITS*/
0, /* flags */
0, /* addr */
fo, /* off */
w, /* size */
0, /* link */
0, /* info */
8, /* align */
1, /* align */
24); /* entsize */
break;
}
......
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