]> Cypherpunks repositories - gostls13.git/log
gostls13.git
10 years agonet: permit WriteMsgUDP to connected UDP sockets
Nicolas S. Dade [Thu, 5 Feb 2015 02:05:53 +0000 (18:05 -0800)]
net: permit WriteMsgUDP to connected UDP sockets

The sanity checks at the beginning of WriteMsgUDP were too
strict, and did not allow a case sendmsg(2) suppports: sending
to a connected UDP socket.

This fixes the sanity checks. Either the socket is unconnected,
and a destination addresses is required (what all existing callers
must have been doing), or the socket is connected and an explicit
destination address must not be used.

Fixes #9807

Change-Id: I08d4ec3c2bf830335c402acfc0680c841cfcec71
Reviewed-on: https://go-review.googlesource.com/3951
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
10 years agoruntime: simplify and comment some windows code
Alex Brainman [Tue, 13 Jan 2015 23:42:26 +0000 (10:42 +1100)]
runtime: simplify and comment some windows code

Change-Id: I5cedd9e53f4e020aea74d498d0db88d79a95260c
Reviewed-on: https://go-review.googlesource.com/2718
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agonet/http: fix test to check that requests to 'localhost' are not proxied
Rajat Goel [Tue, 10 Feb 2015 01:12:12 +0000 (17:12 -0800)]
net/http: fix test to check that requests to 'localhost' are not proxied

I think the test was meant to test requests to 'localhost:80' instead
of 'localhost:80:80'. It passes even with 'localhost:80:80' because
net.SplitHostPort fails inside useProxy. Please comment if you want to
leave old 'localhost:80' is the list too to check old code path.

Change-Id: Ic4cd21901563449e3d4e2f4c8caf723f4ca15bac
u
Reviewed-on: https://go-review.googlesource.com/4293
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agocmd/go: use current go source code when generating doc.go
Andrew Gerrand [Tue, 10 Feb 2015 02:24:47 +0000 (13:24 +1100)]
cmd/go: use current go source code when generating doc.go

Change-Id: Iad1764707d173a09467fd36e8c49a58147f12219
Reviewed-on: https://go-review.googlesource.com/4320
Reviewed-by: Minux Ma <minux@golang.org>
10 years agoruntime: introduce CPU access functions on windows
Alex Brainman [Wed, 14 Jan 2015 01:25:55 +0000 (12:25 +1100)]
runtime: introduce CPU access functions on windows

This CL introduces new methods for 'context' type, so we can
manipulate its values in an architecture independent way.

Use new methods to replace both 386 and amd64 versions of
dosigprof with single piece of code.

There is more similar code to be converted in the following CLs.

Also remove os_windows_386.go and os_windows_amd64.go. These
contain unused functions.

Change-Id: I28f76aeb97f6e4249843d30d3d0c33fb233d3f7f
Reviewed-on: https://go-review.googlesource.com/2790
Reviewed-by: Minux Ma <minux@golang.org>
10 years agocmd/go: document that -run isn't implemented
Rob Pike [Tue, 10 Feb 2015 00:54:06 +0000 (16:54 -0800)]
cmd/go: document that -run isn't implemented

I am an idiot but the failure to implement this means we can decide
exactly what its design should be for 1.5

Change-Id: Ie2b025fcd899d306ddeddd09d1d0e8f9a99ab7a8
Reviewed-on: https://go-review.googlesource.com/4291
Reviewed-by: Minux Ma <minux@golang.org>
10 years agonet: re-implement Interfaces and InterfaceAddrs for IPNet, IPv6 on Windows
mattn [Mon, 19 Jan 2015 07:56:04 +0000 (16:56 +0900)]
net: re-implement Interfaces and InterfaceAddrs for IPNet, IPv6 on Windows

Fixes #5395

Change-Id: I4322bc8a974d04d9bae6b48c71c5d32d9252973c
Reviewed-on: https://go-review.googlesource.com/3024
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
10 years agocmd/dist: reactivate vfp detection on linux/arm
Dave Cheney [Fri, 6 Feb 2015 00:44:09 +0000 (11:44 +1100)]
cmd/dist: reactivate vfp detection on linux/arm

Fixes #9732
Fixes #9819

Rather than detecting vfp support via catching SIGILL signals,
parse the contents of /proc/cpuinfo.

As the GOARM values for NaCl and freebsd are hard coded, this parsing
logic only needs to support linux/arm.

This change also fixes the nacl/arm build which is broken because the
first stage of nacltest.bash is executed with GOARM=5, embedding that
into 5g.

The second stage of nacltest.bash correctly detects GOARM=7, but this is
ignored as we pass --no-clean at that point, and thus do not replace
the compiler.

Lastyly, include a fix to error message in nacltest.bash

Change-Id: I13f306ff07a99b44b493fade72ac00d0d5097e1c
Reviewed-on: https://go-review.googlesource.com/3981
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agoliblink, runtime: move all references to runtime.tlsg to tls_arm.s
Shenghou Ma [Fri, 6 Feb 2015 07:05:30 +0000 (02:05 -0500)]
liblink, runtime: move all references to runtime.tlsg to tls_arm.s

CL 2118 makes the assumption that all references to runtime.tlsg
should be accompanied by a declaration of runtime.tlsg if its type
should be a normal variable, instead of a placeholder for TLS
relocation.

