Commit f0ab1464 authored by Russ Cox's avatar Russ Cox

ld: preserve symbol sizes during data layout

Fixes the broken linux/amd64 build.
The symbol table, itself a symbol, was having
its size rounded up to the nearest word boundary.
If the rounding add >7 zero bytes then it confused
the debug/gosym symbol table parser.  So you've
got a 1/8 chance to hit the bug on an amd64 system.

Just started in the recent change because I fixed
the rounding to round to word boundary instead
of to 4-byte boundary.

R=r
CC=golang-dev
https://golang.org/cl/4241056
parent ad102e14
...@@ -788,7 +788,6 @@ dodata(void) ...@@ -788,7 +788,6 @@ dodata(void)
for(; s != nil && s->type < SDATA; s = s->next) { for(; s != nil && s->type < SDATA; s = s->next) {
s->type = SRODATA; s->type = SRODATA;
t = rnd(s->size, PtrSize); t = rnd(s->size, PtrSize);
s->size = t;
s->value = datsize; s->value = datsize;
datsize += t; datsize += t;
} }
...@@ -835,7 +834,6 @@ dodata(void) ...@@ -835,7 +834,6 @@ dodata(void)
datsize = rnd(datsize, 4); datsize = rnd(datsize, 4);
else else
datsize = rnd(datsize, 8); datsize = rnd(datsize, 8);
s->size = t;
s->value = datsize; s->value = datsize;
datsize += t; datsize += t;
} }
......
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