summaryrefslogtreecommitdiff
path: root/src/cmd/8l/pass.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-10-03 10:37:12 -0700
committerRuss Cox <rsc@golang.org>2009-10-03 10:37:12 -0700
commit1bb8f19f5e9016a9eb118b8aba2b5689b4505812 (patch)
tree7b69b0974f4999bac76d11abed2071a2dc9e97aa /src/cmd/8l/pass.c
parent6b7539d607f26a1b1cd3eda71fc123ad4d52a133 (diff)
downloadgolang-1bb8f19f5e9016a9eb118b8aba2b5689b4505812.tar.gz
8c, 8l dynamic loading support.
better mach binaries. cgo working on darwin+linux amd64+386. eliminated context switches - pi is 30x faster. add libcgo to build. on snow leopard: - non-cgo binaries work; all tests pass. - cgo binaries work on amd64 but not 386. R=r DELTA=2031 (1316 added, 626 deleted, 89 changed) OCL=35264 CL=35304
Diffstat (limited to 'src/cmd/8l/pass.c')
-rw-r--r--src/cmd/8l/pass.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/cmd/8l/pass.c b/src/cmd/8l/pass.c
index 7ce419e8f..c624f750a 100644
--- a/src/cmd/8l/pass.c
+++ b/src/cmd/8l/pass.c
@@ -125,6 +125,11 @@ dodata(void)
datsize += u;
}
+ if(dynptrsize > 0) {
+ /* dynamic pointer section between data and bss */
+ datsize = rnd(datsize, 4);
+ }
+
/* now the bss */
bsssize = 0;
for(i=0; i<NHASH; i++)
@@ -135,12 +140,13 @@ dodata(void)
continue;
t = s->value;
s->size = t;
- s->value = bsssize + datsize;
+ s->value = bsssize + dynptrsize + datsize;
bsssize += t;
}
+
xdefine("data", SBSS, 0);
xdefine("edata", SBSS, datsize);
- xdefine("end", SBSS, bsssize + datsize);
+ xdefine("end", SBSS, dynptrsize + bsssize + datsize);
}
Prog*
@@ -570,7 +576,7 @@ dostkoff(void)
p = appendp(p); // load g into CX
p->as = AMOVL;
p->from.type = D_INDIR+D_GS;
- p->from.offset = 0;
+ p->from.offset = tlsoffset + 0;
p->to.type = D_CX;
if(debug['K']) {