Because if runtime.tlsg is not declared by the runtime package,
the type of runtime.tlsg will be zero, so fix the check in liblink
to look for 0 instead of STLSBSS (the type will be initialized by
cmd/ld, but cmd/ld doesn't run during assembly).

Change-Id: I691ac5c3faea902f8b9a0b963e781b22e7b269a7
Reviewed-on: https://go-review.googlesource.com/4030
Reviewed-by: David Crawshaw <crawshaw@golang.org>
10 years agomath/big: correct umax
Robert Griesemer [Mon, 9 Feb 2015 19:26:56 +0000 (11:26 -0800)]
math/big: correct umax

Change-Id: I208c8ac44d1a8882d8fdeb18347dc20941e20374
Reviewed-on: https://go-review.googlesource.com/4250
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agocmd/go: stream test output if parallelism is set to 1.
Rahul Chaudhry [Sat, 7 Feb 2015 01:47:54 +0000 (17:47 -0800)]
cmd/go: stream test output if parallelism is set to 1.

"go test -v" buffers output if more than one package is
being tested to avoid mixing the outputs from multiple
tests running in parallel. It currently enables streaming
if there's only a single package under test.

It is ok to stream output from multiple tests if we know
that they're not going to be running in parallel.

To see the difference: go test -v -p=1 runtime fmt -short

Change-Id: Idc24575c899eac30d553e0bf52b86f90e189392d
Reviewed-on: https://go-review.googlesource.com/4153
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agomath/big: API cleanup
Robert Griesemer [Sat, 7 Feb 2015 00:51:00 +0000 (16:51 -0800)]
math/big: API cleanup

- better and more consistent documentation
- more functions implemented
- more tests

Change-Id: If4c591e7af4ec5434fbb411a48dd0f8add993720
Reviewed-on: https://go-review.googlesource.com/4140
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agoos: embed "sleep 1" within the test binary itself.
Rahul Chaudhry [Sun, 8 Feb 2015 15:42:10 +0000 (07:42 -0800)]
os: embed "sleep 1" within the test binary itself.

This is an alternative to http://golang.org/cl/4150,
and is motivated by a review comment on that CL.

testKillProcess() tries to build and run the Go equivalent
for "sleep 1". This doesn't work for testing cross compilers
since the Go compiler is not available on the targets. This
change embeds the "sleep 1" functionality within the "os.test"
binary itself.

Change-Id: I6bad513deaa6c9e2704e70319098eb4983f1bb23
Reviewed-on: https://go-review.googlesource.com/4190
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agonet: don't allocate dialer closure if we won't use it
Dmitry Vyukov [Sun, 8 Feb 2015 16:00:43 +0000 (19:00 +0300)]
net: don't allocate dialer closure if we won't use it

When we use dialMulti we also allocate dialSingle closure for no reason.

Change-Id: I074282a9d6e2c2a1063ab311a1b95e10fe65219f
Reviewed-on: https://go-review.googlesource.com/4119
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agocmd/gc: remove dead code
Dmitry Vyukov [Sun, 8 Feb 2015 16:07:48 +0000 (19:07 +0300)]
cmd/gc: remove dead code

Change-Id: Ib46a42fc873066b1cc00368fe43648f08dce48bd
Reviewed-on: https://go-review.googlesource.com/4200
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agoencoding/xml: add more EncodeToken tests.
Nigel Tao [Mon, 9 Feb 2015 02:42:45 +0000 (13:42 +1100)]
encoding/xml: add more EncodeToken tests.

There are no behavior changes in this CL, only specifying the status
quo. A follow-up CL, https://go-review.googlesource.com/#/c/2660/, will
change the EncodeToken behavior.

Change-Id: I6ecbcfb05ae681de71fa1099d054df2826ed4acb
Reviewed-on: https://go-review.googlesource.com/4167
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agocmd/5g, cmd/6g, cmd/8g, cmd/9g: clear Addr parameter in sudoaddable
Shenghou Ma [Thu, 5 Feb 2015 04:38:45 +0000 (23:38 -0500)]
cmd/5g, cmd/6g, cmd/8g, cmd/9g: clear Addr parameter in sudoaddable

The Addr might be a stack variable with uninitialized fields.

Fixes #9777.

Change-Id: I799786e3d8b2e17e069725bc66a076cf9ca11f93
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/3932
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Keith Randall <khr@golang.org>
10 years agosort: fixed small typo in comments
Florin Patan [Sun, 8 Feb 2015 23:27:38 +0000 (00:27 +0100)]
sort: fixed small typo in comments

There was a small typo in the comment before the Stable function.

Change-Id: Ia6fa5272aa7869124a637d2eeda81c4f35ef46c8
Reviewed-on: https://go-review.googlesource.com/4201
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agoBuild fix for plan9 after 8bf13838eb21.
David Symonds [Sun, 8 Feb 2015 22:26:56 +0000 (09:26 +1100)]
Build fix for plan9 after 8bf13838eb21.

Change-Id: I66d923abbef13ba35c76c6f6da5b14c6d534127c
Reviewed-on: https://go-review.googlesource.com/4165
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: David du Colombier <0intro@gmail.com>
10 years agotime: return informative errors when failing to load timezone data.
David Symonds [Fri, 6 Feb 2015 05:58:07 +0000 (16:58 +1100)]
time: return informative errors when failing to load timezone data.

If we cannot load timezone information for a reason other than the
zoneinfo file not existing, return it since that will be much more
useful in debugging failures than "unknown time zone XYZ".

Fixes #9723.

Change-Id: I3aa5774859cec28e584d16bcc1fef0705d95288c
Reviewed-on: https://go-review.googlesource.com/3984
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agoos, syscall: revert Yosemite readdir workaround
Brad Fitzpatrick [Sun, 8 Feb 2015 20:19:20 +0000 (12:19 -0800)]
os, syscall: revert Yosemite readdir workaround

Reverts https://golang.org/cl/119530044 (OS X 10.10 Yosemite beta
14A299l workaround), since it was fixed in the final Yosemite release.

I verified that the C program http://swtch.com/~rsc/readdirbug.c
passes on Yosemite.

Adds a new test to the os package too, to verify that reading a
regular file as a directory fails.

Fixes #9789 (ReadDir: no error if dirname is a file)

Change-Id: I75286cef88fbb2ebccf045b479e33c810749dcbc
Reviewed-on: https://go-review.googlesource.com/4164
Reviewed-by: Dave Cheney <dave@cheney.net>
10 years agoRevert "cmd/api: treat a hex-y VERSION as devel and permit API changes"
David Symonds [Mon, 15 Dec 2014 00:08:37 +0000 (11:08 +1100)]
Revert "cmd/api: treat a hex-y VERSION as devel and permit API changes"

This reverts commit 11d1c05.
See #9296 for details.

Change-Id: I89a36351cb007836662f28a611af5616818b95fe
Reviewed-on: https://go-review.googlesource.com/1536
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agogofmt/doc: gofmt -s output may not be backward compatible
mattyw [Sat, 7 Feb 2015 02:28:20 +0000 (10:28 +0800)]
gofmt/doc: gofmt -s output may not be backward compatible

Change-Id: If697ab554e6cb5545d99c6b103ed8bc54f69ed48
Reviewed-on: https://go-review.googlesource.com/4161
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years agoinclude/u.h: fix name clash of REG_R* on solaris
Shenghou Ma [Sat, 7 Feb 2015 23:46:40 +0000 (18:46 -0500)]
include/u.h: fix name clash of REG_R* on solaris

Fixes build for solaris.

Change-Id: Ic6ffab36df9bd68fc38b258f1484a29fa2a0cd39
Reviewed-on: https://go-review.googlesource.com/4180
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
10 years agonet/smtp: document SendMail more
Brad Fitzpatrick [Sat, 7 Feb 2015 21:32:35 +0000 (13:32 -0800)]
net/smtp: document SendMail more

Fixes #9776

Change-Id: I53741fd970244bbfa6874adcb4f1e3d0e7de386b
Reviewed-on: https://go-review.googlesource.com/4162
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years agoencoding/xml: avoid an allocation for tags without attributes
Brian Smith [Sat, 7 Feb 2015 03:51:13 +0000 (03:51 +0000)]
encoding/xml: avoid an allocation for tags without attributes

