summaryrefslogtreecommitdiff
path: root/src/cmd/6l
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-09-14 11:13:04 -0400
committerRuss Cox <rsc@golang.org>2010-09-14 11:13:04 -0400
commita3326d8358094ecaa6edff09eee1b0edc87f206d (patch)
tree2568fb06968e2da76436d44b98ddd010cd8ca4cb /src/cmd/6l
parent707bd1d2184f955d4bd8304e111099e11832db13 (diff)
downloadgo-a3326d8358094ecaa6edff09eee1b0edc87f206d.tar.gz
6l, 8l: make etext accurate; introduce rodata, erodata.
Makes binaries work with 6cov again. R=ken2 CC=golang-dev http://codereview.appspot.com/2192041
Diffstat (limited to 'src/cmd/6l')
-rw-r--r--src/cmd/6l/span.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cmd/6l/span.c b/src/cmd/6l/span.c
index 2da3656f1..f18398a23 100644
--- a/src/cmd/6l/span.c
+++ b/src/cmd/6l/span.c
@@ -45,6 +45,9 @@ span(void)
Sym *s;
xdefine("etext", STEXT, 0L);
+ xdefine("rodata", SRODATA, 0L);
+ xdefine("erodata", SRODATA, 0L);
+
idat = INITDAT;
for(p = firstp; p != P; p = p->link) {
if(p->as == ATEXT)
@@ -122,11 +125,13 @@ loop:
textsize = c;
goto loop;
}
+ xdefine("etext", STEXT, c);
/*
* allocate read-only data to the text segment.
*/
c = rnd(c, 8);
+ xdefine("rodata", SRODATA, c);
for(i=0; i<NHASH; i++)
for(s = hash[i]; s != S; s = s->link) {
if(s->type != SRODATA)
@@ -137,6 +142,7 @@ loop:
s->value = c;
c += v;
}
+ xdefine("erodata", SRODATA, c);
if(INITRND) {
INITDAT = rnd(c, INITRND);
@@ -146,7 +152,6 @@ loop:
}
}
- xdefine("etext", STEXT, c);
if(debug['v'])
Bprint(&bso, "etext = %llux\n", c);
Bflush(&bso);