]> Cypherpunks repositories - gostls13.git/log
gostls13.git
10 years ago[dev.cc] cmd/asm: fix dev.cc 386 build: implement CALL *x(SB)
Rob Pike [Wed, 11 Feb 2015 04:22:41 +0000 (20:22 -0800)]
[dev.cc] cmd/asm: fix dev.cc 386 build: implement CALL *x(SB)

Also clean up the branch code a bit

TBR=rsc

Change-Id: I209dea750db3a6769e7ccd79bb65c4d809aba152
Reviewed-on: https://go-review.googlesource.com/4530
Reviewed-by: Rob Pike <r@golang.org>
10 years ago[dev.cc] cmd/go: add veryifyAsm test for the new assembler.
Rob Pike [Wed, 11 Feb 2015 01:10:40 +0000 (17:10 -0800)]
[dev.cc] cmd/go: add veryifyAsm test for the new assembler.

Enabled for adm64 and 386 only.

Depends on https://go-review.googlesource.com/4502

Change-Id: I61caf15f91297c12197b825dd70f750c4df02d3d
Reviewed-on: https://go-review.googlesource.com/4503
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] cmd/asm: final fixups for correct assembly of runtime, the last package...
Rob Pike [Wed, 11 Feb 2015 01:11:36 +0000 (17:11 -0800)]
[dev.cc] cmd/asm: final fixups for correct assembly of runtime, the last package to verify

- obj: add a missing setting of the context for a generated JMP instruction
- asm:  correct the encoding of mode (R)(R*scale)
- asm: fix a silly bug in the test for macro recursion.
- asm: accept address mode sym(R)(R*8); was an oversight

Change-Id: I27112eaaa1faa0d2ba97e414f0571b70733ea087
Reviewed-on: https://go-review.googlesource.com/4502
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] cmd/asm: add a couple of error messages for things like $exit
Rob Pike [Mon, 9 Feb 2015 19:45:36 +0000 (11:45 -0800)]
[dev.cc] cmd/asm: add a couple of error messages for things like $exit

These illegal addressing modes were caught downstream in the assembler
or link library, but we can give a better error message upstream.

Change-Id: Ib30ef4d94d5d8d44900276592edd7997e6f91e55
Reviewed-on: https://go-review.googlesource.com/4260
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] cmd/asm: rewrite to work with new obj API
Rob Pike [Fri, 6 Feb 2015 19:39:23 +0000 (11:39 -0800)]
[dev.cc] cmd/asm: rewrite to work with new obj API

Considerable rewriting of the parser and assembler (code generator)
but it's simpler and shorter now. The internal Addr type is gone; so
is the package that held it. Parsing of operands goes directly into
obj.Addrs now.

There is a horrible hack regarding register pairs. It uses the Class
field to store the second register since it needs _some_ place to
put it but none is provided in the API. An alternative would be nice
but this works for now.

Once again creates identical .6 and .8 files as the old assembler.

Change-Id: I8207d6dfdfdb5bbed0bd870cb34ee0fe61c2fbfd
Reviewed-on: https://go-review.googlesource.com/4062
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] cmd/internal/obj: reconvert from liblink
Russ Cox [Thu, 5 Feb 2015 08:57:44 +0000 (03:57 -0500)]
[dev.cc] cmd/internal/obj: reconvert from liblink

cmd/internal/obj reconverted using rsc.io/c2go rev 2a95256.

- Brings in new, more regular Prog, Addr definitions

- Add Prog* argument to oclass in liblink/asm[68].c, for c2go conversion.
- Update objwriter for change in TEXT size encoding.
- Merge 5a, 6a, 8a, 9a changes into new5a, new6a, new8a, new9a (by hand).

- Add +build ignore to cmd/asm/internal/{addr,arch,asm}, cmd/asm.
  They need to be updated for the changes.

- Reenable verifyAsm in cmd/go.
- Reenable GOOBJ=2 mode by default in liblink.

All architectures build successfully again.

Change-Id: I2c845c5d365aa484b570476898171bee657b626d
Reviewed-on: https://go-review.googlesource.com/3963
Reviewed-by: Rob Pike <r@golang.org>
10 years ago[dev.cc] all: merge master (b8fcae0) into dev.cc
Russ Cox [Wed, 4 Feb 2015 21:11:28 +0000 (16:11 -0500)]
[dev.cc] all: merge master (b8fcae0) into dev.cc

Change-Id: I2aa1d0b0c4cf7632a54e843810959b468e3812ab

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 ago[dev.cc] cmd/go, liblink: turn off verification against Go code
Russ Cox [Wed, 4 Feb 2015 21:03:57 +0000 (16:03 -0500)]
[dev.cc] cmd/go, liblink: turn off verification against Go code

The upcoming merge is going to break the synchrony.
Will restore separately.