Before, an array of size 4 would always be allocated even if a tag
doesn't have any attributes. Now that array is allocated only if
needed.

benchmark              old allocs     new allocs     delta
BenchmarkUnmarshal     191            176            -8.5%

Change-Id: I4d214b228883d0a6e892c0d6eb00dfe2da84c116
Reviewed-on: https://go-review.googlesource.com/4160
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agotesting: pad benchmark names to align results
Håvard Haugen [Wed, 14 Jan 2015 21:31:59 +0000 (22:31 +0100)]
testing: pad benchmark names to align results

Fixes #8780

Change-Id: I09cf01ff9722eed49086992a12774f2de81d16f2
Reviewed-on: https://go-review.googlesource.com/2840
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years agoliblink: fix warnings on Plan 9
David du Colombier [Sat, 7 Feb 2015 12:26:28 +0000 (13:26 +0100)]
liblink: fix warnings on Plan 9

warning: src/liblink/list5.c:171 format mismatch lld INT, arg 4
warning: src/liblink/list9.c:175 format mismatch lld INT, arg 4
warning: src/liblink/list6.c:211 format mismatch lld INT, arg 4
warning: src/liblink/list8.c:205 format mismatch lld INT, arg 4

Change-Id: I745ea852d8b58ecbbd32723e2a67aa784a729ff8
Reviewed-on: https://go-review.googlesource.com/4112
Reviewed-by: Minux Ma <minux@golang.org>
10 years agobuild: fix race.bat flags
Brad Fitzpatrick [Sat, 7 Feb 2015 01:52:24 +0000 (17:52 -0800)]
build: fix race.bat flags

The old C-based dist accepted merged flags (-wp) but the Go-based dist
requires -w -p

This should get the Windows race builder running properly, along with
https://go-review.googlesource.com/#/c/4132/

Update #8640

Change-Id: Ic17bbe9ea6c8b3d3e9b29f94e234d014f2926439
Reviewed-on: https://go-review.googlesource.com/4133
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agoos/signal, runtime: implement notes on Plan 9
David du Colombier [Thu, 22 Jan 2015 22:38:29 +0000 (23:38 +0100)]
os/signal, runtime: implement notes on Plan 9

This change is an implementation of the signal
runtime and os/signal package on Plan 9.

Contrary to Unix, on Plan 9 a signal is called
a note and is represented by a string.

For this reason, the sigsend and signal_recv
functions had to be reimplemented specifically
for Plan 9.

In order to reuse most of the code and internal
interface of the os/signal package, the note
strings are mapped to integers.

Thanks to Russ Cox for the early review.

Change-Id: I95836645efe21942bb1939f43f87fb3c0eaaef1a
Reviewed-on: https://go-review.googlesource.com/2164
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
10 years agoruntime: skip the gdb test if -iex is not supported
Shenghou Ma [Fri, 6 Feb 2015 19:33:44 +0000 (14:33 -0500)]
runtime: skip the gdb test if -iex is not supported

It turns out -iex argument is not supported by all gdb versions,
but as we need to add the auto-load safe path before loading the
inferior, test -iex support first and skip the test if it's not
available.

We should still update our builders though.

Change-Id: I355697de51baf12162ba6cb82f389dad93f93dc5
Reviewed-on: https://go-review.googlesource.com/4070
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agocmd/ld: restore .debug_gdb_script section after runtime reorganization
Shenghou Ma [Fri, 16 Jan 2015 06:23:56 +0000 (01:23 -0500)]
cmd/ld: restore .debug_gdb_script section after runtime reorganization

On some systems, gdb refuses to load Python plugin from arbitrary
paths, so we have to add $GOROOT/src/runtime to auto-load-safe-path
in the gdb script test.

Change-Id: Icc44baab8d04a65bd21ceac2ab8ddb13c8d083e8
Reviewed-on: https://go-review.googlesource.com/2905
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
10 years agonet: document that user shouldn't modify returned Addr
Shenghou Ma [Tue, 3 Feb 2015 17:59:40 +0000 (12:59 -0500)]
net: document that user shouldn't modify returned Addr

Ideally, those methods should return a copy of the Addr, but
due to the Go 1 API guarantee, we cannot make that change now:
there might exist client code that uses the returned Addr as
map index and thus relies on the fact that different invocation
of the method returns the same pointer. Changing this behavior
will lead to hidden behaviour change in those programs.

Update #9654.

Change-Id: Iad4235f2ed7789b3a3c8e0993b9718cf0534ea2b
Reviewed-on: https://go-review.googlesource.com/3851
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agocmd/gc: eliminate dead code in switch statements
Josh Bleecher Snyder [Thu, 5 Feb 2015 23:38:53 +0000 (15:38 -0800)]
cmd/gc: eliminate dead code in switch statements

Ordinary switch statements are rewritten
into a sequence of if statements.
Staticly dead cases were not being eliminated
because the rewrite introduced a temporary,
which hid the fact that the case was a constant.
Stop doing that.

This eliminates dead code in the standard library at:

runtime/cgocall.go:219
runtime/cgocall.go:269
debug/gosym/pclntab.go:175
debug/macho/file.go:208
math/big/nat.go:635
math/big/nat.go:850
math/big/nat.go:1058
cmd/pprof/internal/commands/commands.go:86
net/sock_bsd.go:19
cmd/go/build.go:2657
cmd/go/env.go:90

Fixes #9608.

Change-Id: Ic23a05dfbb1ad91d5f62a6506b35a13e51b33e38
Reviewed-on: https://go-review.googlesource.com/3980
Reviewed-by: Keith Randall <khr@golang.org>
10 years agoruntime: speed up eqstring
Josh Bleecher Snyder [Thu, 5 Feb 2015 16:23:14 +0000 (08:23 -0800)]
runtime: speed up eqstring

eqstring does not need to check the length of the strings.
Other architectures were done in a separate commit.

While we're here, add a pointer equality check.

Change-Id: Id2c8616a03a7da7037c1e9ccd56a549fc952bd98
Reviewed-on: https://go-review.googlesource.com/3956
Reviewed-by: Keith Randall <khr@golang.org>
10 years agoruntime: speed up eqstring
Josh Bleecher Snyder [Thu, 5 Feb 2015 01:31:37 +0000 (17:31 -0800)]
runtime: speed up eqstring

eqstring does not need to check the length of the strings.

6g

benchmark                              old ns/op     new ns/op     delta
BenchmarkCompareStringEqual            7.03          6.14          -12.66%
BenchmarkCompareStringIdentical        3.36          3.04          -9.52%

5g

benchmark                                 old ns/op     new ns/op     delta
BenchmarkCompareStringEqual               238           232           -2.52%
BenchmarkCompareStringIdentical           90.8          80.7          -11.12%

