]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
9 years ago.gitignore: ignore ARM64 build products
Aram Hăvărneanu [Fri, 13 Mar 2015 10:54:25 +0000 (11:54 +0100)]
.gitignore: ignore ARM64 build products

Change-Id: I56297aac4ee282fd117ec525b88dee4769477111
Reviewed-on: https://go-review.googlesource.com/7560
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
9 years agodoc/go1.5: correct archive/zip change
Shenghou Ma [Sun, 15 Mar 2015 21:23:02 +0000 (17:23 -0400)]
doc/go1.5: correct archive/zip change

Change-Id: I7bac7b659b7ff425c6f896c286d0f89f05eff6bd
Reviewed-on: https://go-review.googlesource.com/7601
Reviewed-by: Minux Ma <minux@golang.org>
9 years agosync/atomic: add support for openbsd/arm
Joel Sing [Sun, 15 Mar 2015 06:32:20 +0000 (17:32 +1100)]
sync/atomic: add support for openbsd/arm

Change-Id: I45383de6d627be35f40e07a9008b6773f5c2b0d0
Reviewed-on: https://go-review.googlesource.com/7613
Reviewed-by: Minux Ma <minux@golang.org>
9 years agocmd/dist: use GOARM=5 for openbsd/arm
Joel Sing [Sun, 15 Mar 2015 06:38:05 +0000 (17:38 +1100)]
cmd/dist: use GOARM=5 for openbsd/arm

OpenBSD/arm only currently supports softfloat, hence make the default GOARM=5.

Change-Id: Ie3e8f457f001b3803d17ad9bc4ab957b2da18c6a
Reviewed-on: https://go-review.googlesource.com/7614
Reviewed-by: Minux Ma <minux@golang.org>
9 years agosyscall: add support for openbsd/arm
Joel Sing [Sun, 15 Feb 2015 15:28:39 +0000 (02:28 +1100)]
syscall: add support for openbsd/arm

Change-Id: I9fe15781f52e0d16707a9c021cf800319721a606
Reviewed-on: https://go-review.googlesource.com/4913
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: add support for openbsd/arm
Joel Sing [Sun, 15 Feb 2015 15:03:53 +0000 (02:03 +1100)]
runtime: add support for openbsd/arm

Change-Id: I2bc101aa19172e705ee4de5f3c73a8b4bbf4fa6f
Reviewed-on: https://go-review.googlesource.com/4912
Reviewed-by: Minux Ma <minux@golang.org>
9 years agodoc: note removal of dragonfly/386 port
Joel Sing [Sat, 14 Mar 2015 12:53:31 +0000 (23:53 +1100)]
doc: note removal of dragonfly/386 port

Change-Id: Ibb7e4f6b95b7a9782a47221cafbe4f20dd77fd38
Reviewed-on: https://go-review.googlesource.com/7583
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: skip TestStdcallAndCDeclCallbacks when gcc is missing
Shenghou Ma [Sat, 14 Mar 2015 22:26:39 +0000 (18:26 -0400)]
runtime: skip TestStdcallAndCDeclCallbacks when gcc is missing

Fixes #10167.

Change-Id: Ib6c6b2b5dde47744b69f65482a21964fa3c12090
Reviewed-on: https://go-review.googlesource.com/7600
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
9 years agoall: remove dragonfly/386 port
Joel Sing [Sun, 18 Jan 2015 10:02:58 +0000 (21:02 +1100)]
all: remove dragonfly/386 port

DragonFlyBSD dropped support for i386 in 4.0 and there is no longer a
dragonfly/386 - as such, remove the Go port.

Fixes #8951
Fixes #7580
Fixes #7421

Change-Id: I69022ab2262132e8f97153f14dc8c37c98527008
Reviewed-on: https://go-review.googlesource.com/7543
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Joel Sing <jsing@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agoencoding/binary: cull dead code
Josh Bleecher Snyder [Sat, 14 Mar 2015 02:36:09 +0000 (19:36 -0700)]
encoding/binary: cull dead code

Change-Id: I91f9b5280e08e005f5a891aaa249267c211d814b
Reviewed-on: https://go-review.googlesource.com/7592
Reviewed-by: Minux Ma <minux@golang.org>
9 years agodebug/elf: support reading debug info from 32-bit PPC objects
Ian Lance Taylor [Sat, 14 Mar 2015 01:08:33 +0000 (18:08 -0700)]
debug/elf: support reading debug info from 32-bit PPC objects

Fixes #10118.

Change-Id: I4a2e6748db609c6eed1d68c824b81c59bd7b875c
Reviewed-on: https://go-review.googlesource.com/7590
Reviewed-by: Minux Ma <minux@golang.org>
9 years agodebug/gosym: fix typo in comment
Ian Lance Taylor [Sat, 14 Mar 2015 01:16:21 +0000 (18:16 -0700)]
debug/gosym: fix typo in comment

Change-Id: Ieb13359c5bbe26bbf7baaaa8eb63d5e90bdefdd8
Reviewed-on: https://go-review.googlesource.com/7591
Reviewed-by: Minux Ma <minux@golang.org>
9 years agocmd/internal/ld: remove some dead code
Michael Hudson-Doyle [Sat, 7 Mar 2015 03:28:07 +0000 (16:28 +1300)]
cmd/internal/ld: remove some dead code

Just little bits and pieces I noticed were unused in passing, and
some more found with https://github.com/opennota/check.

Change-Id: I199fecdbf8dc2ff9076cf4ea81395275c7f171c3
Reviewed-on: https://go-review.googlesource.com/7033
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/internal/gc: remove unused fields
Matthew Dempsky [Mon, 9 Mar 2015 18:14:35 +0000 (11:14 -0700)]
cmd/internal/gc: remove unused fields

Change-Id: I3096a7497955bc475739739ee23be387e9162867
Reviewed-on: https://go-review.googlesource.com/7210
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agomath/big: wrap Float.Cmp result in struct to prevent wrong use
Robert Griesemer [Sat, 14 Mar 2015 00:24:30 +0000 (17:24 -0700)]
math/big: wrap Float.Cmp result in struct to prevent wrong use

Float.Cmp used to return a value < 0, 0, or > 0 depending on how
arguments x, y compared against each other. With the possibility
of NaNs, the result was changed into an Accuracy (to include Undef).
Consequently, Float.Cmp results could still be compared for (in-)
equality with 0, but comparing if < 0 or > 0 would provide the
wrong answer w/o any obvious notice by the compiler.

This change wraps Float.Cmp results into a struct and accessors
are used to access the desired result. This prevents incorrect
use.

Change-Id: I34e6a6c1859251ec99b5cf953e82542025ace56f
Reviewed-on: https://go-review.googlesource.com/7526
Reviewed-by: Rob Pike <r@golang.org>
9 years agosyscall: add missing Syscall9 for darwin/amd64
Mikio Hara [Tue, 3 Mar 2015 03:15:53 +0000 (12:15 +0900)]
syscall: add missing Syscall9 for darwin/amd64

