1
0
mirror of https://github.com/golang/go synced 2024-10-02 16:28:34 -06:00
go/src/pkg/runtime/arch_386.h
Russ Cox c8dcaeb25d 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
2013-02-26 22:38:14 -05:00

6 lines
62 B
C

enum {
thechar = '8',
BigEndian = 0,
CacheLineSize = 64
};