The equivalent PPC changes are in a separate commit
because I don't have the hardware to test them.

Change-Id: I292874324b9bbd9d24f57a390cfff8b550cdd53c
Reviewed-on: https://go-review.googlesource.com/3955
Reviewed-by: Keith Randall <khr@golang.org>
10 years agomath/big: handling of +/-Inf and zero precision, enable zero values
Robert Griesemer [Fri, 6 Feb 2015 01:21:48 +0000 (17:21 -0800)]
math/big: handling of +/-Inf and zero precision, enable zero values

- clarified representation of +/-Inf
- only 0 and Inf values can have 0 precision
- a zero precision value used as result value takes the max precision
  of the arguments (to be fine-tuned for setters)
- the zero precision approach makes Float zero values possible
  (they represent +0)
- more tests

Missing: Filling in the blanks. More tests.

Change-Id: Ibb4f97e12e1f356c3085ce80f3464e97b82ac130
Reviewed-on: https://go-review.googlesource.com/4000
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agoall: don't refer to code.google.com/p/go{,-wiki}/
Péter Surányi [Fri, 6 Feb 2015 12:44:39 +0000 (21:44 +0900)]
all: don't refer to code.google.com/p/go{,-wiki}/

Only documentation / comment changes. Update references to
point to golang.org permalinks or go.googlesource.com/go.
References in historical release notes under doc are left as is.

Change-Id: Icfc14e4998723e2c2d48f9877a91c5abef6794ea
Reviewed-on: https://go-review.googlesource.com/4060
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agogo1.5.txt: mention the Darwin/ARM port
Shenghou Ma [Fri, 6 Feb 2015 06:09:08 +0000 (01:09 -0500)]
go1.5.txt: mention the Darwin/ARM port

Change-Id: I40feb9e65615a0f683cfc3f54e0c0cfabcf6a787
Reviewed-on: https://go-review.googlesource.com/4010
Reviewed-by: Minux Ma <minux@golang.org>
10 years agosyscall: gofmt
Mikio Hara [Fri, 6 Feb 2015 05:54:28 +0000 (14:54 +0900)]
syscall: gofmt

And the silence of the git-codereview.

Change-Id: If3f7fe2de2ab4c1756f3cef8267199049d468b31
Reviewed-on: https://go-review.googlesource.com/3983
Reviewed-by: Minux Ma <minux@golang.org>
10 years agomisc/ios: add README and wrapper script to ease cross-compiling for darwin/arm
Shenghou Ma [Fri, 26 Dec 2014 06:24:42 +0000 (01:24 -0500)]
misc/ios: add README and wrapper script to ease cross-compiling for darwin/arm

Fixes #837.

Change-Id: I2d601504addbd220b304d32d587144d2a702f753
Reviewed-on: https://go-review.googlesource.com/2127
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agocmd/dist, make.bash: darwin/arm support
Shenghou Ma [Fri, 26 Dec 2014 06:22:41 +0000 (01:22 -0500)]
cmd/dist, make.bash: darwin/arm support

cmd/dist: recognize darwin/arm as (host) goos/goarches. also hard
          code GOARM=7 for darwin/arm.
make.bash: don't pass -mmacosx-version-min=10.6 when building for
           darwin/arm.

Change-Id: If0ecd84a5179cd9bb61b801ac1899adc45f12f75
Reviewed-on: https://go-review.googlesource.com/2126
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
10 years agomisc/cgo/test: skip test7978 when using unsupported compilers
Shenghou Ma [Fri, 26 Dec 2014 06:20:29 +0000 (01:20 -0500)]
misc/cgo/test: skip test7978 when using unsupported compilers

On Darwin/ARM, because libSystem doesn't provide functions for
__sync_fetch_and_add, and only clang can inline that function,
skip the test when building with GCC.

Change-Id: Id5e9d8f9bbe1e6bcb2f381f0f66cf68aa95277c7
Reviewed-on: https://go-review.googlesource.com/2125
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agoruntime/cgo: darwin/arm cgo support
Shenghou Ma [Fri, 26 Dec 2014 06:17:42 +0000 (01:17 -0500)]
runtime/cgo: darwin/arm cgo support

Change-Id: I936be12eed95b99d1d20ed16fb785182e1817b33
Reviewed-on: https://go-review.googlesource.com/2124
Reviewed-by: David Crawshaw <crawshaw@golang.org>
10 years agosyscall: darwin/arm support
Shenghou Ma [Fri, 26 Dec 2014 06:09:07 +0000 (01:09 -0500)]
syscall: darwin/arm support

Change-Id: Id6f7fa12084204bc3a200f423c7966ce2a0b63a0
Reviewed-on: https://go-review.googlesource.com/2123
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
10 years agosync/atomic: darwin/arm support
Shenghou Ma [Fri, 26 Dec 2014 06:08:23 +0000 (01:08 -0500)]
sync/atomic: darwin/arm support

Change-Id: I213a8ab0b8c027a7b73567aeefdca73fd10eae28
Reviewed-on: https://go-review.googlesource.com/2122
Reviewed-by: David Crawshaw <crawshaw@golang.org>
10 years agoruntime: darwin/arm support
Shenghou Ma [Fri, 26 Dec 2014 06:07:10 +0000 (01:07 -0500)]
runtime: darwin/arm support

Change-Id: I63110daad2d62ae72ab1f33a40464d76e6205627
Reviewed-on: https://go-review.googlesource.com/2121
Reviewed-by: David Crawshaw <crawshaw@golang.org>
10 years agoliblink, cmd/ld, cmd/5l: darwin/arm support
Shenghou Ma [Fri, 26 Dec 2014 05:15:07 +0000 (00:15 -0500)]
liblink, cmd/ld, cmd/5l: darwin/arm support

liblink:
 - set dummy value for ctxt->tlsoffset.
cmd/ld:
 - always do external linking when using cgo on darwin/arm,
   as our linker might not generate codesign-compatible binary.
cmd/5l:
 - support generate ARM Mach-O binaries
 - add machoreloc1() that translate our internal relocation to
   macho relocations used by external linking.

Change-Id: Ic5454aeb87009aaf8f1453ec7fe33e6da55d5f06
Reviewed-on: https://go-review.googlesource.com/3273
Reviewed-by: David Crawshaw <crawshaw@golang.org>
10 years agolib9: provide alterantive implementation of ldexp and frexp
Shenghou Ma [Fri, 26 Dec 2014 05:08:51 +0000 (00:08 -0500)]
lib9: provide alterantive implementation of ldexp and frexp

Libc on Darwin/ARM has a buggy implementation of ldexp and frexp
that could not handle denormal numbers.

Also disable VFP runfast (flush-to-zero) mode so that the gc
compiler can correctly handle denormal constants used in math and
strconv tests.