Change-Id: I90946119a0901e24063b190d1a074594af7654c7
Reviewed-on: https://go-review.googlesource.com/3888
Reviewed-by: Russ Cox <rsc@golang.org>
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 agocmd/pack: make a test less disk-intensive in short mode
Brad Fitzpatrick [Thu, 29 Jan 2015 12:45:56 +0000 (13:45 +0100)]
cmd/pack: make a test less disk-intensive in short mode

Fixes #9656

Change-Id: I1158636683492ef12eeafb12e257d205026adc3f
Reviewed-on: https://go-review.googlesource.com/3175
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/3910
Reviewed-by: Dave Cheney <dave@cheney.net>
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 ago[dev.cc] cmd/asm: make 386 work
Rob Pike [Wed, 4 Feb 2015 18:06:06 +0000 (10:06 -0800)]
[dev.cc] cmd/asm: make 386 work

An editing error prevented the tables from being set up correctly.
With that fixed, asm is now compatible with 8a.

Change-Id: Ieb20e6dcaf4c05bd448ea748a010ee1f58ef4807
Reviewed-on: https://go-review.googlesource.com/3867
Reviewed-by: Russ Cox <rsc@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 ago[dev.cc] lib9: add more error reporting to windows runcmd
Alex Brainman [Fri, 30 Jan 2015 04:48:58 +0000 (15:48 +1100)]
[dev.cc] lib9: add more error reporting to windows runcmd

%r format prints nothing useful on windows (see issue 9722).
Hopefully this will provide more clues about what happened.

Change-Id: Ic553bbdcde0c3cbfffa3a28f2168d6e75694e2ac
Reviewed-on: https://go-review.googlesource.com/3568
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
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 ago[dev.cc] asm: fix handling of statics (data<>) and symbols
Rob Pike [Tue, 3 Feb 2015 18:41:16 +0000 (10:41 -0800)]
[dev.cc] asm: fix handling of statics (data<>) and symbols

A typo limited the number of center-dot substitutions to one. Fixed.

With these changes, plus a recent fix to 6a, the are no differences,
down to the bit level, in object code for any assembly files in std
between asm and 6a. (Runtime has not been checked yet, but I
expect no errors.)

Change-Id: I0e8045b4414223d937e7f8919c8768860554b7d5
Reviewed-on: https://go-review.googlesource.com/3820
Reviewed-by: Russ Cox <rsc@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>
10 years agocmd/9a: fix GLOBL instruction
Russ Cox [Thu, 29 Jan 2015 18:50:19 +0000 (13:50 -0500)]
cmd/9a: fix GLOBL instruction

Because it was lumped in with the TEXT instruction,
the high 32 bits of the 64-bit constant holding the size
were always set to 0x80000000 (ArgsSizeUnknown).
This only worked because cmd/9l was reading the 64-bit
value into an int32.

While we're here, fix 5a.
It wasn't as much of a problem there because
the two values were being stored in two different fields.
But it was still wrong.

Change-Id: I69a2214c7be939530d499e29cfdc3b26720ac05a
Reviewed-on: https://go-review.googlesource.com/3570
Reviewed-by: Austin Clements <austin@google.com>
10 years ago[dev.cc] cmd/6a, etc: fix line number accounting during #ifdef
Russ Cox [Tue, 3 Feb 2015 16:48:50 +0000 (11:48 -0500)]
[dev.cc] cmd/6a, etc: fix line number accounting during #ifdef

Lines beginning with #ifdef, #else, #endif were not incrementing
the line number, resulting in bad line number information for
assembly files with #ifdefs.

Example:

#ifndef GOARCH_ppc64
#endif
#ifdef GOARCH_ppc64le
#endif

TEXT ·use(SB),7,$0
RET

Before this change, the line number recorded for use in 6a -S output
(and in the runtime information in the binary) was 4 too low.

Change-Id: I23e599112ec9919f72e53ac82d9bebbbae3439ed
Reviewed-on: https://go-review.googlesource.com/3783
Reviewed-by: Rob Pike <r@golang.org>
10 years agocmd/gc: fix capturing by value for range statements
Dmitry Vyukov [Thu, 29 Jan 2015 15:33:19 +0000 (18:33 +0300)]
cmd/gc: fix capturing by value for range statements

Kindly detected by race builders by failing TestRaceRange.
ORANGE typecheck does not increment decldepth around body.

Change-Id: I0df5f310cb3370a904c94d9647a9cf0f15729075
Reviewed-on: https://go-review.googlesource.com/3507
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agocmd/gc: typecheck type switch variables
Dmitry Vyukov [Fri, 30 Jan 2015 08:23:22 +0000 (11:23 +0300)]
cmd/gc: typecheck type switch variables

Type switch variables was not typechecked.
Previously it lead only to a minor consequence:

switch unsafe.Sizeof = x.(type) {

generated an inconsistent error message.
But capturing by value functionality now requries typechecking of all ONAMEs.

Fixes #9731

Change-Id: If037883cba53d85028fb97b1328696091b3b7ddd
Reviewed-on: https://go-review.googlesource.com/3600
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agoruntime: fix nosplit stack overflow
Dmitry Vyukov [Thu, 29 Jan 2015 09:47:30 +0000 (12:47 +0300)]
runtime: fix nosplit stack overflow

The overflow happens only with -gcflags="-N -l"
and can be reproduced with:

$ go test -gcflags="-N -l" -a -run=none net

runtime.cgocall: nosplit stack overflow
504 assumed on entry to runtime.cgocall
480 after runtime.cgocall uses 24
472 on entry to runtime.cgocall_errno
408 after runtime.cgocall_errno uses 64
400 on entry to runtime.exitsyscall
288 after runtime.exitsyscall uses 112
280 on entry to runtime.exitsyscallfast
152 after runtime.exitsyscallfast uses 128
144 on entry to runtime.writebarrierptr
88 after runtime.writebarrierptr uses 56
80 on entry to runtime.writebarrierptr_nostore1
24 after runtime.writebarrierptr_nostore1 uses 56
16 on entry to runtime.acquirem
-24 after runtime.acquirem uses 40

Move closure creation into separate function so that
frames of writebarrierptr_shadow and writebarrierptr_nostore1
are overlapped.

Fixes #9721

Change-Id: I40851f0786763ee964af34814edbc3e3d73cf4e7
Reviewed-on: https://go-review.googlesource.com/3418
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agoruntime: fix false race report during tracing
Dmitry Vyukov [Tue, 3 Feb 2015 10:01:09 +0000 (13:01 +0300)]
runtime: fix false race report during tracing

Currently race detector produces the following reports on pprof tests:

WARNING: DATA RACE
Read by goroutine 4:
  runtime/pprof_test.TestTraceStartStop()
      src/runtime/pprof/trace_test.go:38 +0x1da
  testing.tRunner()
      src/testing/testing.go:448 +0x13a

Previous write by goroutine 5:
  bytes.(*Buffer).grow()
      src/bytes/buffer.go:102 +0x190
  bytes.(*Buffer).Write()
      src/bytes/buffer.go:127 +0x75
  runtime/pprof.func·002()
      src/runtime/pprof/pprof.go:633 +0xae

Trace writer goroutine synchronizes with StopTrace
using trace.shutdownSema runtime semaphore.
But race detector does not see that synchronization
and so produces false reports.
Teach race detector about the synchronization.

Change-Id: I1219817325d4e16b423f29a0cbee94c929793881
Reviewed-on: https://go-review.googlesource.com/3746
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agoruntime: rearrange framepointer check condition
Austin Clements [Tue, 3 Feb 2015 14:18:15 +0000 (09:18 -0500)]
runtime: rearrange framepointer check condition

The test for the framepointer experiment flag is cheaper and more
branch-predictable than the other parts of this conditional, so move
it first.  This is also more readable.

(Originally, the flag check required parsing the experiments string,
which is why it was done last.  Now that flag is cached.)

Change-Id: I84e00fa7e939e9064f0fa0a4a6fe00576dd61457
Reviewed-on: https://go-review.googlesource.com/3782
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agoruntime: use 2*regSize for saved frame pointer check
Austin Clements [Tue, 3 Feb 2015 14:09:56 +0000 (09:09 -0500)]
runtime: use 2*regSize for saved frame pointer check

Previously, we checked for a saved frame pointer by looking for a
2*ptrSize gap between the argument pointer and the locals pointer.
The intent of this check was to look for a two stack slot gap (caller
IP and saved frame pointer), but stack slots are regSize, not ptrSize.

Correct this by checking instead for a 2*regSize gap.

On most platforms, this made no difference because ptrSize==regSize.
However, on amd64p32 (nacl), the saved frame pointer check incorrectly
fired when there was no saved frame pointer because the one stack slot
for the caller IP left an 8 byte gap, which is 2*ptrSize (but not
2*regSize) on amd64p32.

Fixes #9760.

Change-Id: I6eedcf681fe5bf2bf924dde8a8f2d9860a4d758e
Reviewed-on: https://go-review.googlesource.com/3781
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agoruntime: add missing \n to error message
Austin Clements [Tue, 3 Feb 2015 13:35:38 +0000 (08:35 -0500)]
runtime: add missing \n to error message

Change-Id: Ife7d30f4191e6a8aaf3a442340d277989f7a062d
Reviewed-on: https://go-review.googlesource.com/3780
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agonet: case insensitivity of DNS labels in built-in stub resolver
Mikio Hara [Mon, 2 Feb 2015 12:09:23 +0000 (21:09 +0900)]
net: case insensitivity of DNS labels in built-in stub resolver

This change adds support for case insensitivity of DNS labels to
built-in DNS stub resolver as described in RFC 4343.

Fixes #9215.

Change-Id: Ia752fe71866a3bfa3ea08371985b799d419ddea3
Reviewed-on: https://go-review.googlesource.com/3685
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agonet/http: remove redundant strings.TrimPrefix
Erik Aigner [Mon, 2 Feb 2015 07:52:41 +0000 (08:52 +0100)]
net/http: remove redundant strings.TrimPrefix

We already checked for the prefix with strings.HasPrefix

Change-Id: I33852fd19ffa92aa33b75b94b4bb505f4043a54a
Reviewed-on: https://go-review.googlesource.com/3691
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agoinclude: fix arm build one more time
Dave Cheney [Fri, 30 Jan 2015 15:19:50 +0000 (02:19 +1100)]
include: fix arm build one more time

Fourth time's the charm.

Actually this doesn't fix the build, there is a
crash after go_bootstrap is compiled which looks
like it is related to auxv parsing.

Change-Id: Id00e2dfbe7bae42856f996065d3fb90b820e29a8
Reviewed-on: https://go-review.googlesource.com/3610
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agoruntime: Add memprofrate value to GODEBUG
Lynn Boger [Wed, 28 Jan 2015 18:28:59 +0000 (12:28 -0600)]
runtime: Add memprofrate value to GODEBUG

Add memprofrate as a value recognized in GODEBUG.  The
value provided is used as the new setting for
runtime.MemProfileRate, allowing the user to
adjust memory profiling.

Change-Id: If129a247683263b11e2dd42473cf9b31280543d5
Reviewed-on: https://go-review.googlesource.com/3450
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years ago[dev.cc] cmd/asm: fix a few minor issues
Rob Pike [Mon, 2 Feb 2015 18:56:41 +0000 (10:56 -0800)]
[dev.cc] cmd/asm: fix a few minor issues

Fix one place where semicolons were not recognized and fix the
pattern match for the syntax of some pseudo ops.
Also clean up a couple of unreachable code pieces.

There is still an undiagnosed bit difference betwen old and new .6
files. TBD.

With these fixes, asm can successfully compile and test the entire tree.
(Verified by
turn off verifyAsm in cmd/go
make.bash
cp $GOROOT/bin/asm $GOROOT/pkg/tool/darwin_amd64/6a
go test -short std
)

Change-Id: I91ea892098f76ef4f129fd2530e0c63ffd8745a9
Reviewed-on: https://go-review.googlesource.com/3688
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agocmd/6g, liblink, runtime: support saving base pointers
Austin Clements [Wed, 14 Jan 2015 16:09:50 +0000 (11:09 -0500)]
cmd/6g, liblink, runtime: support saving base pointers

This adds a "framepointer" GOEXPERIMENT that that makes the amd64
toolchain maintain base pointer chains in the same way that gcc
-fno-omit-frame-pointer does.  Go doesn't use these saved base
pointers, but this does enable external tools like Linux perf and
VTune to unwind Go stacks when collecting system-wide profiles.

This requires support in the compilers to not clobber BP, support in
liblink for generating the BP-saving function prologue and unwinding
epilogue, and support in the runtime to save BPs across preemption, to
skip saved BPs during stack unwinding and, and to adjust saved BPs
during stack moving.

As with other GOEXPERIMENTs, everything from the toolchain to the
runtime must be compiled with this experiment enabled.  To do this,
run make.bash (or all.bash) with GOEXPERIMENT=framepointer.

Change-Id: I4024853beefb9539949e5ca381adfdd9cfada544
Reviewed-on: https://go-review.googlesource.com/2992
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agoruntime: eliminate uses of BP on amd64
Austin Clements [Tue, 27 Jan 2015 23:29:02 +0000 (18:29 -0500)]
runtime: eliminate uses of BP on amd64

Any place that clobbers BP in the runtime can potentially interfere
with frame pointer unwinding with GOEXPERIMENT=framepointer.  This
change eliminates uses of BP in the runtime to address this problem.
We have spare registers everywhere this occurs, so there's no downside
to eliminating BP.  Where possible, this uses the same new register as
the amd64p32 runtime, which doesn't use BP due to restrictions placed
on it by NaCL.

One nice side effect of this is that it will let perf/VTune unwind the
call stack even through a call to systemstack, which will let us get
really good call graphs from the garbage collector.

Change-Id: I0ffa14cb4dd2b613a7049b8ec59df37c52286212
Reviewed-on: https://go-review.googlesource.com/3390
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agoruntime: rename m.gcing to m.preemptoff and make it a string
Austin Clements [Fri, 30 Jan 2015 20:30:41 +0000 (15:30 -0500)]
runtime: rename m.gcing to m.preemptoff and make it a string

m.gcing has become overloaded to mean "don't preempt this g" in
general.  Once the garbage collector is preemptible, the one thing it
*won't* mean is that we're in the garbage collector.

So, rename gcing to "preemptoff" and make it a string giving a reason
that preemption is disabled.  gcing was never set to anything but 0 or
1, so we don't have to worry about there being a stack of reasons.

Change-Id: I4337c29e8e942e7aa4f106fc29597e1b5de4ef46
Reviewed-on: https://go-review.googlesource.com/3660
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agoruntime: update a few "onM"s in comments to say "systemstack"
Austin Clements [Wed, 28 Jan 2015 16:51:04 +0000 (11:51 -0500)]
runtime: update a few "onM"s in comments to say "systemstack"

Commit 656be31 replaced onM with systemstack, but missed updating a
few comments that still referred to onM.  Update these.

Change-Id: I0efb017e9a66ea0adebb6e1da6e518ee11263f69
Reviewed-on: https://go-review.googlesource.com/3664
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agocmd/9g: note suboptimal copy code
Austin Clements [Fri, 30 Jan 2015 16:18:24 +0000 (11:18 -0500)]
cmd/9g: note suboptimal copy code

9g generates needlessly complex code for small copies.  There are a
few other things that need to be improved about the copy code, so for
now just note the problem.

Change-Id: I0f1de4b2f9197a2635e27cc4b91ecf7a6c11f457
Reviewed-on: https://go-review.googlesource.com/3665
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agogo/printer: clearer logic (clenaup)
Robert Griesemer [Mon, 2 Feb 2015 19:02:09 +0000 (11:02 -0800)]
go/printer: clearer logic (clenaup)

Change-Id: I278ce47b38ec5732d981aec06b71f9ee5747c3bb
Reviewed-on: https://go-review.googlesource.com/3730
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agogo/printer: set prefix correctly when all comment lines blank
Dmitri Shuralyov [Mon, 2 Feb 2015 09:28:10 +0000 (01:28 -0800)]
go/printer: set prefix correctly when all comment lines blank

In stripCommonPrefix, the prefix was correctly calculated in all cases,
except one. That unhandled case is when there are more than 2 lines,
but all lines are blank (other than the first and last lines,
which contain /* and */ respectively).
This change detects that case and correctly sets the prefix calculated
from the last line. This is consistent with the (correct) behavior
that happens when there's at least one non-blank line.
That fixes issue #9751 that occurs for problematic input,
where cmd/gofmt and go/source would insert extra indentation on
every format operation. It also allows go/printer itself to print
such parsed files in an expected way.

Fixes #9751.

Change-Id: Id3dfb945beb59ffad3705085a3c285fca30a5f87
Reviewed-on: https://go-review.googlesource.com/3684
Reviewed-by: Robert Griesemer <gri@golang.org>
10 years agoos: fix TestMkdirAllAtSlash on Plan 9
David du Colombier [Mon, 2 Feb 2015 16:40:47 +0000 (17:40 +0100)]
os: fix TestMkdirAllAtSlash on Plan 9

Since CL 3676, the TestMkdirAllAtSlash test
depends on syscall.EROFS, which isn't defined
on Plan 9.

This change works around this issue by
defining a system dependent isReadonlyError
function.

Change-Id: If972fd2fe4828ee3bcb8537ea7f4ba29f7a87619
Reviewed-on: https://go-review.googlesource.com/3696
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agocmd/gc: always treat the output parameters as having been assigned in capturevars.
Shenghou Ma [Sat, 31 Jan 2015 07:50:56 +0000 (02:50 -0500)]
cmd/gc: always treat the output parameters as having been assigned in capturevars.

Fixes #9738.

Change-Id: Iab75de2d78335d4e31c3dce6a0e1826d8cddf5f3
Reviewed-on: https://go-review.googlesource.com/3690
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
10 years agonet: failed not faild
David Crawshaw [Mon, 2 Feb 2015 11:33:06 +0000 (11:33 +0000)]
net: failed not faild

Change-Id: Iea4221186325783db2029b07af1409015ddeda99
Reviewed-on: https://go-review.googlesource.com/3695
Reviewed-by: Dave Cheney <dave@cheney.net>
10 years agoos: don't silently skip test
Dave Cheney [Sat, 31 Jan 2015 03:48:14 +0000 (14:48 +1100)]
os: don't silently skip test

This is a followup to CL 3676.

Rather than silently returning from the test, a pass,
use the Skip facility to mark the test as skipped.

Change-Id: I90d237e770150bf8d69f14fb09874e70894a7f86
Reviewed-on: https://go-review.googlesource.com/3682
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agoos: allow EROFS in TestMkdirAllAtSlash
Rahul Chaudhry [Fri, 30 Jan 2015 23:07:11 +0000 (15:07 -0800)]
os: allow EROFS in TestMkdirAllAtSlash

On some systems (e.g. ChromeOS), / is mounted read-only.
This results in error code syscall.EROFS, which I guess
is just as valid as syscall.EACCES for this test.

Change-Id: I9188d5437a1b5ac1daa9c68b95b8dcb447666ca3
Reviewed-on: https://go-review.googlesource.com/3676
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agomath/big: split float conversion routines and tests into separate files
Robert Griesemer [Fri, 30 Jan 2015 22:53:53 +0000 (14:53 -0800)]
math/big: split float conversion routines and tests into separate files

No other functional changes.

Change-Id: I7e0bb7452c6a265535297ec7ce6a629f1aff695c
Reviewed-on: https://go-review.googlesource.com/3674
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agomath/big: split rat conversion routines and tests into separate files
Robert Griesemer [Fri, 30 Jan 2015 22:20:04 +0000 (14:20 -0800)]
math/big: split rat conversion routines and tests into separate files

No other functional changes.

Change-Id: I8be1fc488caa4f3d4c00afcb8c00475bfcd10709
Reviewed-on: https://go-review.googlesource.com/3673
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agomath/big: split int conversion routines and tests into separate files
Robert Griesemer [Fri, 30 Jan 2015 22:25:55 +0000 (14:25 -0800)]
math/big: split int conversion routines and tests into separate files

No other functional changes.

Change-Id: If0d9e6208d53478e70d991b6926ea196b2cccf2e
Reviewed-on: https://go-review.googlesource.com/3672
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agomath/big: split nat conversion routines and tests into separate files
Robert Griesemer [Fri, 30 Jan 2015 22:12:21 +0000 (14:12 -0800)]
math/big: split nat conversion routines and tests into separate files

No functional changes.

Change-Id: Ibbb705b167603d30467f3ebb83a3bb39845306a5
Reviewed-on: https://go-review.googlesource.com/3671
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years agomath/big: parsing of fractions and floats in mantissa bases other than 10
Robert Griesemer [Thu, 29 Jan 2015 01:11:15 +0000 (17:11 -0800)]
math/big: parsing of fractions and floats in mantissa bases other than 10

Change-Id: I1eaebf956a69e0958201cc5e0a9beefa062c71e1
Reviewed-on: https://go-review.googlesource.com/3454
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years ago[dev.cc] cmd/asm: handle the case where a macro is named without arguments
Rob Pike [Fri, 30 Jan 2015 17:57:11 +0000 (09:57 -0800)]
[dev.cc] cmd/asm: handle the case where a macro is named without arguments

Given
#define X() foo
X()
X
cpp produces
foo
X
Asm does now as well.

Change-Id: Ia36b88a23ce1660e6a02559c4f730593d62066f1
Reviewed-on: https://go-review.googlesource.com/3611
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] cmd/asm: rewrite the macro processor
Rob Pike [Fri, 30 Jan 2015 00:33:36 +0000 (16:33 -0800)]
[dev.cc] cmd/asm: rewrite the macro processor

