aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/ld/data.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2013-02-26 22:38:14 -0500
committerRuss Cox <rsc@golang.org>2013-02-26 22:38:14 -0500
commitc8dcaeb25deddac52cfca6ae6882ce94780582d3 (patch)
treed12f5b99253e3e8a8f1606afebc8d5908470da88 /src/cmd/ld/data.c
parent15cce227c78ac2b499e9ad3c49ccb67d2f870169 (diff)
downloadgo-c8dcaeb25deddac52cfca6ae6882ce94780582d3.tar.xz
cmd/ld, runtime: adjust symbol table representation
This CL changes the encoding used for the Go symbol table, stored in the binary and used at run time. It does not change any of the semantics or structure: the bits are just packed a little differently. The comment at the top of runtime/symtab.c describes the new format. Compared to the Go 1.0 format, the main changes are: * Store symbol addresses as full-pointer-sized host-endian values. (For 6g, this means addresses are 64-bit little-endian.) * Store other values (frame sizes and so on) varint-encoded. The second change more than compensates for the first: for the godoc binary on OS X/amd64, the new symbol table is 8% smaller than the old symbol table (1,425,668 down from 1,546,276). This is a required step for allowing the host linker (gcc) to write the final Go binary, since it will have to fill in the symbol address slots (so the slots must be host-endian) and on 64-bit systems it may choose addresses above 4 GB. R=golang-dev, iant CC=golang-dev https://golang.org/cl/7403054
Diffstat (limited to 'src/cmd/ld/data.c')
-rw-r--r--src/cmd/ld/data.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/cmd/ld/data.c b/src/cmd/ld/data.c
index 99385fdcc2..e4d16fdc1f 100644
--- a/src/cmd/ld/data.c
+++ b/src/cmd/ld/data.c
@@ -1163,7 +1163,6 @@ dodata(void)
sect->vaddr = 0;
lookup("rodata", 0)->sect = sect;
lookup("erodata", 0)->sect = sect;
- lookup("reloffset", 0)->sect = sect;
datsize = 0;
s = datap;
for(; s != nil && s->type < STYPELINK; s = s->next) {