Change-Id: Ie64220b882f414e0b37f406f38181c3586104d46
Reviewed-on: https://go-review.googlesource.com/2119
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
10 years agoliblink, cmd/ld, runtime: set the type of runtime.tlsg in runtime
Shenghou Ma [Fri, 26 Dec 2014 05:48:33 +0000 (00:48 -0500)]
liblink, cmd/ld, runtime: set the type of runtime.tlsg in runtime

In the old code, liblink, cmd/ld and runtime all have code determine
whether runtime.tlsg is an actual variable or a placeholder for TLS
relocation. This change consolidate them into one: the runtime/tls_arm.s
will ultimately determine the type of that variable.

Change-Id: I3b3f80791a1db4c2b7318f81a115972cd2237e43
Reviewed-on: https://go-review.googlesource.com/2118
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
10 years agocmd/cgo: detect misuse of generated _cgo_export.h
Shenghou Ma [Thu, 5 Feb 2015 19:16:13 +0000 (14:16 -0500)]
cmd/cgo: detect misuse of generated _cgo_export.h

Fixes #9742.

Change-Id: Ifedf7ff9465bc49534b708d414c8e435ee9ce6cd
Reviewed-on: https://go-review.googlesource.com/3970
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agotest: check for build constraints only upto the first blank line
Rahul Chaudhry [Tue, 3 Feb 2015 18:52:18 +0000 (10:52 -0800)]
test: check for build constraints only upto the first blank line

The main issue is that the misc/cgo/{stdio,life} tests are silently
getting skipped when invoked from run.bash.

run.go should ignore any build tags after the first blank line in
source file. It already checks for test actions only upto the first
blank line. Build tags must be specified in the same block.

See http://golang.org/cl/3675 for background.

Change-Id: Id8abf000119e3335f7250d8ef34aac7811fc9dff
Reviewed-on: https://go-review.googlesource.com/3812
Reviewed-by: Minux Ma <minux@golang.org>
10 years agotest: chdir before running go tool, cleanup afterwards.
Rahul Chaudhry [Tue, 3 Feb 2015 20:41:52 +0000 (12:41 -0800)]
test: chdir before running go tool, cleanup afterwards.

issue9355 generated a file a.[568] in test/ directory and left it there.
For tests like these, it is best to chdir to a test specific directory
before generating any temporary files, since the tests are running
in parallel and might otherwise race with each other for the same files.

Change-Id: I58d96256d4d8ee3fda70d81077f19006064a7425
Reviewed-on: https://go-review.googlesource.com/3813
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agoimage: fix obsolete reference in PalettedImage doc comment
Andrew Ekstedt [Mon, 26 Jan 2015 08:39:49 +0000 (00:39 -0800)]
image: fix obsolete reference in PalettedImage doc comment

PalettedColorModel was renamed to color.Palette
over three years ago by https://golang.org/cl/5132048.

Change-Id: I0204ade10eabff45620fda2990fed428c65d871e
Reviewed-on: https://go-review.googlesource.com/3305
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
10 years agoreflect: for struct tags, reject control chars (including tabs) in keys,
Nigel Tao [Thu, 5 Feb 2015 04:23:52 +0000 (15:23 +1100)]
reflect: for struct tags, reject control chars (including tabs) in keys,
and empty keys. Also reject malformed (quoted) values.

See also https://go-review.googlesource.com/3952

Change-Id: Ice6de33b09f9904b28e410a680a90aa6c8c76fed
Reviewed-on: https://go-review.googlesource.com/3953
Reviewed-by: Rob Pike <r@golang.org>
10 years agostrconv: fix internal documentation (clarification, typos)
Robert Griesemer [Tue, 3 Feb 2015 00:42:40 +0000 (16:42 -0800)]
strconv: fix internal documentation (clarification, typos)

Change-Id: I7514e643a6a81ca715adbf6f8d19d3b2dd43fe6c
Reviewed-on: https://go-review.googlesource.com/3810
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agomath/big: add "smoke test" for big.Float division
Robert Griesemer [Thu, 5 Feb 2015 01:17:38 +0000 (17:17 -0800)]
math/big: add "smoke test" for big.Float division

Change-Id: Ica419a1215ca33dc1cff1e9e4137f204591e3cee
Reviewed-on: https://go-review.googlesource.com/3942
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agomath/big: more Float conversion tests
Robert Griesemer [Thu, 5 Feb 2015 00:31:59 +0000 (16:31 -0800)]
math/big: more Float conversion tests

Change-Id: Ia30886569141ca2e0321bea6ee1d5c9e0f79d6f9
Reviewed-on: https://go-review.googlesource.com/3941
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agomath/big: simplified formatting logic
Robert Griesemer [Wed, 4 Feb 2015 23:16:45 +0000 (15:16 -0800)]
math/big: simplified formatting logic

Change-Id: I4329c44b829fcd77e4f1a1d45904f0f8a280a595
Reviewed-on: https://go-review.googlesource.com/3940
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agonet/http: Fix typo in MaxBytesReader comment
Erik Aigner [Thu, 5 Feb 2015 07:07:18 +0000 (08:07 +0100)]
net/http: Fix typo in MaxBytesReader comment

Change-Id: Ida064ff422d077d508ef94f52fc813daa6277a99
Reviewed-on: https://go-review.googlesource.com/3933
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agocmd/5a: prepare reglist correctly
Russ Cox [Thu, 5 Feb 2015 10:29:26 +0000 (05:29 -0500)]
cmd/5a: prepare reglist correctly

This was working when 5a was built on x86 because REG_R0 = 32,
and a 32-bit shift on x86 uses only the low 32 bits of the shift count.

On ARM, the shift clamping is different.

Moving to Go will avoid these differing shift semantics.
I tripped over and fixed this bug in new5a the same way earlier tonight.

Change-Id: Id56aa0bb1830ccf250960f843e0acb8a0409e87d
Reviewed-on: https://go-review.googlesource.com/3961
Reviewed-by: Dave Cheney <dave@cheney.net>
10 years agoexpvar: fix build
Dmitry Vyukov [Thu, 5 Feb 2015 13:50:11 +0000 (16:50 +0300)]
expvar: fix build

Change-Id: I6ee7aa76673e51576b5a84c512b22a0f8af5b02f
Reviewed-on: https://go-review.googlesource.com/3966
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
10 years agoexpvar: Add benchmarks for perf sensitive operations
Evan Phoenix [Fri, 30 Jan 2015 23:31:47 +0000 (15:31 -0800)]
expvar: Add benchmarks for perf sensitive operations

These benchmarks are only for functions commonly used in loops. The
other functions are typically used for inspection or setup and thus are
not performance sensitive.