The previous one was too broken, so just rewrite the code that invokes
a macro. Basically it was evaluating things too early, and mishandling
nested invocations. It's also easier to understand now.

Keep backslash-newline around in macro definitions. They get
processed when the body is evaluated.

Write some golden tests.

Change-Id: I27435f77f258a0873f80932bdc8d13ad39821ac1
Reviewed-on: https://go-review.googlesource.com/3550
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agodoc: add log.SetOutput to go1.5.txt
Andrew Gerrand [Fri, 30 Jan 2015 16:01:14 +0000 (16:01 +0000)]
doc: add log.SetOutput to go1.5.txt

Change-Id: I257211f10b334eb4828be96cd434d588bfb1a378
Reviewed-on: https://go-review.googlesource.com/3605
Reviewed-by: Rob Pike <r@golang.org>
10 years agolog: add SetOutput method on Logger
Andrew Gerrand [Mon, 19 Jan 2015 03:54:53 +0000 (14:54 +1100)]
log: add SetOutput method on Logger

Fixes #9629

Change-Id: I66091003b97742ca6d857fe51d609833ab727216
Reviewed-on: https://go-review.googlesource.com/3023
Reviewed-by: Rob Pike <r@golang.org>
10 years agocmd/pack: make a test less disk-intensive in short mode
Brad Fitzpatrick [Thu, 29 Jan 2015 12:45:56 +0000 (13:45 +0100)]
cmd/pack: make a test less disk-intensive in short mode