Fixes #10068.

Change-Id: I1f12225ee16b0090b87403931c0bc0157f068309
Reviewed-on: https://go-review.googlesource.com/6555
Reviewed-by: Minux Ma <minux@golang.org>
9 years agocmd/internal/gc: remove namebuf variable
Matthew Dempsky [Fri, 6 Mar 2015 20:02:24 +0000 (12:02 -0800)]
cmd/internal/gc: remove namebuf variable

namebuf was a global char buffer in the C version of gc, which was
useful for providing common storage for constructing symbol and file
names.  However, now that it's just a global Go string and the string
data is dynamically allocated anyway, it doesn't serve any purpose
except to force extra write barriers everytime it's assigned to.

Also, introduce Lookupf(fmt, args...) as shorthand for
Lookup(fmt.Sprintf(fmt, args...)), which was a very common pattern for
using namebuf.

Passes "go build -toolexec 'toolstash -cmp' -a std".

Notably, this CL shrinks 6g's text section by ~15kB:

$ size toolstash/6g tool/linux_amd64/6g
   text    data     bss     dec     hex filename
4600805  605968  342988 5549761  54aec1 toolstash/6g
4585547  605968  342956 5534471  547307 tool/linux_amd64/6g

Change-Id: I98abb44fc7f43a2e2e48425cc9f215cd0be37442
Reviewed-on: https://go-review.googlesource.com/7080
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/7g: fix build breakage
Dave Cheney [Fri, 13 Mar 2015 23:03:55 +0000 (10:03 +1100)]
cmd/7g: fix build breakage

Update cmd/7g to match the other compilers. Fixes build break in rev 6582d1cf8.

Change-Id: I449613cf348254e9de6cc7a6b7737e43ea7d10fe
Reviewed-on: https://go-review.googlesource.com/7580
Reviewed-by: Dave Cheney <dave@cheney.net>
9 years agocmd/internal/gc, etc: remove canemitecode of Naddr
Michael Hudson-Doyle [Sat, 7 Mar 2015 03:16:48 +0000 (16:16 +1300)]
cmd/internal/gc, etc: remove canemitecode of Naddr

The argument is never consulted apart from passing it to recursive
calls.  So delete it.

Change-Id: Ia15eefb6385b3c99ea4def88f564f4e5a94c68ab
Reviewed-on: https://go-review.googlesource.com/7032
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agotest: add test that gccgo failed to compile
Ian Lance Taylor [Fri, 13 Mar 2015 20:18:54 +0000 (13:18 -0700)]
test: add test that gccgo failed to compile

Change-Id: I9ea6d4d8a9c1c63de36f2f3871dd5ac9201c0aac
Reviewed-on: https://go-review.googlesource.com/7523
Reviewed-by: Minux Ma <minux@golang.org>
9 years agomath/big: fix minor documentation issue
Robert Griesemer [Fri, 13 Mar 2015 21:20:07 +0000 (14:20 -0700)]
math/big: fix minor documentation issue

Change-Id: Ib42f75c03573cec16801b79a6eb9b1b542028f4f
Reviewed-on: https://go-review.googlesource.com/7524
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agomath/big: fix silly bug in Int64 accessor
Robert Griesemer [Fri, 13 Mar 2015 19:59:56 +0000 (12:59 -0700)]
math/big: fix silly bug in Int64 accessor

Change-Id: If335d45ea1ab6c8aeeb47515f97680e2c1d651f3
Reviewed-on: https://go-review.googlesource.com/7522
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agoimage/jpeg: reject bad Tq values in SOF data.
Nigel Tao [Fri, 13 Mar 2015 03:38:25 +0000 (14:38 +1100)]
image/jpeg: reject bad Tq values in SOF data.

Fixes #10154

Change-Id: Ibb8ea9bcf512e7639c57a6f17afbe4495fa329cd
Reviewed-on: https://go-review.googlesource.com/7494
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: remove reference to openbsd kern.rthreads sysctl
Joel Sing [Thu, 12 Mar 2015 14:52:12 +0000 (01:52 +1100)]
runtime: remove reference to openbsd kern.rthreads sysctl

The kern.rthreads sysctl has not existed for a long time - there is no way to
disable rthreads and __tfork no longer returns ENOTSUP.

Change-Id: Ia50ff01ac86ea83358e72b8f45f7818aaec1e4b1
Reviewed-on: https://go-review.googlesource.com/7490
Reviewed-by: Minux Ma <minux@golang.org>
9 years agocmd/5l: make 5l work on openbsd
Joel Sing [Tue, 23 Dec 2014 15:08:58 +0000 (02:08 +1100)]
cmd/5l: make 5l work on openbsd

Change-Id: If58ea50fbf321ae943d0890a40e0552e7bc19709
Reviewed-on: https://go-review.googlesource.com/2080
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agodoc/go1.5.txt: mention zip.WriterAt
Andrew Gerrand [Thu, 12 Mar 2015 21:34:00 +0000 (08:34 +1100)]
doc/go1.5.txt: mention zip.WriterAt

Change-Id: I9f5ca101e0d2fe71cb1ca810cfeeb82c12f5f8e7
Reviewed-on: https://go-review.googlesource.com/7491
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agoarchive/zip: remove WriterOptions and replace with SetOffset method
Andrew Gerrand [Thu, 12 Mar 2015 00:54:11 +0000 (11:54 +1100)]
archive/zip: remove WriterOptions and replace with SetOffset method

Change-Id: I0a8b972c33e80c750ff1d63717177a5a3294a112
Reviewed-on: https://go-review.googlesource.com/7445
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Geert-Johan Riemer <gjr19912@gmail.com>
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agomath/big: handle NaNs in Float.Cmp
Robert Griesemer [Thu, 5 Mar 2015 21:10:33 +0000 (13:10 -0800)]
math/big: handle NaNs in Float.Cmp

Also:
- Implemented NewFloat convenience factory function (analogous to
  NewInt and NewRat).
- Implemented convenience accessors for Accuracy values returned
  from Float.Cmp.
- Added test and example.

Change-Id: I985bb4f86e6def222d4b2505417250d29a39c60e
Reviewed-on: https://go-review.googlesource.com/6970
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agoflag: use four spaces before tab, not three
Russ Cox [Thu, 12 Mar 2015 18:35:37 +0000 (14:35 -0400)]
flag: use four spaces before tab, not three

Four spaces is what works well for both 4- and 8-space tab stops.

Screen with fixed-width font and 4-space tab stops:
http://imgur.com/lps5Lbb

