Sub-symbols are laid out inside a larger symbol
but can be addressed directly.
Use to make Mach-O pointer array not a special case.
Will use later to describe ELF sections.
Glimpses of the beginning of ELF loading.
R=ken2
CC=golang-dev
https://golang.org/cl/2623043
The implemetation describes each value as a string identifying the
concrete type of the value, followed by the usual encoding of that
value. All types to be exchanged as contents of interface values
must be registered ahead of time with the new Register function.
Although this would not seem strictly necessary, the linker garbage
collects unused types so without some mechanism to guarantee
the type exists in the binary, there could be unpleasant surprises.
Moreover, the receiver needs a reflect.Type of the value to be
written in order to be able to save the data. A Register function
seems necessary.
The implementation may require defining types in the middle of
of sending a value. The old code never did this. Therefore there
has been some refactoring to make the encoder and decoder
work recursively.
This change changes the internal type IDs. Existing gob archives
will break with this change. Apologies for that. If this is a deal
breaker it should be possible to create a conversion tool.
Error handling is too complicated in this code. A subsequent
change should clean it up.
R=rsc
CC=golang-dev
https://golang.org/cl/2618042
For elements which are themselves composite literals, the type may
be omitted if it is identical to the element type of the containing
composite literal.
R=r, rsc, iant, ken2
CC=golang-dev
https://golang.org/cl/2661041
Load the entire archive file instead.
Reduces I/O by avoiding additional passes
through libraries to resolve symbols.
Go packages always need all the files anyway
(most often, all 1 of them).
R=ken2
CC=golang-dev
https://golang.org/cl/2613042
Giving them specific types has the benefit that
binary.BigEndian.Uint32(b) is now a direct call, not an
indirect via a mutable interface value, so it can potentially
be inlined.
Recent changes to the spec relaxed the rules for comparison,
so this code is still valid:
func isLittle(o binary.ByteOrder) { return o == binary.LittleEndian }
The change does break this potential idiom:
o := binary.BigEndian
if foo {
o = binary.LittleEndian
}
That must rewrite to give o an explicit binary.ByteOrder type.
On balance I think the benefit from the direct call and inlining
outweigh the cost of breaking that idiom.
R=r, r2
CC=golang-dev
https://golang.org/cl/2427042
Just enough to make mov instructions work,
which in turn is enough to make strconv work
when it avoids any floating point calculations.
That makes a bunch of other packages pass
their tests.
Should suffice until hardware floating point
is available.
Enable package tests that now pass
(some due to earlier fixes).
Looks like there is a new integer math bug
exposed in the fmt and json tests.
R=ken2
CC=golang-dev
https://golang.org/cl/2638041
The frame that gets allocated is for both
the args and the autos. If together they
exceed the default frame size, we need to
tell morestack about both so that it allocates
a large enough frame.
Sanity check stack pointer in morestack
to catch similar bugs.
R=ken2
CC=golang-dev
https://golang.org/cl/2609041
value (through unsafe means) without having a reflect.Type
of type *interface{} (pointer to interface). This is needed to make
gob able to handle interface values by a method analogous to
the way it handles maps.
R=rsc
CC=golang-dev
https://golang.org/cl/2597041
That is, move the pc/ln table and the symbol table
into the read-only data segment. This eliminates
the need for a special load command to map the
symbol table into memory, which makes the
information available on systems that couldn't handle
the magic load to 0x99000000, like NaCl and ARM QEMU
and Linux without config_highmem=y. It also
eliminates an #ifdef and some clumsy code to
find the symbol table on Windows.
The bad news is that the binary appears to be bigger
than it used to be. This is not actually the case, though:
the same amount of data is being mapped into memory
as before, and the tables are still read-only, so they're
still shared across multiple instances of the binary as
they were before. The difference is just that the tables
aren't squirreled away in some section that "size" doesn't
know to look at.
This is a checkpoint.
It probably breaks Windows and breaks NaCl more
than it used to be broken, but those will be fixed.
The logic involving -s needs to be revisited too.
Fixes#871.
R=ken2
CC=golang-dev
https://golang.org/cl/2587041