Fixes #9656

Change-Id: I1158636683492ef12eeafb12e257d205026adc3f
Reviewed-on: https://go-review.googlesource.com/3175
Reviewed-by: Minux Ma <minux@golang.org>
10 years agodoc: remove redundant images
Andrew Gerrand [Tue, 27 Jan 2015 08:50:00 +0000 (19:50 +1100)]
doc: remove redundant images

These are no longer used by anything.

Change-Id: I50c971418b07cafc983242833a196ba2028a2723
Reviewed-on: https://go-review.googlesource.com/3603
Reviewed-by: Rob Pike <r@golang.org>
10 years agoliblink: fix arm build again
Dave Cheney [Fri, 30 Jan 2015 05:20:46 +0000 (16:20 +1100)]
liblink: fix arm build again

Another attempt to fix the arm build by moving the include of signal.h
to cmd/lex.c, unless we are building on plan9.

Obviously if we had a plan9/arm builder this would probably not work, but
this is only a temporary measure until the c2go transition is complete.

Change-Id: I7f8ae27349b2e7a09c55db03e02a01939159a268
Reviewed-on: https://go-review.googlesource.com/3566
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agoruntime: fix system memory allocator on plan9
Dmitry Vyukov [Fri, 30 Jan 2015 11:36:12 +0000 (14:36 +0300)]
runtime: fix system memory allocator on plan9

