summaryrefslogtreecommitdiff
path: root/src/cmd/8l
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2013-07-16 09:41:38 -0400
committerRuss Cox <rsc@golang.org>2013-07-16 09:41:38 -0400
commitb818f5a120c8165682496735416c5213ce42dd1c (patch)
tree43f486e96d2c0e955f02a7d626e56bee85006199 /src/cmd/8l
parent71e6d3480812be9e8a14af9b6b6b0e154c8dae58 (diff)
downloadgo-b818f5a120c8165682496735416c5213ce42dd1c.tar.gz
cmd/ld, runtime: new in-memory symbol table format
Design at http://golang.org/s/go12symtab. This enables some cleanup of the garbage collector metadata that will be done in future CLs. This CL does not move the old symtab and pclntab back into an unmapped section of the file. That's a bit tricky and will be done separately. Fixes issue 4020. R=golang-dev, dave, cshapiro, iant, r CC=golang-dev, nigeltao https://codereview.appspot.com/11085043
Diffstat (limited to 'src/cmd/8l')
-rw-r--r--src/cmd/8l/8.out.h6
-rw-r--r--src/cmd/8l/l.h4
-rw-r--r--src/cmd/8l/obj.c3
-rw-r--r--src/cmd/8l/optab.c5
4 files changed, 12 insertions, 6 deletions
diff --git a/src/cmd/8l/8.out.h b/src/cmd/8l/8.out.h
index f961a5bc7..fecb0852c 100644
--- a/src/cmd/8l/8.out.h
+++ b/src/cmd/8l/8.out.h
@@ -578,8 +578,12 @@ enum as
APSHUFB,
AUSEFIELD,
- ALOCALS,
ATYPE,
+ AFUNCDATA,
+ APCDATA,
+
+ // TODO: Remove these.
+ ALOCALS,
ANPTRS,
APTRS,
diff --git a/src/cmd/8l/l.h b/src/cmd/8l/l.h
index e67c6bcbd..2cf8c76b1 100644
--- a/src/cmd/8l/l.h
+++ b/src/cmd/8l/l.h
@@ -159,6 +159,7 @@ struct Sym
char* dynimplib;
char* dynimpvers;
struct Section* sect;
+ struct Hist* hist; // for ATEXT
// STEXT
Auto* autom;
@@ -187,7 +188,7 @@ enum
STRINGSZ = 200,
MINLC = 1,
MAXIO = 8192,
- MAXHIST = 20, /* limit of path elements for history symbols */
+ MAXHIST = 40, /* limit of path elements for history symbols */
Yxxx = 0,
Ynone,
@@ -313,7 +314,6 @@ EXTERN Sym* symlist;
EXTERN int32 symsize;
EXTERN Sym* textp;
EXTERN int32 textsize;
-EXTERN int version;
EXTERN Prog zprg;
EXTERN int dtype;
EXTERN int tlsoffset;
diff --git a/src/cmd/8l/obj.c b/src/cmd/8l/obj.c
index 1cc0444c4..55c0e2e1b 100644
--- a/src/cmd/8l/obj.c
+++ b/src/cmd/8l/obj.c
@@ -316,6 +316,7 @@ main(int argc, char *argv[])
span();
addexport();
textaddress();
+ functab();
pclntab();
symtab();
dodata();
@@ -552,6 +553,7 @@ loop:
addhist(p->line, D_FILE); /* 'z' */
if(p->to.offset)
addhist(p->to.offset, D_FILE1); /* 'Z' */
+ savehist(p->line, p->to.offset);
histfrogp = 0;
goto loop;
@@ -695,6 +697,7 @@ loop:
diag("%s: redefinition: %s\n%P", pn, s->name, p);
}
s->type = STEXT;
+ s->hist = gethist();
s->value = pc;
s->args = p->to.offset2;
s->nptrs = -1;
diff --git a/src/cmd/8l/optab.c b/src/cmd/8l/optab.c
index c024c19b3..c08e1524a 100644
--- a/src/cmd/8l/optab.c
+++ b/src/cmd/8l/optab.c
@@ -1001,10 +1001,9 @@ Optab optab[] =
{ APSHUFB, ymshufb,Pq, 0x38, 0x00 },
{ AUSEFIELD, ynop, Px, 0,0 },
- { ALOCALS },
{ ATYPE },
- { ANPTRS },
- { APTRS },
+ { AFUNCDATA, ynop, Px, 0,0 },
+ { APCDATA, ynop, Px, 0,0 },
0
};