diff --git a/src/cmd/6l/span.c b/src/cmd/6l/span.c index 2da3656f10..f18398a23a 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; ilink) { 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); diff --git a/src/cmd/8l/span.c b/src/cmd/8l/span.c index 3bc18adb6d..373ab8a9c6 100644 --- a/src/cmd/8l/span.c +++ b/src/cmd/8l/span.c @@ -40,6 +40,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) @@ -107,11 +110,13 @@ start: textsize = c; n++; }while(again); + xdefine("etext", STEXT, c); /* * allocate read-only data to the text segment. */ c = rnd(c, 8); + xdefine("rodata", SRODATA, c); for(i=0; ilink) { if(s->type != SRODATA) @@ -122,6 +127,7 @@ start: s->value = c; c += v; } + xdefine("erodata", SRODATA, c); if(INITRND) { INITDAT = rnd(c+textpad, INITRND); @@ -131,7 +137,6 @@ start: } } - xdefine("etext", STEXT, c); if(debug['v']) Bprint(&bso, "etext = %lux\n", c); Bflush(&bso);