Change-Id: I7d2b813d674c3e0a68f79d63bc5d5ec5bd4f87bb
Reviewed-on: https://go-review.googlesource.com/7503
Reviewed-by: Rob Pike <r@golang.org>
9 years agomath/big: added (internal) Float.form field for easier case distinctions
Robert Griesemer [Thu, 5 Mar 2015 01:00:41 +0000 (17:00 -0800)]
math/big: added (internal) Float.form field for easier case distinctions

This is a fairly significant _internal_ representation change. Instead
of encoding 0, finite, infinite, and NaN values with special mantissa
and exponent values, a new (1 byte) 'form' field is used (without making
the Float struct bigger). The form field permits simpler and faster
case distinctions. As a side benefit, for zero and non-finite floats,
fewer fields need to be set. Also, the exponent range is not the full
int32 range (in the old format, infExp and nanExp were used to represent
Inf and NaN values and tests for those values sometimes didn't test
for the empty mantissa, so the range was reduced by 2 values).

The correspondence between the old and new fields is as follows.
Old representation:

x                 neg      mant         exp
---------------------------------------------------------------
+/-0              sign     empty        0
0 < |x| < +Inf    sign     mantissa     exponent
+/-Inf            sign     empty        infExp
NaN               false    empty        nanExp

New representation (- stands for ignored fields):

x                 neg      mant         exp         form
---------------------------------------------------------------
+/-0              sign     -            -           zero
0 < |x| < +Inf    sign     mantissa     exponent    finite
+/-Inf            sign     -            -           inf
NaN               -        -            -           nan

Client should not be affected by this change.

Change-Id: I7e355894d602ceb23f9ec01da755fe6e0386b101
Reviewed-on: https://go-review.googlesource.com/6870
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agomath/big: make validate a method of Float (cleanup)
Robert Griesemer [Wed, 4 Mar 2015 23:02:07 +0000 (15:02 -0800)]
math/big: make validate a method of Float (cleanup)

Change-Id: If38f45acffd352ed95f32f3a36edd91a1fb33d0c
Reviewed-on: https://go-review.googlesource.com/6850
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agomath/big: introduce Bits abstraction instead of using "untyped" []int bit lists
Robert Griesemer [Wed, 4 Mar 2015 22:53:41 +0000 (14:53 -0800)]
math/big: introduce Bits abstraction instead of using "untyped" []int bit lists

Change-Id: I6caa6bdcf6643ce3015244397a752bd133f3d00c
Reviewed-on: https://go-review.googlesource.com/6840
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agodoc/go1.5.txt: new format for flag.PrintDefaults
Rob Pike [Thu, 12 Mar 2015 18:20:55 +0000 (11:20 -0700)]
doc/go1.5.txt: new format for flag.PrintDefaults

Change-Id: Ic78deaf91b437016b0a064c1f9ef49c9c29f4c32
Reviewed-on: https://go-review.googlesource.com/7510
Reviewed-by: Rob Pike <r@golang.org>
9 years agoflag: nicer usage messages
Rob Pike [Tue, 10 Mar 2015 22:08:55 +0000 (15:08 -0700)]
flag: nicer usage messages

Make PrintDefaults print an easier-to-read format, and allow the user
to control it a bit by putting a hint into the usage string.

Here is the new doc comment for PrintDefaults, which does the work:

    PrintDefaults prints, to standard error unless configured otherwise, a
    usage message showing the default settings of all defined command-line
    flags. For an integer valued flag x, the default output has the form

-x int
usage-message-for-x (default 7)

    The usage message will appear on a separate line except for single-
    letter boolean flags. Boolean flags omit the type, since they can be
    used without an actual value, and the parenthetical default is omitted
    if the default is the zero value for the type. The type, here int, can
    be replaced by a string of the user's choosing by placing in the usage
    string for the flag a back-quoted name; the first such item in the
    message is taken to be a parameter name to show in the message and the
    back quotes are stripped from the message when displayed. For instance,
    given

flag.String("I", "", "search `directory` for include files")

    the output will be

-I directory
search directory for include files.

Given

A = flag.Bool("A", false, "for bootstrapping, allow 'any' type")
B = flag.Bool("Alongflagname", false, "disable bounds checking")
C = flag.Bool("C", true, "a boolean defaulting to true")
D = flag.String("D", "", "set relative `path` for local imports")
F = flag.Float64("F", 2.7, "a non-zero float")
G = flag.Float64("G", 0, "a float that defaults to zero")
N = flag.Int("N", 27, "a non-zero int")
Z = flag.Int("Z", 0, "an int that defaults to zero")
T = flag.Duration("deltaT", 0, "a duration")

the old output was

  -A=false: for bootstrapping, allow 'any' type
  -Alongflagname=false: disable bounds checking
  -C=true: a boolean defaulting to true
  -D="": set relative `path` for local imports
  -F=2.7: a non-zero float
  -G=0: a float that defaults to zero
  -N=27: a non-zero int
  -Z=0: an int that defaults to zero
  -deltaT=0: a duration

and the new output is

  -A for bootstrapping, allow 'any' type
  -Alongflagname
disable bounds checking
  -C a boolean defaulting to true (default true)
  -D path
    set relative path for local imports
  -F float
    a non-zero float (default 2.7)
  -G float
    a float that defaults to zero
  -N int
    a non-zero int (default 27)
  -Z int
    an int that defaults to zero
  -deltaT duration
    a duration

Change-Id: I54ab3cd5610d551422b004d95ab78305e06a395d
Reviewed-on: https://go-review.googlesource.com/7330
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/asm: add MRC and MCR to end-to-end test for arm
Rob Pike [Wed, 11 Mar 2015 18:31:49 +0000 (11:31 -0700)]
cmd/asm: add MRC and MCR to end-to-end test for arm

The old, per-architecture operand printers didn't lock down the
format of the constant in the MRC and MCR instructions (a value
that could be presented more helpfully - maybe how the
input looks? - but that is an issue for another day). But there is
a portable standard printer now so we can enable tests for these
instructions.

Change-Id: I437a3b112ce63f4d6e1fe3450fc21d8c3372602f
Reviewed-on: https://go-review.googlesource.com/7420
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agodoc/go1.5: mention the ${SRCDIR} in cgo line change
Shenghou Ma [Thu, 12 Mar 2015 17:24:24 +0000 (13:24 -0400)]
doc/go1.5: mention the ${SRCDIR} in cgo line change

Change-Id: I4bc08a7085b45be3d2755a1986cf5b8c82fa165d
Reviewed-on: https://go-review.googlesource.com/7500
Reviewed-by: Minux Ma <minux@golang.org>
9 years agodoc/effective_go.html: add missing newline
Michael Vetter [Thu, 12 Mar 2015 14:49:49 +0000 (15:49 +0100)]
doc/effective_go.html: add missing newline

When printing the type of the function there was no newline printed in
case of unexpected type.

