diff options
| author | Anthony Martin <ality@pbrane.org> | 2011-04-23 10:53:49 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2011-04-23 10:53:49 -0400 |
| commit | c7008f47eca9fe29e85d522fa78731645390948d (patch) | |
| tree | 347b68495282de0919476cea8d250690bb8d3af2 /src/cmd/ld | |
| parent | 4f7fd3cb7ff2f395668319d0f00792abb365a056 (diff) | |
| download | go-c7008f47eca9fe29e85d522fa78731645390948d.tar.xz | |
ld: fix Plan 9 symbol table
Static symbols were not being marked as such.
I also made the 'z' symbols use the first byte of
the name instead of an explicit NUL so that if
the symbol table format is ever changed, the only
place that would need updating is addhist().
R=rsc
CC=golang-dev
https://golang.org/cl/4366047
Diffstat (limited to 'src/cmd/ld')
| -rw-r--r-- | src/cmd/ld/symtab.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/cmd/ld/symtab.c b/src/cmd/ld/symtab.c index aefe0b1af0..da698fcc07 100644 --- a/src/cmd/ld/symtab.c +++ b/src/cmd/ld/symtab.c @@ -140,29 +140,25 @@ void putplan9sym(Sym *x, char *s, int t, vlong addr, vlong size, int ver, Sym *go) { int i; - + switch(t) { case 'T': - case 't': case 'L': - case 'l': case 'D': - case 'd': case 'B': - case 'b': + if(ver) + t += 'a' - 'A'; case 'a': case 'p': - case 'f': case 'z': case 'Z': - case 'm': lputb(addr); cput(t+0x80); /* 0x80 is variable length */ - + if(t == 'z' || t == 'Z') { - cput(0); + cput(s[0]); for(i=1; s[i] != 0 || s[i+1] != 0; i += 2) { cput(s[i]); cput(s[i+1]); @@ -172,19 +168,17 @@ putplan9sym(Sym *x, char *s, int t, vlong addr, vlong size, int ver, Sym *go) i++; } else { /* skip the '<' in filenames */ - if(t=='f') + if(t == 'f') s++; - for(i=0; s[i]; i++) cput(s[i]); cput(0); } - symsize += 4 + 1 + i + 1; break; default: return; - }; + }; } void |