The following line in sysFree:
n += (n + memRound) &^ memRound
doubles value of n (n += n).
Which is wrong and can lead to memory corruption.

Fixes #9712

Change-Id: I3c141b71da11e38837c09408cf4f1d22e8f7f36e
Reviewed-on: https://go-review.googlesource.com/3602
Reviewed-by: David du Colombier <0intro@gmail.com>
10 years agoruntime: fix trace ticks frequency on windows
Dmitry Vyukov [Thu, 29 Jan 2015 12:26:15 +0000 (15:26 +0300)]
runtime: fix trace ticks frequency on windows

Change-Id: I8c7fcc7705070bc9979e39d08a4c9b2870087a08
Reviewed-on: https://go-review.googlesource.com/3500
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
10 years agocmd/5l, cmd/9l: more ucontext.h fixes
Russ Cox [Fri, 30 Jan 2015 04:57:48 +0000 (23:57 -0500)]
cmd/5l, cmd/9l: more ucontext.h fixes

Change-Id: I32cad7358f5bfd8e107179653bdc55a69fbe772a
Reviewed-on: https://go-review.googlesource.com/3579
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agocmd/5l, cmd/8g: fix build failures
Russ Cox [Fri, 30 Jan 2015 04:49:27 +0000 (23:49 -0500)]
cmd/5l, cmd/8g: fix build failures