Change-Id: I5946413f0864f712a1b955f488b436793018e0e0
Reviewed-on: https://go-review.googlesource.com/7480
Reviewed-by: Minux Ma <minux@golang.org>
9 years agocmd/asm/internal/asm: report arch if assembly fails
Michael Hudson-Doyle [Thu, 12 Mar 2015 09:13:21 +0000 (22:13 +1300)]
cmd/asm/internal/asm: report arch if assembly fails

Just a trivial thing I noticed in passing.

Change-Id: I875069ceffd623f9e430d07feb5042ab9e69917e
Reviewed-on: https://go-review.googlesource.com/7472
Reviewed-by: Rob Pike <r@golang.org>
9 years agocmd/internal/obj/x86: implement -shared computation of TLS base
Michael Hudson-Doyle [Mon, 9 Mar 2015 00:21:51 +0000 (13:21 +1300)]
cmd/internal/obj/x86: implement -shared computation of TLS base

Somehow, terribly embarrassingly, I lost part of the "re-enable
-shared on amd64" patch when rebasing before it got submitted.
This restores it and also fixes the addend to be the necessary -4.

Now updated so that Git will not put the new case into the wrong
switch.

Change-Id: I1d628232771a6d6ce6d085adf379f94a377822c5
Reviewed-on: https://go-review.googlesource.com/7126
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agonet/http/pprof: Use relative links to profiles in index html
Matt Joiner [Wed, 11 Mar 2015 06:52:57 +0000 (17:52 +1100)]
net/http/pprof: Use relative links to profiles in index html

This allows /debug/pprof/ and descendents to be used through
http.StripPrefix and other path rewriting handlers.

Change-Id: I53673876c107bbfaf430123ead78e6524b42ac21
Reviewed-on: https://go-review.googlesource.com/7351
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agoarchive/zip: add NewWriterWithOptions
Geert-Johan Riemer [Mon, 19 Jan 2015 13:39:33 +0000 (14:39 +0100)]
archive/zip: add NewWriterWithOptions

When appending zip data to existing data such as a binary file the
zip headers must use the correct offset. NewWriterWithOptions
allows creating a Writer that uses the provided offset in the zip
headers.

Fixes #8669

Change-Id: I6ec64f1e816cc57b6fc8bb9e8a0918e586fc56b0
Reviewed-on: https://go-review.googlesource.com/2978
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agoruntime: don't return a slice with nil ptr but non-zero len from growslice
Shenghou Ma [Wed, 11 Mar 2015 16:07:50 +0000 (12:07 -0400)]
runtime: don't return a slice with nil ptr but non-zero len from growslice

Fixes #10135.

Change-Id: Ic4c5ab15bcb7b9c3fcc685a788d3b59c60c26e1e
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/7400
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/9g: use REGZERO instead of REG_R0 if we want the zero register
Shenghou Ma [Wed, 11 Mar 2015 17:05:24 +0000 (13:05 -0400)]
cmd/9g: use REGZERO instead of REG_R0 if we want the zero register

This will make the intention clearer.
This is migrated from pre-c2go CL 4930.

Change-Id: I9103126a05323daedd729a43b94b2be8cd7408c9
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/7410
Reviewed-by: Austin Clements <austin@google.com>
9 years agodebug/dwarf: factor parsing of unit lengths
Austin Clements [Thu, 5 Mar 2015 20:07:00 +0000 (15:07 -0500)]
debug/dwarf: factor parsing of unit lengths

Many headers in DWARF sections have a "unit length" that can be either
4 bytes or 12 bytes and indicates both the length of the unit and
whether the unit is in 32-bit or 64-bit format.

Currently, we implement unit length parsing in four different places.
Add a "unitLength" method to buf that parses a unit length and use it
in these four places.

Change-Id: I7950b91caaa92aa5e19aa63debc8ae46178ecc4d
Reviewed-on: https://go-review.googlesource.com/7281
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/internal/ld: fix package data parsing
Matthew Dempsky [Fri, 6 Mar 2015 01:00:18 +0000 (17:00 -0800)]
cmd/internal/ld: fix package data parsing

The conversion of this logic from C introduced a few subtle behavior
changes.  E.g., assigning "name := data[p0:]" and then "name =
name[:p1-p0]" actually caused name to span the vast majority of the
package data, as at the time of the second statement p0 points just
after the package name and p1 points to the end of the package data.