Change-Id: I8d0a0ba2d8234ecacb40fa3aa9077bf93c8fe89c
Reviewed-on: https://go-review.googlesource.com/3680
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
10 years agoRevert "liblink, cmd/5a: fix reglist parsing/printing after changing REG_R0 to 32"
Russ Cox [Thu, 5 Feb 2015 10:23:26 +0000 (10:23 +0000)]
Revert "liblink, cmd/5a: fix reglist parsing/printing after changing REG_R0 to 32"

This reverts commit da4abda2a1718c74b39134764ae6f694041a25e4.

Change-Id: Ifd09b3dae0af0c7cef5fbbc332c63e78dc90d6b1
Reviewed-on: https://go-review.googlesource.com/3960
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agocmd/ld: always set timestamp in PE header to 0
Shenghou Ma [Mon, 2 Feb 2015 23:53:24 +0000 (18:53 -0500)]
cmd/ld: always set timestamp in PE header to 0

Fixes #9756.

Change-Id: If4ee6fe10f8f90294ff9c5e7480371494094b111
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/3740
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
10 years agoliblink, cmd/5a: fix reglist parsing/printing after changing REG_R0 to 32
Shenghou Ma [Thu, 5 Feb 2015 02:30:22 +0000 (21:30 -0500)]
liblink, cmd/5a: fix reglist parsing/printing after changing REG_R0 to 32

Fixes #9759.

Change-Id: I263f1251b9401371231374551c4f71c70cb6e359
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/3931
Reviewed-by: Dave Cheney <dave@cheney.net>
10 years agocmd/pack: simplify the testing logic slightly
Rob Pike [Wed, 4 Feb 2015 21:50:08 +0000 (13:50 -0800)]
cmd/pack: simplify the testing logic slightly

Followup to https://go-review.googlesource.com/3910

We only need 1000 iteratinons.

Change-Id: Ib63ae53105176abec77bad9609d638aeda7bcd61
Reviewed-on: https://go-review.googlesource.com/3901
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agomath/big: first version of Float %e, %f, %g, %G formatting working
Robert Griesemer [Wed, 4 Feb 2015 01:37:01 +0000 (17:37 -0800)]
math/big: first version of Float %e, %f, %g, %G formatting working

Change-Id: I10efa3bc8bc7f41100feabe17837f805a42d7eb6
Reviewed-on: https://go-review.googlesource.com/3842
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agomath/big: fix %b format so it matches strconf %b format for non-zero values
Robert Griesemer [Tue, 3 Feb 2015 23:13:26 +0000 (15:13 -0800)]
math/big: fix %b format so it matches strconf %b format for non-zero values

