cmd/ld: DWARF opcode base to 10

DWARF 2 has 9 standard opcodes, so dwarfdump expects us to use an
opcode base of at least 10. Previously we used 5.

Discussion:
https://groups.google.com/forum/#!topic/golang-dev/d-BqpPgalzc

LGTM=josharian, rsc
R=golang-codereviews, gobot, rsc, josharian, iant, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/69320043

Committer: Josh Bleecher Snyder <josharian@gmail.com>
net/http: in Client, consume small redirect bodies before making next request

In Go 1.2, closing a request body without reading to EOF
causes the underlying TCP connection to not be reused. This
client code following redirects was never updated when that
happened.

This was part of a previous CL but moved to its own CL at
Josh's request.  Now with test too.

LGTM=josharian
R=josharian
CC=golang-codereviews
https://codereview.appspot.com/70800043
runtime: update CBARGS macro for nacl/amd64p32

CBARGS is unused on amd64p32 so make this explicit.

LGTM=bradfitz
R=rsc, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/70940043
syscall: regenerate z-files on FreeBSD 10

Unfortunately FreeBSD 10 has changed its syscall arguments for
some reasons but as per request at golang-dev this CL does not
generate some structures, syscall numbers and constants as
compatible to FreeBSD 10 as follows:

Structure: Stat_t, IfData, IfMsghdr are based on 8-STABLE
Syscall number: Capsicum API is based on 9-STABLE
Constant: IFT_CARP, SIOCAIFADDR, SIOCSIFPHYADDR are based on 9-STABLE

Update issue 7193

FreeBSD 10 breaking changes:

r205792: Rename st_*timespec fields to st_*tim for POSIX 2008
compliance.
http://svnweb.freebsd.org/base?view=revision&revision=205792

r254804: Restructure the mbuf pkthdr to make it fit for upcoming
capabilities and features.
http://svnweb.freebsd.org/base?view=revision&revision=254804

r255219: Change the cap_rights_t type from uint64_t to a structure
that we can extend in the future in a backward compatible (API and
ABI) way.
http://svnweb.freebsd.org/base?view=revision&revision=255219

LGTM=iant
R=golang-codereviews, rsc, minux.ma, gobot, iant
CC=golang-codereviews
https://codereview.appspot.com/56770044
api: add FreeBSD 10 exceptions

Update issue 7193

LGTM=minux.ma
R=golang-codereviews, rsc, minux.ma, iant
CC=golang-codereviews
https://codereview.appspot.com/57210043
syscall: add support for FreeBSD 10

This CL tweaks syscall.InterfaceMessage to support FreeBSD 10 and
prior to 10.

See http://svnweb.freebsd.org/base?view=revision&revision=254804.

Fixes issue 7193.

LGTM=iant
R=golang-codereviews, rsc, minux.ma, gobot, iant
CC=golang-codereviews
https://codereview.appspot.com/56980043
os: handle file creation with close-on-exec flag correctly on darwin, freebsd

Fixes issue 7187.
Update issue 7193

LGTM=bradfitz
R=golang-codereviews, dave, rsc, minux.ma, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/64510043
syscall: add Accept4 for freebsd

Update issue 7186
Update issue 7428

LGTM=r, bradfitz
R=golang-codereviews, rsc, minux.ma, r, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/68880043
net: enable fast socket creation with close-on-exec flag on freebsd

Also makes variable names explicit.

Fixes issue 7186.

LGTM=iant
R=golang-codereviews, gobot, iant, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/69100043
cmd/gc: fix internal crash

TBR=ken2
CC=golang-codereviews
https://codereview.appspot.com/70200053
math/rand: speed up Float32, Float64

Actually, speed up Int31n and Int63n by avoiding retry loop.

benchmark           old ns/op    new ns/op    delta
BenchmarkFloat32           32           26  -19.45%
BenchmarkFloat64           46           23  -49.47%

Fixes issue 7267.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/69980047
doc: add freebsd items

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/71000043
net/http: fix location of StateHijacked and StateActive

1) Move StateHijacked callback earlier, to make it
panic-proof.  A Hijack followed by a panic didn't previously
result in ConnState getting fired for StateHijacked.  Move it
earlier, to the time of hijack.

2) Don't fire StateActive unless any bytes were read off the
wire while waiting for a request. This means we don't
transition from New or Idle to Active if the client
disconnects or times out. This was documented before, but not
implemented properly.

This CL is required for an pending fix for Issue 7264

LGTM=josharian
R=josharian
CC=golang-codereviews
https://codereview.appspot.com/69860049
spec: clarify what is considered a function call for len/cap special case

gccgo considers built-in function calls returning a constant not as function call (issue 7386)
go/types considers any call (regular or built-in) as a function call

The wording and examples clarify that only "function calls" that are issued
at run-time (and thus do not result in a constant result) are considered
function calls in this case.

gc is inconsistent (issue 7385)
gccgo already interprets the spec accordingly and issue 7386 is moot.
go/types considers all calls (constant or not) as function calls (issue 7457).

Fixes issue 7387.
Fixes issue 7386.

LGTM=r, rsc, iant
R=r, rsc, iant, ken
CC=golang-codereviews
https://codereview.appspot.com/66860046
runtime: fix traceback on Windows

The exception handler runs on the ordinary g stack,
and the stack copier is now trying to do a traceback
across it. That's never been needed before, so it was
unimplemented. Implement it, in all its ugliness.

Fixes windows/amd64 build.

TBR=khr
CC=golang-codereviews
https://codereview.appspot.com/71030043
cmd/gc: use a register to checknil constants.

Fixes issue 7346.

LGTM=rsc
R=rsc, iant, khr
CC=golang-codereviews
https://codereview.appspot.com/69050044
cmd/go: fix data race on buildLdflags
Fixes issue 7438.

LGTM=rsc
R=golang-codereviews
CC=bradfitz, golang-codereviews, iant, rsc
https://codereview.appspot.com/70420044
runtime: fix finalizer flakiness

The flakiness appears to be just in tests, not in the actual code.
Specifically, the many tests call runtime.GC once and expect that
the finalizers will be running in the background when GC returns.
Now that the sweep phase is concurrent with execution, however,
the finalizers will not be run until sweep finishes, which might
be quite a bit later. To force sweep to finish, implement runtime.GC
by calling the actual collection twice. The second will complete the
sweep from the first.

This was reliably broken after a few runs before the CL and now
passes tens of runs:

while GOMAXPROCS=2 ./runtime.test -test.run=Finalizer -test.short \
        -test.timeout=300s -test.cpu=$(perl -e 'print ("1,2,4," x 100) . "1"')
do true; done

Fixes issue 7328.

LGTM=dvyukov
R=dvyukov, dave
CC=golang-codereviews
https://codereview.appspot.com/71080043
A+C: Kelsey Hightower (individual CLA)

Generated by addca.

R=gobot
CC=golang-codereviews
https://codereview.appspot.com/69110045
A+C: Mike Andrews (individual CLA)

Generated by addca.

R=gobot
CC=golang-codereviews
https://codereview.appspot.com/71150043