REG_R0 etc are defined in <ucontext.h> on ARM systems.
Possible use of uninitialized n in 8g/reg.c.

Change-Id: I6e8ce83a6515ca2b779ed8a344a25432db629cc2
Reviewed-on: https://go-review.googlesource.com/3578
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agocmd/dist: update for portable Prog, Addr
Russ Cox [Mon, 26 Jan 2015 20:16:24 +0000 (15:16 -0500)]
cmd/dist: update for portable Prog, Addr

There are no D_ names anymore.

Change-Id: Id3f1ce5efafb93818e5fd16c47ff48bbf61b5339
Reviewed-on: https://go-review.googlesource.com/3520
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
10 years agocmd/9a, cmd/9g, cmd/9l, liblink: update for portable Prog, Addr
Russ Cox [Mon, 26 Jan 2015 20:16:03 +0000 (15:16 -0500)]
cmd/9a, cmd/9g, cmd/9l, liblink: update for portable Prog, Addr

Change-Id: I55afed0eabf3c38e72ff105294782ac36446b66b
Reviewed-on: https://go-review.googlesource.com/3519
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
10 years agocmd/8a, cmd/8g, cmd/8l, liblink: update for portable Prog, Addr
Russ Cox [Mon, 26 Jan 2015 20:15:43 +0000 (15:15 -0500)]
cmd/8a, cmd/8g, cmd/8l, liblink: update for portable Prog, Addr

Change-Id: I19ed283962aa0221cf806307bde9ea0773a1bfd4
Reviewed-on: https://go-review.googlesource.com/3518
Reviewed-by: Austin Clements <austin@google.com>
10 years agocmd/6a, cmd/6g, cmd/6l, liblink: update for portable Prog, Addr
Russ Cox [Mon, 26 Jan 2015 20:15:25 +0000 (15:15 -0500)]
cmd/6a, cmd/6g, cmd/6l, liblink: update for portable Prog, Addr

Change-Id: I5535582660da3504663c6cba2637da132c65a400
Reviewed-on: https://go-review.googlesource.com/3517
Reviewed-by: Austin Clements <austin@google.com>
10 years agocmd/5a, cmd/5g, cmd/5l, liblink: update for portable Prog, Addr
Russ Cox [Mon, 26 Jan 2015 20:15:05 +0000 (15:15 -0500)]
cmd/5a, cmd/5g, cmd/5l, liblink: update for portable Prog, Addr