(For zero values the strconv %b format prints the bias-adjusted exponent;
there's no bias in Float.)

Change-Id: I6f4dda9c3a50d02eac375cfe2c927c1540aae865
Reviewed-on: https://go-review.googlesource.com/3841
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agomath/big: implemented decimal rounding for Float-to-string conversion
Robert Griesemer [Tue, 3 Feb 2015 22:29:03 +0000 (14:29 -0800)]
math/big: implemented decimal rounding for Float-to-string conversion

Change-Id: Id508ca2f6c087861e8c6bc536bc39e54dce09825
Reviewed-on: https://go-review.googlesource.com/3840
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agoruntime: support panic/print logging in android-L.
Hyang-Ah Hana Kim [Sat, 24 Jan 2015 22:51:42 +0000 (17:51 -0500)]
runtime: support panic/print logging in android-L.

In android-L, logging is done through the logd daemon.
If logd daemon is available, send logging to logd.
Otherwise, fallback to the legacy mechanism (/dev/log files).

This change adds access/socket/connect calls to interact with the logd.

Fixes golang/go#9398.

Change-Id: I3c52b81b451f5862107d7c675f799fc85548486d
Reviewed-on: https://go-review.googlesource.com/3350
Reviewed-by: David Crawshaw <crawshaw@golang.org>
10 years agogo1.5.txt: array generation support in testing/quick
Josh Bleecher Snyder [Wed, 4 Feb 2015 17:32:44 +0000 (09:32 -0800)]
go1.5.txt: array generation support in testing/quick

Change-Id: I00f18a8c62a8d63822d7e07fee1ac5f088cc9587
Reviewed-on: https://go-review.googlesource.com/3866
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
10 years agoRevert "runtime: bound defer pools"
Russ Cox [Wed, 4 Feb 2015 16:56:34 +0000 (11:56 -0500)]
Revert "runtime: bound defer pools"

This reverts commit 805907115352801a54f987fc9079251b478cce3f.

Conflicts:
src/runtime/proc1.go (resolved by hand)

Change-Id: Ic62e3e802f0007ff9012b37bc5fd41fcafc153d0
Reviewed-on: https://go-review.googlesource.com/3885
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
10 years agoliblink: require use of TYPE_ADDR, not TYPE_CONST
Russ Cox [Fri, 30 Jan 2015 04:35:14 +0000 (23:35 -0500)]
liblink: require use of TYPE_ADDR, not TYPE_CONST

Add Addr-checking for all Progs on input to liblink, in liblink/pass.c,
including requiring use of TYPE_ADDR, not TYPE_CONST.
Update compilers and assemblers to satisfy checks.

Change-Id: Idac36b9f6805f0451cb541d2338992ca5eaf3963
Reviewed-on: https://go-review.googlesource.com/3801
Reviewed-by: Austin Clements <austin@google.com>
10 years agotesting/quick: support generation of array types in Value
Chris Kastorff [Wed, 4 Feb 2015 12:43:00 +0000 (04:43 -0800)]
testing/quick: support generation of array types in Value

Generating array types like [4]int would fail even though the int type
is generatable. Allow generating values of array types when the inner
type is generatable.

Change-Id: I7d71b3c18edb3737e2fec1ddf5e36c9dc8401971
Reviewed-on: https://go-review.googlesource.com/3865
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
10 years agocmd/go, make: remove ccflags
Josh Bleecher Snyder [Wed, 4 Feb 2015 00:17:08 +0000 (16:17 -0800)]
cmd/go, make: remove ccflags

cc is no more.

Change-Id: I8d1bc0d2e471cd9357274204c9bc1fa67cbc272d
Reviewed-on: https://go-review.googlesource.com/3833
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 years agocmd/go: add 9g and 9l to documentation
Josh Bleecher Snyder [Wed, 4 Feb 2015 00:19:05 +0000 (16:19 -0800)]
cmd/go: add 9g and 9l to documentation

Change-Id: I274c438ab168278dfbb34ada3ed9a7f7c66b66ef
Reviewed-on: https://go-review.googlesource.com/3834
Reviewed-by: Minux Ma <minux@golang.org>
10 years agonet: remove the dregs of old built-in poll server
Mikio Hara [Wed, 4 Feb 2015 09:00:52 +0000 (18:00 +0900)]
net: remove the dregs of old built-in poll server

We don't need placeholders for the old built-in poll server any more.

Change-Id: I3a510aec6a30bc2ac97676c400177cdfe557b8dc
Reviewed-on: https://go-review.googlesource.com/3863
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
10 years agoruntime: cleanup some left-overs of the C past
Dmitry Vyukov [Tue, 3 Feb 2015 08:20:58 +0000 (11:20 +0300)]
runtime: cleanup some left-overs of the C past

Change-Id: I3e280ca7d922f6ab14b2477361327ed076a95779
Reviewed-on: https://go-review.googlesource.com/3743
Reviewed-by: Keith Randall <khr@golang.org>
10 years agonet: update TDDO
Mikio Hara [Wed, 4 Feb 2015 02:27:08 +0000 (11:27 +0900)]
net: update TDDO

The issue #8432 has been marked as an issue for golang.org/x/net.

Change-Id: Ia39abd99b685c820ea6169ee6505b16028e7e77f
Reviewed-on: https://go-review.googlesource.com/3836
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agoruntime: bound defer pools
Dmitry Vyukov [Tue, 3 Feb 2015 05:58:04 +0000 (08:58 +0300)]
runtime: bound defer pools

The unbounded list-based defer pool can grow infinitely.
This can happen if a goroutine routinely allocates a defer;
then blocks on one P; and then unblocked, scheduled and
frees the defer on another P.
The scenario was reported on golang-nuts list.

We've been here several times. Any unbounded local caches
are bad and grow to infinite size. This change introduces
central defer pool; local pools become fixed-size
with the only purpose of amortizing accesses to the
central pool.

Change-Id: Iadcfb113ccecf912e1b64afc07926f0de9de2248
Reviewed-on: https://go-review.googlesource.com/3741
Reviewed-by: Keith Randall <khr@golang.org>
10 years agocmd/gc: don't copy string in range []byte(str)
Dmitry Vyukov [Tue, 3 Feb 2015 17:50:58 +0000 (20:50 +0300)]
cmd/gc: don't copy string in range []byte(str)

Using benchmark from the issue:

benchmark                    old ns/op     new ns/op     delta
BenchmarkRangeStringCast     2162          1152          -46.72%

benchmark                    old allocs     new allocs     delta
BenchmarkRangeStringCast     1              0              -100.00%

Fixes #2204

Change-Id: I92c5edd2adca4a7b6fba00713a581bf49dc59afe
Reviewed-on: https://go-review.googlesource.com/3790
Reviewed-by: Keith Randall <khr@golang.org>
10 years agoruntime: fix RuntimeGogoBytes on windows/amd64
Austin Clements [Wed, 4 Feb 2015 02:14:47 +0000 (21:14 -0500)]
runtime: fix RuntimeGogoBytes on windows/amd64

Before 3c0fee1, runtime.gogo was just long enough to align to 64 bytes
on OSs with short get_tls implementations and 80 bytes on OSs with
longer get_tls implementations (Windows, Solaris, and Plan 9).
3c0fee1 added a few instructions, which pushed it to 80 on most OSs,
including Windows and Plan 9, and 96 on Solaris.

Fixes #9770.

Change-Id: Ie84810657c14ab16dce9f0e0a932955251b0bf33
Reviewed-on: https://go-review.googlesource.com/3850
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
10 years agogo/doc: don't treat _ consts as exported
Josh Bleecher Snyder [Tue, 3 Feb 2015 23:12:26 +0000 (15:12 -0800)]
go/doc: don't treat _ consts as exported

golang.org/cl/144110044 made _ consts treated
as exported as a small, safe fix for #5397.
It also introduced issue #9615.

golang.org/cl/2091 then fixed the underlying issue,
which was missing type information when the type
was specified only for _.

This cl reverts the original fix.

Fixes #9615.

Change-Id: I4815ad8292bb5bec18beb8c131b48949d9af8876
Reviewed-on: https://go-review.googlesource.com/3832
Reviewed-by: Robert Griesemer <gri@golang.org>
10 years agocrypto/tls: add support for AES_256_GCM_SHA384 cipher suites specified in RFC5289
Jacob H. Haven [Wed, 4 Feb 2015 00:15:18 +0000 (16:15 -0800)]
crypto/tls: add support for AES_256_GCM_SHA384 cipher suites specified in RFC5289

Generalizes PRF calculation for TLS 1.2 to support arbitrary hashes (SHA-384 instead of SHA-256).
Testdata were all updated to correspond with the new cipher suites in the handshake.

Change-Id: I3d9fc48c19d1043899e38255a53c80dc952ee08f
Reviewed-on: https://go-review.googlesource.com/3265
Reviewed-by: Adam Langley <agl@golang.org>
10 years agocmd/dist: fix whitespace and comment typo in arm vfp detection
Josh Bleecher Snyder [Tue, 3 Feb 2015 22:09:53 +0000 (14:09 -0800)]
cmd/dist: fix whitespace and comment typo in arm vfp detection

Follow-up to cl 2682.

Change-Id: I06a589e782af821e4fa46a7c34d9a549de47fa60
Reviewed-on: https://go-review.googlesource.com/3830
Reviewed-by: Dave Cheney <dave@cheney.net>
10 years agonet/http: remove unused switchReader type
Blake Gentry [Tue, 3 Feb 2015 20:01:29 +0000 (12:01 -0800)]
net/http: remove unused switchReader type

Change-Id: Ic8a01d06ffc6c80beaf6dee9e7242dcbb7425e71
Reviewed-on: https://go-review.googlesource.com/3822
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agoinclude: restore use of signal.h on windows (fixes build)
Alex Brainman [Tue, 3 Feb 2015 23:07:16 +0000 (10:07 +1100)]
include: restore use of signal.h on windows (fixes build)

Change-Id: Ifd983cf50b1ccbe64a45d3b3ad171ef67f608033
Reviewed-on: https://go-review.googlesource.com/3831
Reviewed-by: Dave Cheney <dave@cheney.net>
10 years agocrypto/x509/pkix: Parse and add additional elements in a DN
Paul van Brouwershaven [Mon, 5 Jan 2015 11:15:18 +0000 (11:15 +0000)]
crypto/x509/pkix: Parse and add additional elements in a DN

Additional elements in a DN can be added in via ExtraNames. This
option can also be used for sorting DN elements in a custom order.

Change-Id: Ie408d332de913dc2a33bdd86433be38abb7b55be
Reviewed-on: https://go-review.googlesource.com/2257
Reviewed-by: Adam Langley <agl@golang.org>
10 years agoruntime: Change memprofrate to memprofilerate
Lynn Boger [Tue, 3 Feb 2015 18:13:31 +0000 (12:13 -0600)]
runtime:  Change memprofrate to memprofilerate

Use memprofilerate in GODEBUG instead of memprofrate to be
consistent with other uses.

Change-Id: Iaf6bd3b378b1fc45d36ecde32f3ad4e63ca1e86b
Reviewed-on: https://go-review.googlesource.com/3800
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agomath/big: implement precise Float to decimal conversion (core functionality)
Robert Griesemer [Tue, 3 Feb 2015 00:31:13 +0000 (16:31 -0800)]
math/big: implement precise Float to decimal conversion (core functionality)

Change-Id: Ic0153397922ded28a5cb362e86ecdfec42e92163
Reviewed-on: https://go-review.googlesource.com/3752
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agomath/big: fix typos
Robert Griesemer [Sat, 31 Jan 2015 00:33:31 +0000 (16:33 -0800)]
math/big: fix typos

Change-Id: Icb1490f97584d61823339ae809b88d423b185e64
Reviewed-on: https://go-review.googlesource.com/3751
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agomath/big: build Float.Format on top of Float.Append
Robert Griesemer [Fri, 30 Jan 2015 23:57:38 +0000 (15:57 -0800)]
math/big: build Float.Format on top of Float.Append

Change-Id: I444eec24467f827caa5c88a1c5ae5bce92508b98
Reviewed-on: https://go-review.googlesource.com/3750
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agoliblink: define fixed A-numbers for common instructions
Russ Cox [Fri, 30 Jan 2015 01:19:07 +0000 (20:19 -0500)]
liblink: define fixed A-numbers for common instructions

This makes names like ANOP, ATEXT, AGLOBL, ACALL, AJMP, ARET
available for use by architecture-independent processing passes.

On arm and ppc64, the alternate names are now aliases for the
official ones (ABL for ACALL, AB or ABR for AJMP, ARETURN for ARET).

Change-Id: Id027771243795af2b3745199c645b6e1bedd7d18
Reviewed-on: https://go-review.googlesource.com/3577
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
Reviewed-by: Austin Clements <austin@google.com>
10 years agoliblink: place DATA size in from3.offset always
Russ Cox [Fri, 30 Jan 2015 00:42:01 +0000 (19:42 -0500)]
liblink: place DATA size in from3.offset always

Like the TEXT/GLOBL flags, this was split between from.scale and reg,
neither of which is appropriate.

Change-Id: I2a16ef066a53b6edb7afb16cce108c0d1d26389c
Reviewed-on: https://go-review.googlesource.com/3576
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
Reviewed-by: Austin Clements <austin@google.com>
10 years agoliblink: the zero Prog is now valid and ready for use
Russ Cox [Thu, 29 Jan 2015 21:16:24 +0000 (16:16 -0500)]
liblink: the zero Prog is now valid and ready for use

Use AXXX instead of AGOK (neither is a valid instruction but AXXX is zero)
for the initial setting of Prog.as, and now there are no non-zero default
field settings.

Remove the arch-specific zprog/zprg in favor of a single global zprog.
Remove the arch-specific prg constructor in favor of emallocz(sizeof(Prog)).

Change-Id: Ia73078726768333d7cdba296f548170c1bea9498
Reviewed-on: https://go-review.googlesource.com/3575
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
Reviewed-by: Austin Clements <austin@google.com>
10 years agoliblink: remove dead computation of p->back in span6/span8
Russ Cox [Thu, 29 Jan 2015 20:35:56 +0000 (15:35 -0500)]
liblink: remove dead computation of p->back in span6/span8

Originally, when this code was part of 6l/8l, every new
Prog was constructed starting with zprg, which set back=2,
and then this code walked over the list setting back=1 for
backward branches, back=0 otherwise. The initial back=2
setting was used to identify forward branches (the branched-to
instruction had back == 2 since it hadn't yet been set to 0 or 1).

When the code was extracted into liblink and linked directly
with 6a/6g/8a/8g, those programs created the Prog struct
and did not set back=2, breaking this backward branch detection.

No one noticed, because the next loop recomputes the information.
The only requirement for the next loop is that p->back == 0 or 1 for
each of the Progs in the list.

The initialization of the zprg with back=2 would cause problems
in this second loop, for the few liblink-internally-generated instructions
that are created by copying zprg, except that the first loop was
making sure that back == 0 or 1.

The first loop's manipulation of p->back can thus be deleted,
provided we also delete the zprg.back = 2 initializations.

This is awful and my fault. I apologize.

While we're here, remove the .scale = 1 from the zprg init too.
Anything that sets up a scaled index should set the scale itself.
(And mostly those come from outside liblink anyway.)

Tested by checking that all generated code is bit-for-bit
identical to before this CL.

Change-Id: I7f6e0b33ce9ccd5b7dc25e0f00429fedd0957c8c
Reviewed-on: https://go-review.googlesource.com/3574
Reviewed-by: Austin Clements <austin@google.com>
10 years agoliblink: renumber ARM conditions to make C_SCOND_NONE == 0
Russ Cox [Thu, 29 Jan 2015 20:18:22 +0000 (15:18 -0500)]
liblink: renumber ARM conditions to make C_SCOND_NONE == 0

A step toward making the zero Prog useful.

Change-Id: I427b98b1ce9bd8f093da825aa4bb83244fc01903
Reviewed-on: https://go-review.googlesource.com/3573
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Austin Clements <austin@google.com>
10 years agoliblink: place TEXT/GLOBL flags in p->from3 always
Russ Cox [Thu, 29 Jan 2015 19:58:54 +0000 (14:58 -0500)]
liblink: place TEXT/GLOBL flags in p->from3 always

Before, amd64 and 386 stored the flags in p->from.scale
and arm and ppc64 stored the flags in p->reg.
Both caused special cases in printing and in handling of the
addresses.

To avoid possible conflicts with the real meaning of p->from
and to avoid storing a non-register value in a reg field,
use from3 to hold a TYPE_CONST value giving the flags.

There is still a special case for printing, because the flags
are specified without a $, and normally a TYPE_CONST prints
with a $. But that's much less special than what came before.

This allows us to remove the textflag and settextflag methods
from LinkArch. They are no longer architecture-specific.

Change-Id: I931da8e1ecd92e127cd9aa44ef5a73c42e730110
Reviewed-on: https://go-review.googlesource.com/3572
Reviewed-by: Austin Clements <austin@google.com>
10 years agoliblink: use same TEXT $frame-arg encoding for all architectures
Russ Cox [Thu, 29 Jan 2015 17:26:21 +0000 (12:26 -0500)]
liblink: use same TEXT $frame-arg encoding for all architectures

Change-Id: I3417a8c5ddd7f405939edc9fdef086e4741495a1
Reviewed-on: https://go-review.googlesource.com/3571
Reviewed-by: Austin Clements <austin@google.com>