Similarly, the logic for advancing past the newline at the end of the
package line changed slightly: for a "package foo safe" line, the new
code would only advance up to the newline, but not past.  (Albeit, in
practice this doesn't matter: newlines in package data are harmless.)

Lastly, "data[p0]" was incorrectly written as "data[0]" a few times.

Change-Id: I49017e16ba33a627f773532b418cbf85a84f2b4b
Reviewed-on: https://go-review.googlesource.com/7000
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agopath/filepath: clarify the package doc about '/' in returned results.
Hyang-Ah (Hana) Kim [Tue, 10 Mar 2015 16:31:33 +0000 (12:31 -0400)]
path/filepath: clarify the package doc about '/' in returned results.

The slash is replaced with os.PathSeparator before returning.
Split, SplitList are the exceptions; comments for them mention this.

Fixes golang/go#10122.

Change-Id: I66dbee8d09f378582e046be8df309a3930151820
Reviewed-on: https://go-review.googlesource.com/7310
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
9 years agoruntime,reflect,cmd/internal/gc: Fix comments referring to .c/.h files
Keith Randall [Wed, 11 Mar 2015 19:58:47 +0000 (12:58 -0700)]
runtime,reflect,cmd/internal/gc: Fix comments referring to .c/.h files

Everything has moved to Go, but comments still refer to .c/.h files.
Fix all of those up, at least for these three directories.

Fixes #10138

Change-Id: Ie5efe89b247841e0b3f82aac5256b2c606ef67dc
Reviewed-on: https://go-review.googlesource.com/7431
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/internal/obj/*: go generate the slice of Anames strings
Rob Pike [Wed, 11 Mar 2015 19:48:42 +0000 (12:48 -0700)]
cmd/internal/obj/*: go generate the slice of Anames strings

Add cmd/internal/obj/stringer.go to do the generation and update
the architecture packages to use it to maintain the Anames tables.

Change-Id: I9c6d4def1bf21624668396d70c17973d0db11fbc
Reviewed-on: https://go-review.googlesource.com/7430
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/asm: implement MCR instruction on ARM
Rob Pike [Mon, 9 Mar 2015 19:36:11 +0000 (12:36 -0700)]
cmd/asm: implement MCR instruction on ARM

It's an oddball that needs special treatment because it is not really
an opcode, but a variant of MRC.

The String method of Prog still needs updating to print it nicely.

Change-Id: I6005b7f2234ccd3d4ac1f658948e3be97cf1f1c2
Reviewed-on: https://go-review.googlesource.com/7220
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agocmd/trace: move goroutine analysis code to internal/trace
Dmitry Vyukov [Tue, 10 Mar 2015 16:40:09 +0000 (19:40 +0300)]
cmd/trace: move goroutine analysis code to internal/trace

This allows to test goroutine analysis code in runtime/pprof tests.
Also fix a nil-deref crash in goroutine analysis code that happens on runtime/pprof tests.

Change-Id: Id7884aa29f7fe4a8d7042482a86fe434e030461e
Reviewed-on: https://go-review.googlesource.com/7301
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agocmd/trace: dump thread id on proc start
Dmitry Vyukov [Tue, 10 Mar 2015 17:38:32 +0000 (20:38 +0300)]
cmd/trace: dump thread id on proc start

Augment ProcStart events with OS thread id.
This helps in scheduler locality analysis.

Change-Id: I93fea75d3072cf68de66110d0b59d07101badcb5
Reviewed-on: https://go-review.googlesource.com/7302
Reviewed-by: Keith Randall <khr@golang.org>
9 years agocmd/yacc/testdata/expr: fix handling of negative numbers
Matthew Dempsky [Wed, 11 Mar 2015 02:47:13 +0000 (19:47 -0700)]
cmd/yacc/testdata/expr: fix handling of negative numbers

Fixes #10129.

Change-Id: I9f56c483726f14b6c1909740549de236d5bf9cfb
Reviewed-on: https://go-review.googlesource.com/7340
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/internal/gc: more Node cleanups
Dave Cheney [Mon, 9 Mar 2015 22:58:01 +0000 (09:58 +1100)]
cmd/internal/gc: more Node cleanups

More cleanups to gc.Node

- make Node.Local a boolean
- make Type.Local a boolean
- reduce the size of Node.Esc to a uint8

Reducing the size of Node.Esc shaves ~45mb off the RSS compiling cmd/internal/gc on amd64

before:
        Maximum resident set size (kbytes): 659496
after:
        Maximum resident set size (kbytes): 612196

- declare gc.Funcdepth as int32
- declare Node.Funcdepth as int32

In both cases, these were previously machine specific int types. This doesn't result in
any memory saving at the moment due to struct padding.

Change-Id: Iabef8da15e962fe8b79d7fd3d402fb26ce7ec31c
Reviewed-on: https://go-review.googlesource.com/7261
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agodebug/elf: fix arm build
Dave Cheney [Tue, 10 Mar 2015 08:39:17 +0000 (19:39 +1100)]
debug/elf: fix arm build

This change adds the minimum necessary to implement applyRelocations.

For adg, this code uses the switch statement.

Change-Id: I0989daab8d0e36c2a4f6a315ced258b832744616
Reviewed-on: https://go-review.googlesource.com/7266
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoimage/jpeg: support chroma hv values other than 0x11.
Nigel Tao [Tue, 10 Mar 2015 08:01:44 +0000 (19:01 +1100)]
image/jpeg: support chroma hv values other than 0x11.

The testdata was generated by:
convert video-001.png tmp1.tga
cjpeg -quality 100 -sample 2x2,1x2,1x2 tmp1.tga > video-001.221212.jpeg
djpeg -nosmooth -targa video-001.221212.jpeg > tmp2.tga
convert tmp2.tga video-001.221212.png
rm tmp1.tga tmp2.tga

Change-Id: Ica241dfc19b3eb47ade150bf0432373c6006c38a
Reviewed-on: https://go-review.googlesource.com/7264
Reviewed-by: Rob Pike <r@golang.org>
9 years agosyscall: exec_linux.go: support platforms without SYS_DUP2
Dave Cheney [Sun, 8 Mar 2015 20:03:00 +0000 (07:03 +1100)]
syscall: exec_linux.go: support platforms without SYS_DUP2

Updates #9974

This change is in preparation for merging the arm64 platform.

Arm64 does not support SYS_DUP2 at all, so define a new constant to be
the minimum dup(2) version supported. This constant defaults to SYS_DUP2
on all existing platforms.

Change-Id: If405878105082c7c880f8541c1491970124c9ce4
Reviewed-on: https://go-review.googlesource.com/7123
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
9 years agocmd/7g, cmd/7l, cmd/go: copy 9g/9l to 7g/7l, and build as tools
Shenghou Ma [Sun, 8 Mar 2015 08:32:55 +0000 (04:32 -0400)]
cmd/7g, cmd/7l, cmd/go: copy 9g/9l to 7g/7l, and build as tools

Kick start the upstreaming of the arm64 port. The only manual
change is cmd/go/pkg.go.

Change-Id: I0607ad045486f0998c4e21654b59276ca5348069
Reviewed-on: https://go-review.googlesource.com/7075
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
Run-TryBot: Aram Hăvărneanu <aram@mgk.ro>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agogo/ast: fixed minor typo in comment
Robert Griesemer [Tue, 10 Mar 2015 16:39:04 +0000 (09:39 -0700)]
go/ast: fixed minor typo in comment

Fixes #10125.

Change-Id: I99032912650cef8e5bf124bda0a60d5899760103
Reviewed-on: https://go-review.googlesource.com/7320
Reviewed-by: Robert Griesemer <gri@golang.org>
9 years agoruntime/pprof: fix trace test
Dmitry Vyukov [Tue, 10 Mar 2015 15:44:41 +0000 (18:44 +0300)]
runtime/pprof: fix trace test

Some of the trace stacks are OS-dependent due to OS-specific code
in net package. Check these stacks only on subset of OSes.

Change-Id: If95e4485839f4120fd6395725374c3a2f8706dfc
Reviewed-on: https://go-review.googlesource.com/7300
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
9 years agoruntime: Adjust when write barriers are active
Rick Hudson [Thu, 5 Mar 2015 22:33:08 +0000 (17:33 -0500)]
runtime: Adjust when write barriers are active

Even though the world is stopped the GC may do pointer
writes that need to be protected by write barriers.
This means that the write barrier must be on
continuously from the time the mark phase starts and
the mark termination phase ends. Checks were added to
ensure that no allocation happens during a GC.

Hoist the logic that clears pools the start of the GC
so that the memory can be reclaimed during this GC cycle.

Change-Id: I9d1551ac5db9bac7bac0cb5370d5b2b19a9e6a52
Reviewed-on: https://go-review.googlesource.com/6990
Reviewed-by: Austin Clements <austin@google.com>
9 years agoruntime: remove runtime frames from stacks in traces
Dmitry Vyukov [Sat, 21 Feb 2015 18:01:40 +0000 (21:01 +0300)]
runtime: remove runtime frames from stacks in traces

Stip uninteresting bottom and top frames from trace stacks.
This makes both binary and json trace files smaller,
and also makes stacks shorter and more readable in the viewer.

Change-Id: Ib9c80ccc280504f0e235f867f53f1d2652c41583
Reviewed-on: https://go-review.googlesource.com/5523
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>

9 years agodebug/dwarf: add unit tests for line table reader
Austin Clements [Fri, 6 Mar 2015 18:26:04 +0000 (13:26 -0500)]
debug/dwarf: add unit tests for line table reader

This adds simple ELF test binaries generated by gcc and clang and
compares the line tables returned by the line table reader against
tables based on the output of readelf.

The binaries were generated with
    # gcc --version | head -n1
    gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
    # gcc -g -o line-gcc.elf line*.c

    # clang --version | head -n1
    Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
    # clang -g -o line-clang.elf line*.c

Change-Id: Id210fdc1d007ac9719e8f5dc845f2b94eed12234
Reviewed-on: https://go-review.googlesource.com/7070
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
9 years agodebug/dwarf: add support for line tables
Austin Clements [Wed, 4 Mar 2015 01:57:10 +0000 (20:57 -0500)]
debug/dwarf: add support for line tables

This implements a LineReader for line tables that parallels the
existing Reader for debug entries.

This code is partly based on the debug subrepo's fork of dwarf, but it
is a more complete (and, I believe, correct) implementation of the
spec and exposes a more general API.  While the debug subrepo's
implementation exposed only a PC-to-line function, this version
exposes the line table rows to the caller.  This way the caller can
make its own trade-offs when implementing PC-to-line (or line-to-PC),
such as whether or not to build an index for fast lookup.

Change-Id: Ie157bc817f55e940b6f2e1ae010c5a4e1f29c5c8
Reviewed-on: https://go-review.googlesource.com/6734
Reviewed-by: Nigel Tao <nigeltao@golang.org>
9 years agodebug/dwarf: factor finding unit containing entry offset
Austin Clements [Wed, 4 Mar 2015 01:53:40 +0000 (20:53 -0500)]
debug/dwarf: factor finding unit containing entry offset

This factors out the code for finding which unit contains an offset in
the "info" section.  The new code also replaces linear search with a
binary search.  The line table reader will also need this
functionality.

Change-Id: I2076e4fc6719b6f06fd2796cbbc7548ec1876cb3
Reviewed-on: https://go-review.googlesource.com/6733
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agodebug/macho, debug/pe: load DWARF line section and pass to dwarf.New
Austin Clements [Fri, 6 Mar 2015 16:05:46 +0000 (11:05 -0500)]
debug/macho, debug/pe: load DWARF line section and pass to dwarf.New

Change-Id: I1e6c6b3e2984528c0331e17755cc057e7199193e
Reviewed-on: https://go-review.googlesource.com/7071
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
9 years agodebug/elf: load .debug_line section and pass to dwarf.New
Austin Clements [Wed, 4 Mar 2015 16:04:26 +0000 (11:04 -0500)]
debug/elf: load .debug_line section and pass to dwarf.New

Change-Id: Ia6f9bd77a3d4250339dcb054edc76942864dd358
Reviewed-on: https://go-review.googlesource.com/6781
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agodebug/elf: regularize DWARF section loading
Austin Clements [Wed, 4 Mar 2015 15:58:21 +0000 (10:58 -0500)]
debug/elf: regularize DWARF section loading

Previously, different DWARF sections had relocations applied in very
different ways.  .debug_info was relocated, but only on x86-64 and 386
and using hard-coded relocation section names instead of relocation
links.  .debug_abbrev and .debug_str were never relocated (which is
excusable because they shouldn't need it).  .debug_types sections were
relocated on all architectures and found their relocation section
using a relocation link because section names could be ambiguous.

Simplify all of this so that every DWARF section that has a linked
relocation section gets those relocations applied.

This prepares this code to load .debug_line sections without the need
for yet more ad hoc relocation logic.

Change-Id: Ia00ac8e656b22f22bb31a5f6ef9b0f23cda64d19
Reviewed-on: https://go-review.googlesource.com/6780
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoimage/jpeg: support RGB JPEG images.
Nigel Tao [Thu, 5 Mar 2015 06:54:46 +0000 (17:54 +1100)]
image/jpeg: support RGB JPEG images.

The testdata was generated by:
convert video-001.png tmp1.tga
cjpeg -rgb -sample 2x2,1x1,1x1 tmp1.tga > video-001.rgb.jpeg
djpeg -nosmooth -targa video-001.rgb.jpeg > tmp2.tga
convert tmp2.tga video-001.rgb.png
rm tmp1.tga tmp2.tga

Change-Id: I5da0591b9005c1c75e807311f157d385e0e20a38
Reviewed-on: https://go-review.googlesource.com/6910
Reviewed-by: Rob Pike <r@golang.org>
9 years agocmd/internal/gc: make Node.Isddd boolean
Dave Cheney [Mon, 9 Mar 2015 05:24:07 +0000 (16:24 +1100)]
cmd/internal/gc: make Node.Isddd boolean

Convert Node.Isddd to a boolean and simplify usage.

- Node.Isddd converted to bool
- Type.Isddd converted to bool
- mkinlcall converted to take isddd as a bool
- typecheckaste converted to take isddd as a bool
- ascompatte converted to take isddd as a bool

Change-Id: I52586145619c44182bb0c2c5d80a0a3fe3e50a07
Reviewed-on: https://go-review.googlesource.com/7172
Reviewed-by: Keith Randall <khr@golang.org>
9 years agoruntime: do not share underlying envs/argv array
David Crawshaw [Tue, 3 Mar 2015 18:55:22 +0000 (13:55 -0500)]
runtime: do not share underlying envs/argv array

Removes a potential data race between os.Setenv and runtime.GOROOT,
along with a bug where os.Setenv would only sometimes change the
value of runtime.GOROOT.

Change-Id: I7d2a905115c667ea6e73f349f3784a1d3e8f810d
Reviewed-on: https://go-review.googlesource.com/6611
Reviewed-by: Keith Randall <khr@golang.org>
9 years agonet: skip unixgram tests on darwin/arm
David Crawshaw [Mon, 9 Mar 2015 13:06:11 +0000 (09:06 -0400)]
net: skip unixgram tests on darwin/arm

Change-Id: I9d2c84237f7b1c4dc2e53adf249b7518dda81a21
Reviewed-on: https://go-review.googlesource.com/7165
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
9 years agosync/atomic: skip test on darwin/arm
David Crawshaw [Sat, 7 Mar 2015 17:05:03 +0000 (12:05 -0500)]
sync/atomic: skip test on darwin/arm

Updates #7338.

Change-Id: I859a73543352dbdd13ec05efb23a95aecbcc628a
Reviewed-on: https://go-review.googlesource.com/7164
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agoencoding/xml: fix default namespace of tags
Roger Peppe [Fri, 6 Mar 2015 11:32:42 +0000 (11:32 +0000)]
encoding/xml: fix default namespace of tags

The struct XMLName sets the default namespace, but
that's not good enough for nested tags, because an
earlier tag can set the implicit parents of a subsequent
tag. This change makes sure that we always explicitly set the
namespace on a tag when possible.

See https://go-review.googlesource.com/#/c/5910/4/src/encoding/xml/marshal_test.go@628
for discussion.

Change-Id: If1afc536471c0be83e5dd80381b598476ea3f44d
Reviewed-on: https://go-review.googlesource.com/6927
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
9 years agocmd/internal/gc: more Node cleanups
Dave Cheney [Fri, 6 Mar 2015 10:18:41 +0000 (21:18 +1100)]
cmd/internal/gc: more Node cleanups

More Node cleanups, these ones touch go.y.

- convert Node.Implicit to bool
- convert Node.Used to bool

Change-Id: I85c7ff9e66cee7122b560adedc995166c874f2f2
Reviewed-on: https://go-review.googlesource.com/7124
Reviewed-by: Keith Randall <khr@golang.org>
9 years agogo/build: disable cgo by default for freebsd/arm
Dave Cheney [Sun, 8 Mar 2015 23:58:35 +0000 (10:58 +1100)]
go/build: disable cgo by default for freebsd/arm

Updates #10119

Temporarily disable cgo by default to get the freebsd/arm
builder running again.

Change-Id: I4de1f896fcac650184df77c692b102ea6fb73bba
Reviewed-on: https://go-review.googlesource.com/7125
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agoRevert "cmd/internal/obj/x86: implement -shared computation of TLS base"
Minux Ma [Sun, 8 Mar 2015 23:23:33 +0000 (23:23 +0000)]
Revert "cmd/internal/obj/x86: implement -shared computation of TLS base"

Fix the build.

This reverts commit e73981512fdc5e1128a9b17c4b9788c600db23ea.

Change-Id: I979e138991c06b3295be08212d3ce80b30c2381b
Reviewed-on: https://go-review.googlesource.com/7160
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Minux Ma <minux@golang.org>
9 years agocmd/internal/obj/x86: implement -shared computation of TLS base
Michael Hudson-Doyle [Thu, 5 Mar 2015 01:21:42 +0000 (14:21 +1300)]
cmd/internal/obj/x86: implement -shared computation of TLS base

Somehow, terribly embarrassingly, I lost part of the "re-enable
-shared on amd64" patch when rebasing before it got submitted.
This restores it and also fixes the addend to be the necessary -4.

Change-Id: If71a09121d911a863bc07f1828ef76e3a54c1074
Reviewed-on: https://go-review.googlesource.com/6802
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agonet: gofmt
Mikio Hara [Sun, 8 Mar 2015 13:44:33 +0000 (22:44 +0900)]
net: gofmt

Change-Id: Ifcf7b96e67b63a08f410a7ba21e8bf4dd20e7d8e
Reviewed-on: https://go-review.googlesource.com/7122
Reviewed-by: Minux Ma <minux@golang.org>
9 years agonet: LookupHost and Resolve{TCP,UDP,IP}Addr should use zone from getaddrinfo
Andrew Pilloud [Fri, 13 Feb 2015 04:24:47 +0000 (20:24 -0800)]
net: LookupHost and Resolve{TCP,UDP,IP}Addr should use zone from getaddrinfo

The unix and windows getaddrinfo calls return a zone with IPv6
addresses. IPv6 link-local addresses returned are only valid on the
given zone. When the zone is dropped, connections to the address
will fail. This patch replaces IP with IPAddr in several internal
resolver functions, and plumbs through the zone.

Change-Id: Ifea891654f586f15b76988464f82e04a42ccff6d
Reviewed-on: https://go-review.googlesource.com/5851
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
9 years agocmd/internal/obj/x86: fix nacl/amd64p32 build
Shenghou Ma [Sat, 7 Mar 2015 06:44:24 +0000 (01:44 -0500)]
cmd/internal/obj/x86: fix nacl/amd64p32 build

some x86 instructions (e.g. PINSRW) might store memory address in Prog.From3,
so we must also rewrite Prog.From3 on nacl.

Change-Id: I2a0da0f692ba321eba17fbc454d68aaafa133515
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/7074
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
9 years agoruntime: add argument sizes for asm functions for bytes, strings
Shenghou Ma [Sat, 7 Mar 2015 05:18:16 +0000 (00:18 -0500)]
runtime: add argument sizes for asm functions for bytes, strings

Also fixed a stack corruption bug for nacl/amd64p32.

Change-Id: I64b821b16999c296a159137d971af3870053c621
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/7073
Reviewed-by: Dave Cheney <dave@cheney.net>
9 years agoFixed wrong arguments to formatting functions
tnt [Fri, 6 Mar 2015 23:48:26 +0000 (00:48 +0100)]
Fixed wrong arguments to formatting functions

Change-Id: I11b4cf00ceeb4441b865e0de3f1674095d1c32d0
Reviewed-on: https://go-review.googlesource.com/7043
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/internal/gc: more int to bool cleanups
Dave Cheney [Fri, 6 Mar 2015 07:42:58 +0000 (18:42 +1100)]
cmd/internal/gc: more int to bool cleanups

- make paramoutheap return a bool
- convert Node.Assigned to a bool
- convert Node.Captured to a bool
- convert Node.Byval to a bool
- convert Node.Dupok to a bool
- convert Node.Wrapper to a bool
- convert Node.Reslice to a bool

Change-Id: I5b57c019f936c31d53db4db14459fb2b0aa72305
Reviewed-on: https://go-review.googlesource.com/7030
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Dave Cheney <dave@cheney.net>

9 years agotest: add testcase for gccgo-specific issue 10047.
Chris Manghane [Fri, 6 Mar 2015 18:33:07 +0000 (10:33 -0800)]
test: add testcase for gccgo-specific issue 10047.

Change-Id: Ia5115b15a79e1b2b53036646f1ed4b08225b220f
Reviewed-on: https://go-review.googlesource.com/7051
Run-TryBot: Chris Manghane <cmang@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/internal/ld: change string vars into constants where possible
Matthew Dempsky [Fri, 6 Mar 2015 19:42:53 +0000 (11:42 -0800)]
cmd/internal/ld: change string vars into constants where possible

Change-Id: Ib3d7928bbdba9358e68a326a53effe483ec208ea
Reviewed-on: https://go-review.googlesource.com/7061
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

9 years agocmd/internal/ld: remove unused files
Matthew Dempsky [Fri, 6 Mar 2015 04:01:11 +0000 (20:01 -0800)]
cmd/internal/ld: remove unused files

Change-Id: Id27861d5449cc3565bc9e80aad671229598dbeb1
Reviewed-on: https://go-review.googlesource.com/7060
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocrypto/tls: fix typo in tls handshake error
Joël Stemmer [Fri, 6 Mar 2015 13:59:12 +0000 (14:59 +0100)]
crypto/tls: fix typo in tls handshake error

Change-Id: Ia9f39250619ea6e94157efceddfb2e02d35f3ae2
Reviewed-on: https://go-review.googlesource.com/7041
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

9 years agodoc/go1.5: mention new SWIG requirement: must be 3.0.6 or later.
Ian Lance Taylor [Fri, 6 Mar 2015 17:48:08 +0000 (09:48 -0800)]
doc/go1.5: mention new SWIG requirement: must be 3.0.6 or later.

Change-Id: I18b78677b2ac9a82560d5d787225d4fc46d451d3
Reviewed-on: https://go-review.googlesource.com/7050
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/go: for gccgo run the located binary rather than using PATH
Ian Lance Taylor [Fri, 9 Jan 2015 21:33:58 +0000 (13:33 -0800)]
cmd/go: for gccgo run the located binary rather than using PATH

Change-Id: I308588db2942e7110a2be22257843931941d92f1
Reviewed-on: https://go-review.googlesource.com/2622
Reviewed-by: Peter Collingbourne <pcc@google.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agomisc/swig/callback: fix test for SWIG -cgo support
Ian Lance Taylor [Fri, 6 Mar 2015 03:58:27 +0000 (19:58 -0800)]
misc/swig/callback: fix test for SWIG -cgo support

The test used to import ../callback.  I forget why that ever worked,
but it probably had something to do with the shared libraries we used
to use with SWIG.  It doesn't work today.

Change-Id: Ib83d6c398aa46bf2fc66320b47b6e6d9897ee0b7
Reviewed-on: https://go-review.googlesource.com/7004
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years agocmd/internal/gc: make Addrtaken a bool
Dave Cheney [Thu, 5 Mar 2015 07:20:54 +0000 (18:20 +1100)]
cmd/internal/gc: make Addrtaken a bool

Node.Addrtaken is treated as a bool, so make it a bool.

I'll start to batch these changes if they are simple.

Change-Id: I02a3d1131efc4e12b78b83372c1b50f8b160c194
Reviewed-on: https://go-review.googlesource.com/6911
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/internal/gc: make Node.Hasbreak a bool
Dave Cheney [Thu, 5 Mar 2015 06:19:54 +0000 (17:19 +1100)]
cmd/internal/gc: make Node.Hasbreak a bool

Node.Hasbreak was treated like a bool, so declare it as bool.

Change-Id: Ied238356dce4da896834bd1412cc21ea56d35e1d
Reviewed-on: https://go-review.googlesource.com/6807
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/internal/gc: make Node.Readonly a bool
Dave Cheney [Thu, 5 Mar 2015 06:44:02 +0000 (17:44 +1100)]
cmd/internal/gc: make Node.Readonly a bool

Convert Node.Readonly to a bool.

Change-Id: Ide9f6f657f498d70d7b9544a38046325d7c82dc8
Reviewed-on: https://go-review.googlesource.com/6809
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/internal/gc: remove Node.Builtin
Dave Cheney [Thu, 5 Mar 2015 06:33:19 +0000 (17:33 +1100)]
cmd/internal/gc: remove Node.Builtin

Node.Builtin was occasionally set to 1, but never read.

Change-Id: Ia8a76bccc79b0f211296d50bd419860b13077ba5
Reviewed-on: https://go-review.googlesource.com/6808
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/go: use new SWIG -cgo option
Ian Lance Taylor [Wed, 4 Mar 2015 23:43:43 +0000 (15:43 -0800)]
cmd/go: use new SWIG -cgo option

This fixes SWIG to work again.  It requires SWIG 3.0.6 or later.
Earlier versions of SWIG will not work because they generate a .c file
to be compiled by [568]c, which no longer exist.  As of SWIG 3.0.6
SWIG supports a -cgo option that tells it to generate files that
import "C" and can be used with the cgo tool.  With luck this will
means that future versions of SWIG will not require changes for future
versions of Go.

Change-Id: Iad7beb196ba9dcd3e3f684196d50e5d51ed98204
Reviewed-on: https://go-review.googlesource.com/6851
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agomath/big: move "bits" operations used for Float tests into separate file
Robert Griesemer [Wed, 4 Mar 2015 22:19:08 +0000 (14:19 -0800)]
math/big: move "bits" operations used for Float tests into separate file

This is a pure code move without any semantic change.

Change-Id: I2c18efc858955d07949b1241e793232f2cf1deb9
Reviewed-on: https://go-review.googlesource.com/6821
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agoos: do not leave /go_os_test/dir after test
Alex Brainman [Thu, 5 Mar 2015 23:34:59 +0000 (10:34 +1100)]
os: do not leave /go_os_test/dir after test

Change-Id: Idb8e211bf33d2713735f9cdc868a3458ce799c97
Reviewed-on: https://go-review.googlesource.com/6913
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/internal/gc: use crypto/md5 instead of md5.go
Matthew Dempsky [Fri, 27 Feb 2015 07:05:30 +0000 (16:05 +0900)]
cmd/internal/gc: use crypto/md5 instead of md5.go

Note: for simplicity, this CL changes the identifiers assigned to
gclocals.* objects; e.g., on amd64, gclocals.ABCDEFGHIJKLMNOP is now
gclocals.HGFEDCBAPONMLKJI.  However, since Go requires all packages to
be built with the same toolchain version anyway, this should be a
non-issue.

Similarly, type hashes change somewhat, but don't seem to be exposed
to users in any detectable manner.

Change-Id: Iadb3bce472af9b022b88d52b3c4c5e4113cda330
Reviewed-on: https://go-review.googlesource.com/6232
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
9 years agocmd/internal/obj: remove use of "iota - X"
Russ Cox [Thu, 5 Mar 2015 19:04:12 +0000 (14:04 -0500)]
cmd/internal/obj: remove use of "iota - X"

This was inserted by c2go to turn each enum { ... } into one const ( ... ) block,
but it is fragile and was never intended as a long-term thing.

Change-Id: I8de8e0984b130456da70e4d59891276dfef7ac27
Reviewed-on: https://go-review.googlesource.com/6932
Reviewed-by: Rob Pike <r@golang.org>
9 years agocmd/5l etc: restore comments lost during C -> Go conversion
Russ Cox [Thu, 5 Mar 2015 18:57:36 +0000 (13:57 -0500)]
cmd/5l etc: restore comments lost during C -> Go conversion

It appears that c2go dropped comments inside struct { ... } and enum { ... }.
Restore them.

Identified missing comments by checking for comments present
in the C code but not the Go code, made a list, and then reapplied
with some mechanical help.

Missing comment finder: http://play.golang.org/p/g6qNUAo1Y0

Change-Id: I323ab45c7ef9d51e28eab3b699eb14bee1eef66b
Reviewed-on: https://go-review.googlesource.com/6899
Reviewed-by: Rob Pike <r@golang.org>