cmd/ld: fix symbol table sorting
runtime: double-check that symbol table is sorted

If the symbol table is unsorted, the binary search in findfunc
will not find its func, which will make stack traces stop early.
When the garbage collector starts using the stack tracer,
that would be a serious problem.

The unsorted symbol addresses came from from two things:

1. The symbols in an ELF object are not necessarily sorted,
   so sort them before adding them to the symbol list.

2. The __i686.get_pc_thunk.bx symbol is present in multiple
   object files and was having its address adjusted multiple
   times, producing an incorrect address in the symbol table.

R=golang-dev, iant
CC=golang-dev
https://codereview.appspot.com/7440044
runtime/cgo: make symbol naming consistent

The naming in this package is a disaster.
Make it all consistent.

Remove some 'static' from functions that will
be referred to from other files soon.

This CL is purely renames using global search and replace.

Submitting separately so that real changes will not
be drowned out by these renames in future CLs.

TBR=iant
CC=golang-dev
https://codereview.appspot.com/7416046
encoding/gob: fix copyright

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/7423046
doc: correct some minor HTML errors found by tidy

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/7439046
runtime/cgo: move common symbol overrides into 6c-compiled code

There are some function pointers declared by 6c in
package runtime without initialization and then also
declared in package runtime/cgo with initialization,
so that if runtime/cgo is linked in, the function pointers
are non-nil, and otherwise they are nil. We depend on
this property for implementing non-essential cgo hooks
in package runtime.

The declarations in package runtime are 6c-compiled
and end up in .6 files. The declarations in package runtime/cgo
are gcc-compiled and end up in .o files. Since 6l links the .6
and .o files together, this all works.

However, when we switch to "external linking" mode,
6l will not see the .o files, and it would be up to the host linker
to resolve the two into a single initialized symbol.
Not all host linkers will do this (in particular OS X gcc will not).

To fix this, move the cgo declarations into 6c-compiled code,
so that they end up in .6 files, so that 6l gets them no matter what.

R=golang-dev
CC=golang-dev
https://codereview.appspot.com/7440045
os: Plan 9: allocate space for a string in Rename

The Name field of the stat structure is variable length
and the marshalling code in package syscall requires
a buf long enough to contain the Name as well as the
static data. This change makes sure that the buffer in
os.Rename is allocated with the appropriate length.

R=rsc, rminnich, ality, r
CC=golang-dev
https://codereview.appspot.com/7453044

Committer: Rob Pike <r@golang.org>
runtime: add matrix multiplication benchmark

R=golang-dev, r
CC=golang-dev
https://codereview.appspot.com/7431047
runtime: refactor Syscall benchmark
And add a benchmark where #goroutines>GOMAXPROCS,
because it's the most interesting case.
Current results on darwin/amd64, Intel Core 2 Duo 2.13 GHz, 2 cores:
BenchmarkSyscall	100000000	        56.0 ns/op
BenchmarkSyscall-2	50000000	        57.2 ns/op
BenchmarkSyscallWork	10000000	       635 ns/op
BenchmarkSyscallWork-2	10000000	       315 ns/op
BenchmarkSyscallExcess	 1000000	      2698 ns/op
BenchmarkSyscallExcess-2	 5000000	      1192 ns/op
BenchmarkSyscallExcessWork	 1000000	      2832 ns/op
BenchmarkSyscallExcessWork-2	 2000000	      1966 ns/op

R=golang-dev, r
CC=golang-dev
https://codereview.appspot.com/7415044
go/types: fix type-checking of shift expressions

Completely rethought shift expression type checking.
Instead of attempting to type-check them eagerly, now
delay the checking of untyped constant lhs in non-
constant shifts until the final expression type
becomes clear. Once it is clear, update the respective
expression tree with the final (not untyped) type and
check respective shift lhs' where necessary.

This also cleans up another conundrum: How to report
the type of untyped constants as it changes from
untyped to typed. Now, Context.Expr is only called
for an expresion x once x has received its final
(not untyped) type (for constant initializers, the
final type may still be untyped).

With this CL all remaining std lib packages that
did not typecheck due to shift errors pass now.

TODO: There's a lot of residual stuff that needs
to be cleaned up but with this CL all tests pass
now.

R=adonovan, axwalk
CC=golang-dev
https://codereview.appspot.com/7381052
doc/articles/image_package.html: fix x/y mistake
Fixes issue 4942.

R=golang-dev, adg
CC=golang-dev
https://codereview.appspot.com/7444047
net/http/cookiejar: move cookiejar from exp/cookiejar to
net/http/cookiejar.

This is a straight rename. There are no code changes.

Fixes issue 1960.

R=rsc, adg
CC=dr.volker.dobler, golang-dev
https://codereview.appspot.com/7436043
doc: fix root.html styles

R=r
CC=golang-dev
https://codereview.appspot.com/7442045
doc/effective_go.html: minor updates, part 1

R=golang-dev, adg
CC=golang-dev
https://codereview.appspot.com/7454044
net/http: document net/http/cookiejar on CookieJar

R=golang-dev, nigeltao, adg
CC=golang-dev
https://codereview.appspot.com/7444048
net/http: don't special-case multipart/byteranges responses

Fixes issue 4767

R=golang-dev, adg
CC=golang-dev
https://codereview.appspot.com/7435046
go/types: fix regression in type checking of RangeStmt.

Now that untyped expressions are done in two phases, the
identity of operand.expr is used as a map key; when reusing
operand values we now must be careful to update the
expr field.

R=gri
CC=golang-dev
https://codereview.appspot.com/7444049
run.bat: disable race detector test

R=golang-dev, dave
CC=golang-dev
https://codereview.appspot.com/7439048
libmach: many pe handling fixes

- implement windows pread;
- set correct Fhdr.type;
- add ImageBase to all pe "virtual" addresses;
- correct settext parameter order;
- use pclntab/epclntab to find line numbers.

Fixes issue 4841.
Fixes issue 4926.

R=golang-dev, rsc
CC=golang-dev
https://codereview.appspot.com/7405050
path/filepath: better error reporting during TestWinSplitListTestsAreValid

Fixes issue 4930.

R=golang-dev, minux.ma
CC=golang-dev
https://codereview.appspot.com/7424043
html/template: fix doc typo

Fixes issue 4950.

R=golang-dev, peter
CC=golang-dev
https://codereview.appspot.com/7415046