aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/ld
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2013-07-19 16:04:09 -0400
committerRuss Cox <rsc@golang.org>2013-07-19 16:04:09 -0400
commit48769bf546ba7ad830c2edc05656e217d15a20c8 (patch)
treee3110fce615f1250f56a7c68d69ade5ad3ff3bbb /src/cmd/ld
parent5d340de1f682d3b2cf10b2319c25ef3799e84078 (diff)
downloadgo-48769bf546ba7ad830c2edc05656e217d15a20c8.tar.xz
runtime: use funcdata to supply garbage collection information
This CL introduces a FUNCDATA number for runtime-specific garbage collection metadata, changes the C and Go compilers to emit that metadata, and changes the runtime to expect it. The old pseudo-instructions that carried this information are gone, as is the linker code to process them. R=golang-dev, dvyukov, cshapiro CC=golang-dev https://golang.org/cl/11406044
Diffstat (limited to 'src/cmd/ld')
-rw-r--r--src/cmd/ld/lib.c31
1 files changed, 7 insertions, 24 deletions
diff --git a/src/cmd/ld/lib.c b/src/cmd/ld/lib.c
index feb84736df..6a299e7f9a 100644
--- a/src/cmd/ld/lib.c
+++ b/src/cmd/ld/lib.c
@@ -2354,7 +2354,7 @@ void
pclntab(void)
{
Prog *p;
- int32 i, n, nfunc, start, funcstart, nameoff;
+ int32 i, n, nfunc, start, funcstart;
uint32 *havepc, *havefunc;
Sym *ftab, *s;
int32 npcdata, nfuncdata, off, end;
@@ -2409,9 +2409,7 @@ pclntab(void)
off = setaddr(ftab, off, cursym);
// name int32
- // Filled in below, after we emit the ptrs.
- nameoff = off;
- off += 4;
+ off = setuint32(ftab, off, ftabaddstring(ftab, cursym->name));
// args int32
// TODO: Move into funcinfo.
@@ -2420,9 +2418,8 @@ pclntab(void)
else
off = setuint32(ftab, off, cursym->args);
- // locals int32
- // TODO: Move into funcinfo.
- off = setuint32(ftab, off, cursym->locals);
+ // Dead space. TODO: Delete (and update all parsers).
+ off = setuint32(ftab, off, 0);
// frame int32
// TODO: Remove entirely. The pcsp table is more precise.
@@ -2435,23 +2432,9 @@ pclntab(void)
else
off = setuint32(ftab, off, (uint32)cursym->text->to.offset+PtrSize);
- // TODO: Move into funcinfo.
- // ptrsoff, ptrslen int32
- start = ftab->np;
- if(start&3) {
- diag("bad math in functab: ptrs misaligned");
- errorexit();
- }
- ftab->size = ftab->np; // for adduint32
- for(i = 0; i < cursym->nptrs; i += 32)
- adduint32(ftab, cursym->ptrs[i/32]);
- off = setuint32(ftab, off, start);
- off = setuint32(ftab, off, i/32);
-
- // Now that ptrs are emitted, can fill in function name.
- // The string is appended to ftab; we waited until now
- // to avoid misaligning the ptrs data.
- setuint32(ftab, nameoff, ftabaddstring(ftab, cursym->name));
+ // Dead space. TODO: Delete (and update all parsers).
+ off = setuint32(ftab, off, 0);
+ off = setuint32(ftab, off, 0);
// pcsp table (offset int32)
off = addpctab(ftab, off, cursym, "pctospadj", pctospadj, 0);