Change-Id: I06762d4fb3bb2616087339b6ae1eb5267a39c46a
Reviewed-on: https://go-review.googlesource.com/3516
Reviewed-by: Austin Clements <austin@google.com>
10 years agocmd/gc, cmd/ld, liblink: update for portable Prog, Addr changes
Russ Cox [Mon, 26 Jan 2015 20:14:23 +0000 (15:14 -0500)]
cmd/gc, cmd/ld, liblink: update for portable Prog, Addr changes

Change-Id: Ia6f8badca56565b9df80c8dbe28c47f6cf7e653f
Reviewed-on: https://go-review.googlesource.com/3515
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
10 years agoliblink: make Prog, Addr more portable and document
Russ Cox [Mon, 26 Jan 2015 20:13:05 +0000 (15:13 -0500)]
liblink: make Prog, Addr more portable and document

Change-Id: Idda476b71ae23f7b73fe63f062cf3531c1268eb3
Reviewed-on: https://go-review.googlesource.com/3514
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
Reviewed-by: Dave Cheney <dave@cheney.net>
10 years agoliblink: fix error message on linux for unknown TLS base
Russ Cox [Thu, 29 Jan 2015 03:39:57 +0000 (22:39 -0500)]
liblink: fix error message on linux for unknown TLS base

headstr(Hlinux) was reporting "android",
making for some confusing error messages.

Change-Id: I437095bee7cb2143aa37c91cf786f3a3581ae7b9
Reviewed-on: https://go-review.googlesource.com/3513
Reviewed-by: Austin Clements <austin@google.com>
10 years agocmd/9g: use nopout in excise
Russ Cox [Thu, 29 Jan 2015 01:44:55 +0000 (20:44 -0500)]
cmd/9g: use nopout in excise

In addition to duplicating the logic, the old code was
clearing the line number, which led to missing source line
information in the -S output.

Also fix nopout, which was incomplete.

Change-Id: Ic2b596a2f9ec2fe85642ebe125cca8ef38c83085
Reviewed-on: https://go-review.googlesource.com/3512
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Dave Cheney <dave@cheney.net>
10 years agoliblink: bug fixes for ppc64 %P format
Russ Cox [Wed, 28 Jan 2015 02:07:35 +0000 (21:07 -0500)]
liblink: bug fixes for ppc64 %P format

- certain code paths were appending to the string without first clearing it.
- some prints were using spaces instead of tabs

Change-Id: I7a3d38289c8206682baf8942abf5a9950a56b449
Reviewed-on: https://go-review.googlesource.com/3511
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Dave Cheney <dave@cheney.net>
10 years agotest/closure2.go: correctly "use" tmp
Robert Griesemer [Thu, 29 Jan 2015 22:18:52 +0000 (14:18 -0800)]
test/closure2.go: correctly "use" tmp

cmd/go doesn't complain (this is an open issue), but go/types does

Change-Id: I2caec1f7aec991a9500d2c3504c29e4ab718c138
Reviewed-on: https://go-review.googlesource.com/3541
Reviewed-by: Alan Donovan <adonovan@google.com>
10 years ago[dev.cc] cmd/asm: delete overflow checking, make labels function-scoped
Rob Pike [Thu, 29 Jan 2015 20:07:50 +0000 (12:07 -0800)]
[dev.cc] cmd/asm: delete overflow checking, make labels function-scoped

The overflow checking was causing more problems than it was avoiding,
so get rid of it. But because arithmetic is done with uint64s, to simplify
dealing with large constants, complain about right shift and divide with
huge numbers to avoid ambiguity about signed shifts.

Change-Id: I5b5ea55d8e8c02846605f4a3f8fd7a176b1e962b
Reviewed-on: https://go-review.googlesource.com/3531
Reviewed-by: Russ Cox <rsc@golang.org>
10 years ago[dev.cc] cmd/asm: set the flags to production settings (turn off debug)
Rob Pike [Wed, 28 Jan 2015 23:41:12 +0000 (15:41 -0800)]
[dev.cc] cmd/asm: set the flags to production settings (turn off debug)

Set -S to false and add -debug to control the other debugging print.

Change-Id: I864866c3d264a33e6dd0ce12a86a050a5fe0f875
Reviewed-on: https://go-review.googlesource.com/3453
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agoruntime: scanvalid race Fixes #9727
Rick Hudson [Thu, 29 Jan 2015 15:37:32 +0000 (10:37 -0500)]
runtime: scanvalid race Fixes #9727

Set gcscanvalid=false after you have cased to _Grunning.
If you do it before the cas and the atomicstatus races to a scan state,
the scan will set gcscanvalid=true and we will be _Grunning
with gcscanvalid==true which is not a good thing.

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