]> Cypherpunks repositories - gostls13.git/log
gostls13.git
5 years ago[dev.link] cmd/link: dostrdata and fieldtrack with new syms
Jeremy Faller [Wed, 12 Feb 2020 22:20:00 +0000 (17:20 -0500)]
[dev.link] cmd/link: dostrdata and fieldtrack with new syms

Move the wavefront past fieldtrack and dostrdata.

Change-Id: Ia327ece0202e24031fec7e1f70b40e15fbb4f728
Reviewed-on: https://go-review.googlesource.com/c/go/+/219226
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years ago[dev.link] cmd/link: remove the second result of MakeSymbolUpdater
Cherry Zhang [Wed, 12 Feb 2020 22:23:47 +0000 (17:23 -0500)]
[dev.link] cmd/link: remove the second result of MakeSymbolUpdater

With unique global indices, MakeSymbolUpdater will not change the
symbol's index. So no need to return a new index.

Change-Id: I5b4fd6a0167cc74476880bbf4382c524ecde7721
Reviewed-on: https://go-review.googlesource.com/c/go/+/219227
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
5 years ago[dev.link] cmd/link: clean up unused function and arguments
Cherry Zhang [Wed, 12 Feb 2020 22:50:21 +0000 (17:50 -0500)]
[dev.link] cmd/link: clean up unused function and arguments

Change-Id: Idacb027c5ae11e029ee4ab10f6c9a76ff435e5b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/219228
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
5 years ago[dev.link] cmd/link: add defined package symbols first, before any non-package symbols
Cherry Zhang [Tue, 11 Feb 2020 15:27:15 +0000 (10:27 -0500)]
[dev.link] cmd/link: add defined package symbols first, before any non-package symbols

Currently, the loader adds defined package symbols and
non-package symbols to the global index space object by object.
This CL changes it to add all the defined package symbols first,
then all the non-package symbols. The advantage of doing this is
that when adding package symbols, by definition they cannot be
dup to each other, so we don't need to do a name lookup when
adding them.

We still add them to the lookup table (for now), since they may
still be referenced by name (e.g. through linkname). This CL is
also a prerequisite if we want to move to not adding package
symbols to the lookup table entirely (e.g. by using
pre-generated in-file lookup table).

Also update some comments to reflect the current state.

Change-Id: Ib757e070b48a9ef6215e47dc3421fc5c055b746c
Reviewed-on: https://go-review.googlesource.com/c/go/+/219078
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
5 years ago[dev.link] cmd/link: don't read symbol name if not needed
Cherry Zhang [Fri, 7 Feb 2020 16:02:42 +0000 (11:02 -0500)]
[dev.link] cmd/link: don't read symbol name if not needed

Most of the time of goobj2.Sym.Read is spent in reading the
symbol name. Sometimes the name is not needed, so don't read
it.

This brings the linking time pretty much back to the old linker.
On my Mac,

$ time go build cmd/compile     # (new)

real 0m1.016s
user 0m1.164s
sys 0m0.297s

$ time go-tip build cmd/compile # (old)

real 0m0.980s
user 0m1.229s
sys 0m0.309s

Again, this is a bit ugly. Maybe we want to consider moving
symbol names out of Sym, to a separate section of the object
file?

Change-Id: Ia9085c15aa4d614b7eae126e71a79d6806c75055
Reviewed-on: https://go-review.googlesource.com/c/go/+/218480
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
5 years ago[dev.link] cmd/link: only read necessary fields in deadcode pass
Cherry Zhang [Fri, 7 Feb 2020 15:26:06 +0000 (10:26 -0500)]
[dev.link] cmd/link: only read necessary fields in deadcode pass

Reading unnecessary fields from object file take time, even from
memory mapping. In deadcode, we do this a alot, so only read
necessary ones. In particular, for relocations, for non-type
symbols, we only need their target symbols and reloc types to
build the dependency graph, so don't read other fields. This
should speed up the deadcode pass.

Also cache an object's number of defined package symbols, as it
is accessed a lot in resolve.

This is a bit ugly from an API point of view. It would be nice if
the compiler could figure out some fields are not used so don't
fill them.

Change-Id: I5c4e9526b8a3b0aead9fa71901a51fb214f013a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/218479
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
5 years ago[dev.link] cmd/link: clean up some fields
Cherry Zhang [Wed, 5 Feb 2020 21:52:12 +0000 (16:52 -0500)]
[dev.link] cmd/link: clean up some fields

With the new index mapping , we can clean up some fields.
Loader.max should always be equal to len(loader.objSyms) now. And
for external symbols we now give its "local index" as its index
in the payload array, so Relocs.extIdx is no longer useful.
Delete those fields.

Change-Id: If387ff9201ea0d347b954f651f5d4b4ae74937aa
Reviewed-on: https://go-review.googlesource.com/c/go/+/218478
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
5 years ago[dev.link] all: merge branch 'master' into dev.link
Cherry Zhang [Fri, 7 Feb 2020 16:51:09 +0000 (11:51 -0500)]
[dev.link] all: merge branch 'master' into dev.link

Clean merge.

Change-Id: I15c23aedf1a7fa6f728d87fd29087368c7cc3393

5 years agoRevert "cmd/link: code cleanup in macho_combine_dwarf.go"
Than McIntosh [Fri, 7 Feb 2020 16:47:23 +0000 (16:47 +0000)]
Revert "cmd/link: code cleanup in macho_combine_dwarf.go"

This reverts commit 494dd1dddceb2df533feddd483b7cb05310f1085.

Reason for revert: Not suitable for Go 1.14, will send to Go 1.15 instead.

Change-Id: Iedc04fe6a9ace29a16498046eef9420afbaf4636
Reviewed-on: https://go-review.googlesource.com/c/go/+/218482
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
5 years agocmd/link: code cleanup in macho_combine_dwarf.go
Tamir Duberstein [Tue, 14 Jan 2020 15:43:55 +0000 (10:43 -0500)]
cmd/link: code cleanup in macho_combine_dwarf.go

- remove global variables
- add missing error checks
- add missing (*os.File).Close calls
- null-check text section correctly
- reduce some variable scopes
- use bytes.Buffer instead of appended slice
- reduce integer casting

Change-Id: I4f6899923d0b26627308beb5c5c3ee9e6c68c41d
Reviewed-on: https://go-review.googlesource.com/c/go/+/214657
Reviewed-by: Than McIntosh <thanm@google.com>
5 years ago[dev.link] cmd/link: remove old host object loader vestiges
Jeremy Faller [Fri, 31 Jan 2020 19:35:37 +0000 (14:35 -0500)]
[dev.link] cmd/link: remove old host object loader vestiges

Change-Id: Ic27d1d62d1b411fa7cdf66af44f9843aa644e776
Reviewed-on: https://go-review.googlesource.com/c/go/+/217558
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years agotesting: make Cleanup work for benchmarks too.
Roger Peppe [Thu, 6 Feb 2020 08:47:20 +0000 (08:47 +0000)]
testing: make Cleanup work for benchmarks too.

Fixes #37073.

Change-Id: I6fb24a3f9d7b7adf3213ac6a8bcbf5fb43975b7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/218117
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agodoc/go1.14: disable text/template processing in HTML page
Dmitri Shuralyov [Thu, 6 Feb 2020 00:24:55 +0000 (19:24 -0500)]
doc/go1.14: disable text/template processing in HTML page

HTML pages served by the website have the option to opt-in to template
processing, by including "Template: true" in the page metadata.
This functionality is documented at
https://github.com/golang/tools/blob/403f1254bdfd3da27c92a0e9e37dd180a9a82b3c/godoc/template.go#L5-L30.

Historically, the Go 1 release notes have used template processing
to a great extent, but release notes for all subsequent major Go
releases have not.

Since this feature is generally not used and not very well known,
it tends to do more harm than good by making it possible for errors
in the template to prevent the release notes from showing up at all.

Disable this feature for Go 1.14 release notes and onwards.
We can consider enabling it when there's a stronger need for it.

Fixes #37072
Updates #37070

Change-Id: If93553d52df12544b46c4edcf3aa5eddc2a155ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/218058
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc/go1.14: quote {{ and }} in text/template note
Ian Lance Taylor [Wed, 5 Feb 2020 23:34:50 +0000 (15:34 -0800)]
doc/go1.14: quote {{ and }} in text/template note

Fixes #37070

Change-Id: I543957df264367e56c71a25bfaea5cf7935d438f
Reviewed-on: https://go-review.googlesource.com/c/go/+/217979
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
5 years agodoc/go1.14: mention better error checking in text/template
Ian Lance Taylor [Wed, 5 Feb 2020 22:12:04 +0000 (14:12 -0800)]
doc/go1.14: mention better error checking in text/template

This caused 35 test failures in Google internal code,
so it's worth mentioning in the release notes.

Updates #31810
Updates #36878
Fixes #37066

Change-Id: I2faa6bce4c7d735107eceaef7d95223844846454
Reviewed-on: https://go-review.googlesource.com/c/go/+/217978
Reviewed-by: Rob Pike <r@golang.org>
5 years agodoc/go1.14: document io/ioutil.TempDir's predictable prefix+suffix
Emmanuel T Odeke [Wed, 5 Feb 2020 19:36:00 +0000 (11:36 -0800)]
doc/go1.14: document io/ioutil.TempDir's predictable prefix+suffix

Documents io/ioutil.TempDir's new ability to create
predictable prefixes and suffixes, derived from the argument
'pattern', separated by the last '*' in it.

References: CL 198488

Updates #36878

Change-Id: I92c52fcc7d480ce74746e99e6e85a04efb87294f
Reviewed-on: https://go-review.googlesource.com/c/go/+/217780
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocrypto/x509: fix godoc for MarshalPKCS8PrivateKey
Katie Hockman [Wed, 5 Feb 2020 19:18:20 +0000 (14:18 -0500)]
crypto/x509: fix godoc for MarshalPKCS8PrivateKey

Fixes #36735

Change-Id: I93f005d78f4bfac773272995b165172461bae92f
Reviewed-on: https://go-review.googlesource.com/c/go/+/217917
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
5 years ago[dev.link] cmd/link: add telemetry
Jeremy Faller [Thu, 23 Jan 2020 17:08:21 +0000 (12:08 -0500)]
[dev.link] cmd/link: add telemetry

Create some telemetry infrastructure for measuring linker progress.

Change-Id: Id557f3bfae0c02b4d1c7174432806512aca42c86
Reviewed-on: https://go-review.googlesource.com/c/go/+/216017
Reviewed-by: Austin Clements <austin@google.com>
5 years agoruntime: rewrite a comment in malloc.go
Jerrin Shaji George [Wed, 5 Feb 2020 01:21:11 +0000 (01:21 +0000)]
runtime: rewrite a comment in malloc.go

This commit changes the wording of a comment in malloc.go that describes
how span objects are zeroed to make it more clear.

Change-Id: I07722df1e101af3cbf8680ad07437d4a230b0168
GitHub-Last-Rev: 0e909898c709a9119cea7dbd80c25d9d7a73e22b
GitHub-Pull-Request: golang/go#37008
Reviewed-on: https://go-review.googlesource.com/c/go/+/217618
Reviewed-by: Austin Clements <austin@google.com>
5 years agomath/big: reintroduce pre-Go 1.14 mention in GCD docs
Filippo Valsorda [Wed, 5 Feb 2020 20:24:30 +0000 (15:24 -0500)]
math/big: reintroduce pre-Go 1.14 mention in GCD docs

It was removed in CL 217302 but was intentionally added in CL 217104.

Change-Id: I1a478d80ad1ec4f0a0184bfebf8f1a5e352cfe8c
Reviewed-on: https://go-review.googlesource.com/c/go/+/217941
Reviewed-by: Robert Griesemer <gri@golang.org>
5 years ago[dev.link] cmd/link: remove holes from global index space
Cherry Zhang [Mon, 3 Feb 2020 17:37:35 +0000 (12:37 -0500)]
[dev.link] cmd/link: remove holes from global index space

In CL 217064, we made symbol's global index unique, but we still
reserve index space for each object file, which means we may
leave holes in the index space if the symbol is a dup or is
overwritten. In this CL, we stop reserving index spaces. Instead,
symbols are added one at a time, and only added if it does not
already exist. There is no more holes in the index space.

Change-Id: I3c4e67163c556ba1198e13065706510dac4692fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/217519
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
5 years ago[dev.link] cmd/link: remove sym.Symbol based host object support
Cherry Zhang [Sat, 1 Feb 2020 22:04:34 +0000 (17:04 -0500)]
[dev.link] cmd/link: remove sym.Symbol based host object support

We have converted all the host object readers to the new loader
based mechanism, and no longer do sym.Symbol host object loading.
Remove that support. So we don't have to take care of that in
future changes to the loader.

TODO: there are still code outside the loader than can be
removed. This CL only focuses on the loader.

Change-Id: I67dd75f631964921a7c7a6576ed95b071241484a
Reviewed-on: https://go-review.googlesource.com/c/go/+/217518
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
5 years ago[dev.link] cmd/link: simplify named symbol resolution
Cherry Zhang [Thu, 30 Jan 2020 22:27:27 +0000 (17:27 -0500)]
[dev.link] cmd/link: simplify named symbol resolution

Now that we have local-global index mappings, just use that for
symbol reference resolution.

Change-Id: I6bc5405853fe040ff21b624ccd8da7965d66ec8c
Reviewed-on: https://go-review.googlesource.com/c/go/+/217065
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
5 years ago[dev.link] cmd/link: use new sym format in pe loader
Jeremy Faller [Mon, 27 Jan 2020 20:31:41 +0000 (15:31 -0500)]
[dev.link] cmd/link: use new sym format in pe loader

Change-Id: Ib784b8432ff4355b7ff4068801a0bcfcaf108950
Reviewed-on: https://go-review.googlesource.com/c/go/+/216718
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years agodoc/go1.14: document http.ServeFile large file fix for Windows
Emmanuel T Odeke [Wed, 5 Feb 2020 19:09:34 +0000 (11:09 -0800)]
doc/go1.14: document http.ServeFile large file fix for Windows

Document that for Windows, net/http.ServeFile can now
correctly serve files >2GB after we fixed internal/poll.SendFile
to transmit files larger than the default Windows limit of 2GB.

References: CL 192518, CL 194218

Updates #36878

Change-Id: Ibefc8b2841bc0cee3a89884a680085f99d2b6928
Reviewed-on: https://go-review.googlesource.com/c/go/+/217779
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocmd/go/internal/vet: only set work.VetExplicit if the list of explicit flags is non...
Bryan C. Mills [Wed, 5 Feb 2020 18:36:53 +0000 (13:36 -0500)]
cmd/go/internal/vet: only set work.VetExplicit if the list of explicit flags is non-empty

Updates #35837
Fixes #37030

Change-Id: Ifd3435803622a8624bab55a0f3fbc8855025282f
Reviewed-on: https://go-review.googlesource.com/c/go/+/217897
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agodoc/install.html: streamline the “Test your installation” step and make it module...
Bryan C. Mills [Wed, 5 Feb 2020 15:22:07 +0000 (10:22 -0500)]
doc/install.html: streamline the “Test your installation” step and make it module-agnostic

In CL 199417, we updated “How to Write Go Code” to give a basic
introduction to modules and to include module-mode commands.
However, most new users will end up reading “Getting Started”
(doc/install.html) before “How to Write Go Code”, and we forgot to
update the handful of commands there for module mode.

Before this change, the “Test your installation” section also covered
quite a few operations beoyond merely testing the installation: it
included setting up a GOPATH, building a binary, and installing and
cleaning binaries. Those are valuable operations to learn, but they
arguably belong in “How to Write Go Code”, not “Test your
installation” — and having all that extra detail in the install
instructions may well discourage folks from further essential reading.

Rather than updating all of those operations here, I've removed them.
A companion CL will update “How to Write Go Code” to ensure that it
mentions GOPATH (as the location of the module cache and the default
install location for binaries) and 'go clean -i'.

Updates #37042

Change-Id: I157f21ccbe3896575fa1115dc821abf6c71ed15e
Reviewed-on: https://go-review.googlesource.com/c/go/+/217840
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Tyler Bui-Palsulich <tbp@google.com>
5 years agodoc/go1.14: add remarks about range inference and check removal
David Chase [Wed, 15 Jan 2020 22:19:17 +0000 (17:19 -0500)]
doc/go1.14: add remarks about range inference and check removal

Mentions CLs 174704 and 196784.

Change-Id: Ia8f821a3d90a4e08c895a6f091dbf07311e885ba
Reviewed-on: https://go-review.googlesource.com/c/go/+/214946
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
5 years agodoc: rename HTML element IDs to avoid duplicates
Dmitri Shuralyov [Wed, 5 Feb 2020 10:23:42 +0000 (05:23 -0500)]
doc: rename HTML element IDs to avoid duplicates

These 3 release notes have had an element ID collision because both
the runtime changes and changes to the package "runtime" used the
same ID. Fix it by using a "pkg-" prefix for the runtime package.

Move the "runtime-again" ID from CL 129635 to a nearby <dt> element
so that existing links to https://golang.org/doc/go1.11#runtime-again
don't break.

Fixes #37036
Updates #36878

Change-Id: Ib68d93acfac802fd84c0a57485937e45dea2064a
Reviewed-on: https://go-review.googlesource.com/c/go/+/217797
Reviewed-by: Toshihiro Shiino <shiino.toshihiro@gmail.com>
Reviewed-by: Agniva De Sarker <agniva.quicksilver@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agonet: don't check LookupHost error in TestLookupNullByte
Dmitri Shuralyov [Wed, 5 Feb 2020 00:41:48 +0000 (19:41 -0500)]
net: don't check LookupHost error in TestLookupNullByte

net.LookupHost("foo\x00bar") may resolve successfully on some networks.
Reduce the scope of the test to check only that the call doesn't panic.

Also update the test comment to reference the relevant issue.

Fixes #37031
Updates #31597

Change-Id: If175deed8121625ef507598c6145e937ccffd89e
Reviewed-on: https://go-review.googlesource.com/c/go/+/217729
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agoruntime: don't treat SIGURG as a bad signal
Ian Lance Taylor [Mon, 3 Feb 2020 23:53:53 +0000 (15:53 -0800)]
runtime: don't treat SIGURG as a bad signal

It's possible for the scheduler to try to preempt a goroutine running
on a thread created by C code just as the goroutine returns from Go code
to C code. If that happens, the goroutine will have a nil g,
which would normally cause us to enter the badsignal code.
The badsignal code will allocate an M, reset the signal handler,
and raise the signal. This is all wasted work for SIGURG,
as the default behavior is for the kernel to ignore the signal.
It also means that there is a period of time when preemption requests
are ignored, because the signal handler is reset to the default.
And, finally, it triggers a bug on 386 OpenBSD 6.2. So stop doing it.
No test because there is no real change in behavior (other than on OpenBSD),
the new code is just more efficient

Fixes #36996

Change-Id: I8c1cb9bc09f5ef890cab567924417e2423fc71f6
Reviewed-on: https://go-review.googlesource.com/c/go/+/217617
Reviewed-by: Austin Clements <austin@google.com>
5 years agointernal/bytealg: fix riscv64 offset names
Josh Bleecher Snyder [Tue, 4 Feb 2020 22:53:46 +0000 (14:53 -0800)]
internal/bytealg: fix riscv64 offset names

Vet caught that these were incorrect.

Updates #37022

Change-Id: I7b5cd8032ea95eb8e0729f6a4f386aec613c71d8
Reviewed-on: https://go-review.googlesource.com/c/go/+/217777
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agodoc: remove paragraph break for upgrading to modules
Katie Hockman [Tue, 4 Feb 2020 17:48:20 +0000 (12:48 -0500)]
doc: remove paragraph break for upgrading to modules

Previously, the release notes broke up the sentences that modules
is now ready for production use and where to file issues for
migration problems into separate paragraphs. This made it look like
the migration paragraph was about upgrading to 1.14, not to modules,
and made the reading a bit confusing. Now the entire idea is in one
paragraph.

Change-Id: I10bddfb8aba5f5909ac6842f25e3e97d505835e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/217720
Run-TryBot: Katie Hockman <katie@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agosyscall: Revert "release a js.Func object in fsCall"
Dmitri Shuralyov [Tue, 4 Feb 2020 18:07:23 +0000 (18:07 +0000)]
syscall: Revert "release a js.Func object in fsCall"

This reverts CL 217417 (commit 753d56d3642eb83848aa39e65982a9fc77e722d7).

This change was unintentionally submitted to master during the
Go 1.14 code freeze; it should be sent again for Go 1.15.

Change-Id: Ie790342f227ae3adfc5f9a90ce3abdc2c9be619b
Reviewed-on: https://go-review.googlesource.com/c/go/+/217721
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
5 years agodoc/go1.14: note that all changes to the standard library are minor
Dmitri Shuralyov [Tue, 4 Feb 2020 00:55:12 +0000 (19:55 -0500)]
doc/go1.14: note that all changes to the standard library are minor

Updates #36878

Change-Id: I1b83ff174a139734fae75f6e1e4caa9958222a18
Reviewed-on: https://go-review.googlesource.com/c/go/+/217640
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
5 years agodoc/go1.14: fix broken links
Toshihiro Shiino [Tue, 4 Feb 2020 12:23:03 +0000 (12:23 +0000)]
doc/go1.14: fix broken links

Fix broken links with missing /pkg and fix os/signal import path.

Change-Id: I4bf74c9f6e9b0e5fa96ca4d35c4ce404e07583b2
Reviewed-on: https://go-review.googlesource.com/c/go/+/217697
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
5 years agodoc/go1.14: remove TODO about Solaris port
Dmitri Shuralyov [Tue, 4 Feb 2020 15:24:20 +0000 (15:24 +0000)]
doc/go1.14: remove TODO about Solaris port

The solaris-amd64-oraclerel builder is passing for the main Go repo
(on tip and release branches for 1.13 and 1.12), and golang.org/x repos
(also on tip and release branches for 1.13 and 1.12).

The builder is still maintained as described at
https://golang.org/issue/15581#issuecomment-550368581.

Updates #36878
Updates #15581

Change-Id: Icc6f7529ca2e05bb34f09ce4363d9582e80829c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/217738
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
5 years agodoc/go1.14: remove TODO about Illumos port
Dmitri Shuralyov [Tue, 4 Feb 2020 15:15:39 +0000 (15:15 +0000)]
doc/go1.14: remove TODO about Illumos port

There is an active builder that was added in CL 201597,
and it is passing on Go tip and release-branch.go1.13
(with one failure that appears to be flaky due to being
out of memory). It's also passing on all golang.org/x repos
on tip and release-branch.go1.13. It's not configured to
run on Go 1.12 release branches.

Updates #36878
Updates #15581

Change-Id: I4ed7fc62c11a09743832fca39bd61fa0cf6e7ded
Reviewed-on: https://go-review.googlesource.com/c/go/+/217737
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
5 years agodoc/go1.14: document encoding/asn1 support for BMPString
Dmitri Shuralyov [Tue, 4 Feb 2020 00:26:31 +0000 (19:26 -0500)]
doc/go1.14: document encoding/asn1 support for BMPString

Updates #36878

Change-Id: Ib3ea1ef21c4b8ada3d354a0022a19914c1311399
Reviewed-on: https://go-review.googlesource.com/c/go/+/217637
Reviewed-by: Carlos Amedee <carlos@golang.org>
5 years agodoc/go1.14: remove TODO about Dragonfly passing
Tobias Klauser [Sun, 2 Feb 2020 13:43:54 +0000 (14:43 +0100)]
doc/go1.14: remove TODO about Dragonfly passing

Both the Dragonfly release and tip builder have been passing for a
while. The net package's interface API is working on both builders since
CL 202317 which has been re-vendored in CL 202438.

Updates #34368
Updates #36878

Change-Id: I187178b3a59f2604187af453207fb4e24a56105c
Reviewed-on: https://go-review.googlesource.com/c/go/+/217358
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc/go1.14: add missing slashes
Toshihiro Shiino [Tue, 4 Feb 2020 12:32:58 +0000 (12:32 +0000)]
doc/go1.14: add missing slashes

This saves a redirect and makes the document more consistent.

Change-Id: I67840f5dc05dffd8893a055618eb202b682a0ebc
Reviewed-on: https://go-review.googlesource.com/c/go/+/217698
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc/go1.14: mention changes to debug/dwarf
Ian Lance Taylor [Fri, 31 Jan 2020 00:38:15 +0000 (16:38 -0800)]
doc/go1.14: mention changes to debug/dwarf

Updates #36878

Change-Id: Icfbf9074c731d64198b4760e1902bbd09fcc1349
Reviewed-on: https://go-review.googlesource.com/c/go/+/217067
Reviewed-by: Austin Clements <austin@google.com>
5 years agosyscall: release a js.Func object in fsCall
Hajime Hoshi [Sun, 2 Feb 2020 05:55:29 +0000 (14:55 +0900)]
syscall: release a js.Func object in fsCall

A js.Func object in fsCall was created for each call but never
released. This CL fixes this.

Change-Id: I2e2b504cbf4fb130b8cfe890a66d3a66aadf56a4
Reviewed-on: https://go-review.googlesource.com/c/go/+/217417
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Agniva De Sarker <agniva.quicksilver@gmail.com>
Reviewed-by: Richard Musiol <neelance@gmail.com>
5 years agostd,cmd: sync go.mod with new release branches
Filippo Valsorda [Fri, 31 Jan 2020 23:41:03 +0000 (15:41 -0800)]
std,cmd: sync go.mod with new release branches

    cd src
    go get golang.org/x/sys@release-branch.go1.14-std
    go mod tidy && go mod vendor
    cd cmd
    go get golang.org/x/sys@release-branch.go1.14-cmd
    go get golang.org/x/tools@release-branch.go1.14
    go mod tidy && go mod vendor

Fixes #36851

Change-Id: Ib0a78eec90c92515b6f421972102cc8e8d0c08a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/217305
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agomath/big: simplify GCD docs
Filippo Valsorda [Fri, 31 Jan 2020 22:49:11 +0000 (14:49 -0800)]
math/big: simplify GCD docs

We don't usually document past behavior (like "As of Go 1.14 ...") and
in isolation the current docs made it sound like a and b could only be
negative or zero.

Change-Id: I0d3c2b8579a9c01159ce528a3128b1478e99042a
Reviewed-on: https://go-review.googlesource.com/c/go/+/217302
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc/go1.14: fix math/big.(*Int).GCD notes
Filippo Valsorda [Fri, 31 Jan 2020 22:54:21 +0000 (14:54 -0800)]
doc/go1.14: fix math/big.(*Int).GCD notes

GCD is a method, not a function, so the link was broken.

Change-Id: Icbb09d39959e7c71a48987b15bb82febe12c3a19
Reviewed-on: https://go-review.googlesource.com/c/go/+/217303
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agonet/http/cgi: rename a test file to be less cute
Brad Fitzpatrick [Wed, 15 Jan 2020 18:08:10 +0000 (18:08 +0000)]
net/http/cgi: rename a test file to be less cute

My fault (from CL 4245070), sorry.

Change-Id: Ib95d3170dc326e74aa74c22421c4e44a8b00f577
Reviewed-on: https://go-review.googlesource.com/c/go/+/214920
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
5 years ago[dev.link] cmd/link: make symbol's global index unique
Cherry Zhang [Tue, 28 Jan 2020 23:18:58 +0000 (18:18 -0500)]
[dev.link] cmd/link: make symbol's global index unique

Currently, when mapping symbol's local index to global index, for
duplicated and overwriting/overwritten symbols, each appearance
of the symbol gets a global index, with one being the "primary",
and others "redirect" to it through the overwrite map. Basically,
the local-global index mapping is one to one, with overwrite/
dedup happening in global index level.

This has a few drawbacks:
- All symbol accesses effectively need to query the overwrite
  map. This may hurt performance.
- For multi-level overwrites, (Y overwrites X, Z overwrites Y),
  this can get quite complicated, and we have to follow the
  redirection recursively.
- Failed to follow or to update the overwrite map leads to bugs.

In this CL, we change the index mapping mechanism so that each
symbol get a unique global index. Multiple appearances of the
same symbol get the same index. Now the local-global index
mapping is N to one. Overwrite/dedup happens directly in the
local-global mapping.

We keep both mapping directions in arrays. Each object carries
an array for its local-global mapping. The loader carries an
array mapping global index to the "primary" local index, which is
the one we should load from. This way, we can get rid of the
overwrite map, and index conversions are simply array accesses.

TODO: we still make reservation of the index space upfront, and
leave holes for dup symbols. Maybe get rid of the reservation and
holes.

Change-Id: Ia251489d5f2ff16a0b3156a71d141a70cdf03a4e
Reviewed-on: https://go-review.googlesource.com/c/go/+/217064
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
5 years agodoc/go1.14: mention new method encoding/json.Decoder.InputOffset
Ian Lance Taylor [Fri, 31 Jan 2020 00:42:21 +0000 (16:42 -0800)]
doc/go1.14: mention new method encoding/json.Decoder.InputOffset

Updates #29688
Updates #36878

Change-Id: I230889ec3f1c183dc5adbc662a39a791c0488497
Reviewed-on: https://go-review.googlesource.com/c/go/+/217123
Reviewed-by: Alexander Rakoczy <alex@golang.org>
5 years agodoc/go1.14: add crypto/tls release notes
Filippo Valsorda [Tue, 28 Jan 2020 22:37:58 +0000 (14:37 -0800)]
doc/go1.14: add crypto/tls release notes

A few minor changes that didn't feel worth mentioning:

* CL 205059: support leaving Certificates/GetCertificate nil if
  GetConfigForClient is set
* CL 205059: send the unrecognized_name alert when there are no
  available certificates
* CL 205068: add correct names for CHACHA20_POLY1305 ciphersuite constants
* CL 204046: fix CreateCRL for Ed25519 CAs
* CL 205058: add CertificateRequestInfo.Version

Change-Id: Ie820fb0c6842e669edde031132c7cda5b09e7682
Reviewed-on: https://go-review.googlesource.com/c/go/+/216759
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years ago[dev.link] all: merge branch 'master' into dev.link
Cherry Zhang [Fri, 31 Jan 2020 19:45:52 +0000 (14:45 -0500)]
[dev.link] all: merge branch 'master' into dev.link

It has been a while we have not done this.

Merge conflict resolution:
- deleted/rewritten code modified on master
  - CL 214286, ported in CL 217317
    (cmd/internal/obj/objfile.go)
  - CL 210678, it already includes a fix to new code
    (cmd/link/internal/ld/deadcode.go)
  - CL 209317, applied in this CL
    (cmd/link/internal/loadelf/ldelf.go)

Change-Id: Ie927ea6a1d69ce49e8d03e56148cb2725e377876

5 years ago[dev.link] cmd/internal/obj: emit only '/' in DWARF file names
Cherry Zhang [Fri, 31 Jan 2020 19:22:03 +0000 (14:22 -0500)]
[dev.link] cmd/internal/obj: emit only '/' in DWARF file names

Port CL 214286 to new object files. This is in preparation of
merging master branch to dev.link.

Change-Id: I8cd93908a795c03b8c44df47f66728017c542f4a
Reviewed-on: https://go-review.googlesource.com/c/go/+/217317
Reviewed-by: Jeremy Faller <jeremy@golang.org>
5 years agodoc/go1.14: move "Minor changes to the library" heading up
Dmitri Shuralyov [Fri, 31 Jan 2020 18:21:57 +0000 (13:21 -0500)]
doc/go1.14: move "Minor changes to the library" heading up

This heading was below the minor changes to the standard library.
It should be on top.

Many of the minor changes have been documented, so remove the broad
TODO comment. It is still a TODO to highlight more prominent changes
to the library, if there are any, under the "Core library" heading.

Updates #36878

Change-Id: If7fd9af9a933af917523e33fd2922c5f3c02c98b
Reviewed-on: https://go-review.googlesource.com/c/go/+/217277
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
5 years ago[dev.link] cmd/link: fix payload pointer liveness
Cherry Zhang [Thu, 30 Jan 2020 03:10:51 +0000 (22:10 -0500)]
[dev.link] cmd/link: fix payload pointer liveness

Currently, the symbol updater uses a pointer pointing to the
loader's payloads array. If the payloads slice grows (and moves),
the pointer may become stale and no longer point to the symbol's
actual payload. Specifically, consider

sb, sym := l.MakeSymbolUpdater(...)
// add a bunch of external symbols, which grows payload slice
sb.SetType(t)
l.SymType(sym) // may not return t

sb.SetType on line 3 may not have the desired effect, as
sb.extSymPayload may no longer point to the right payload. As a
result, the type we get on line 4 may be not the one we set.

Fix this by making the payload's address permanent. Once it is
allocated it will never move.

Change-Id: Iab190ea5aceb5c37f91d09ad4ffd458e881b03f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/217063
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
5 years ago[dev.link] cmd/link: correct overwrite logic
Cherry Zhang [Tue, 28 Jan 2020 21:38:38 +0000 (16:38 -0500)]
[dev.link] cmd/link: correct overwrite logic

This was mistakenly changed during the refactor in  CL 201728.
Restore the old behavior.

Change-Id: I9991859e7587f5f567bbe86ae19dede904b3a399
Reviewed-on: https://go-review.googlesource.com/c/go/+/217062
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
5 years agodoc/go1.14: fix id attribute of Testing heading
Jean de Klerk [Thu, 30 Jan 2020 00:39:26 +0000 (17:39 -0700)]
doc/go1.14: fix id attribute of Testing heading

Some tweaks based on comments from CL 216917.

Change-Id: I538ea0dfa947b53d5c4a7135c1aec912b0357083
Reviewed-on: https://go-review.googlesource.com/c/go/+/217121
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
5 years agodoc/go1.14: mention new method strconv.NumError.Unwrap
Ian Lance Taylor [Fri, 31 Jan 2020 03:22:15 +0000 (19:22 -0800)]
doc/go1.14: mention new method strconv.NumError.Unwrap

Updates #30322
Updates #36878

Change-Id: I8b33eb6a8fb7c0ecf365940a1c3ae88dc807ebcd
Reviewed-on: https://go-review.googlesource.com/c/go/+/217132
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agodoc/go1.14: mention new field go/build.Context.Dir
Ian Lance Taylor [Fri, 31 Jan 2020 00:53:42 +0000 (16:53 -0800)]
doc/go1.14: mention new field go/build.Context.Dir

Updates #34860
Updates #36168
Updates #36878

Change-Id: I484d7fea5d77d6dcd451d4fdffe0c450eed73636
Reviewed-on: https://go-review.googlesource.com/c/go/+/217124
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agogo/types: unexport Checker.LookupFieldOrMethod
Robert Griesemer [Fri, 31 Jan 2020 04:13:02 +0000 (20:13 -0800)]
go/types: unexport Checker.LookupFieldOrMethod

Implementation changes in go/types for #6977 required that internal
LookupFieldOrMethod calls had access to the current *Checker. In
order to make quick progress, I added a *Checker receiver to the
function LookupFieldOrMethod (thus making it a method), and added
a new function LookupFieldOrMethod. The plan was always to rename
that function (Checker.LookupFieldOrMethod) such that it wouldn't
be exported; with the obvious name being Checker.lookupFieldOrMethod.
But that name was already in use which is why I postponed the rename.
Eventually I forgot to clean it up. This CL fixes that with the
following renames:

Checker.lookupFieldOrMethod => Checker.rawLookupFieldOrMethod
Checker.LookupFieldOrMethod => Checker.lookupFieldOrMethod

Updates #6977.
Fixes #36916.

Change-Id: Icfafd0de9a19841ba5bd87142730fe7323204491
Reviewed-on: https://go-review.googlesource.com/c/go/+/217134
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc/go1.14: mention new log.Lmsgprefix flag
Ian Lance Taylor [Fri, 31 Jan 2020 01:32:23 +0000 (17:32 -0800)]
doc/go1.14: mention new log.Lmsgprefix flag

Updates #32062
Updates #36878

Change-Id: I06c7c9a9d253177155a6d46d58231ce26e659757
Reviewed-on: https://go-review.googlesource.com/c/go/+/217126
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agodoc/go1.14: mime: .js files now text/javascript
Ian Lance Taylor [Fri, 31 Jan 2020 00:32:14 +0000 (16:32 -0800)]
doc/go1.14: mime: .js files now text/javascript

Updates #32351
Updates #36878

Change-Id: I19f87430f4344dcc6664d8dd1b8adfc67660f099
Reviewed-on: https://go-review.googlesource.com/c/go/+/217122
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agodoc/go1.14: mention new math/bits functions Rem, Rem32, Rem64
Ian Lance Taylor [Fri, 31 Jan 2020 02:50:50 +0000 (18:50 -0800)]
doc/go1.14: mention new math/bits functions Rem, Rem32, Rem64

Updates #28970
Updates #36878

Change-Id: I9676f50516dd5b32bd4e44be136fcb9f43776edd
Reviewed-on: https://go-review.googlesource.com/c/go/+/217127
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agodoc/go1.14: mention new method mime/multipart.(*Reader).NextRawPart
Ian Lance Taylor [Fri, 31 Jan 2020 02:55:11 +0000 (18:55 -0800)]
doc/go1.14: mention new method mime/multipart.(*Reader).NextRawPart

Updates #29090
Updates #36878

Change-Id: I63f0eb583285d5c12f591cb704097cdf6a67b64f
Reviewed-on: https://go-review.googlesource.com/c/go/+/217128
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agodoc/go1.14: mention update to Unicode 12
Ian Lance Taylor [Fri, 31 Jan 2020 03:25:25 +0000 (19:25 -0800)]
doc/go1.14: mention update to Unicode 12

Updates #36878

Change-Id: Ia8441de8a04fead1f76c72f662bcb877e2265c3e
Reviewed-on: https://go-review.googlesource.com/c/go/+/217133
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agodoc/go1.14: mention new field Transport.DialTLSContext
Ian Lance Taylor [Fri, 31 Jan 2020 03:10:53 +0000 (19:10 -0800)]
doc/go1.14: mention new field Transport.DialTLSContext

Updates #21526
Updates #36878

Change-Id: Ic3ae18d31eddb9df01241cbddcc3b7b750cfaa44
Reviewed-on: https://go-review.googlesource.com/c/go/+/217130
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agodoc/go1.14: mention net/http.Header.Values, net/textproto.MIMEHeader.Values
Ian Lance Taylor [Fri, 31 Jan 2020 03:03:39 +0000 (19:03 -0800)]
doc/go1.14: mention net/http.Header.Values, net/textproto.MIMEHeader.Values

These methods are new in Go 1.14.

Updates #34799
Updates #36878

Change-Id: I063f5cb4638d7e0716e6ce2a8c3fffced51bbd34
Reviewed-on: https://go-review.googlesource.com/c/go/+/217129
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agodoc/go1.14: mention new field net/http/httptest/Server.EnableHTTP2
Ian Lance Taylor [Fri, 31 Jan 2020 03:15:15 +0000 (19:15 -0800)]
doc/go1.14: mention new field net/http/httptest/Server.EnableHTTP2

Updates #34939
Updates #36878

Change-Id: Ifa9a17b5b16bfcfbfe1d113a2b66a63ea3a6b59c
Reviewed-on: https://go-review.googlesource.com/c/go/+/217131
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agodoc/go1.14: mention go/doc.NewFromFiles and associated new data fields
Ian Lance Taylor [Fri, 31 Jan 2020 01:06:31 +0000 (17:06 -0800)]
doc/go1.14: mention go/doc.NewFromFiles and associated new data fields

Updates #23864
Updates #36878

Change-Id: I6efdaafbe5207c625643f201a5931ad735941365
Reviewed-on: https://go-review.googlesource.com/c/go/+/217125
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
5 years agodoc: document new hash/maphash package
Keith Randall [Thu, 30 Jan 2020 18:49:12 +0000 (10:49 -0800)]
doc: document new hash/maphash package

Update #36878
Update #28322

Change-Id: I793c7c4dbdd23fdecd715500e90b7cc0cbe4cea5
Reviewed-on: https://go-review.googlesource.com/c/go/+/217099
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agocmd/go.mod: sync x/crypto with std
Filippo Valsorda [Thu, 30 Jan 2020 22:18:42 +0000 (14:18 -0800)]
cmd/go.mod: sync x/crypto with std

    go get golang.org/x/crypto@v0.0.0-20200128174031-69ecbb4d6d5d
    go mod vendor
    git checkout -- vendor/golang.org/x/sys/unix/asm_linux_riscv64.s \
        vendor/golang.org/x/tools/go/analysis/passes/asmdecl/asmdecl.go

Updates #36851

Change-Id: I95c0584ede599f600da927a04f135fe64a85037e
Reviewed-on: https://go-review.googlesource.com/c/go/+/217118
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agomath/big: update comment on Int.GCD
Robert Griesemer [Thu, 30 Jan 2020 20:26:20 +0000 (12:26 -0800)]
math/big: update comment on Int.GCD

Per the suggestion https://golang.org/cl/216200/2/doc/go1.14.html#423.

Updates #28878.

Change-Id: I654d2d114409624219a0041916f0a4030efc7573
Reviewed-on: https://go-review.googlesource.com/c/go/+/217104
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc/go1.14: fix minor typo (update release notes)
Robert Griesemer [Thu, 30 Jan 2020 19:34:24 +0000 (11:34 -0800)]
doc/go1.14: fix minor typo (update release notes)

Follow-up on https://golang.org/cl/216200/2/doc/go1.14.html#423 .

Updates #36878.

Change-Id: I693a9eb05c6f1f42721a92fda46a4f3449defa24
Reviewed-on: https://go-review.googlesource.com/c/go/+/217100
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc/go1.14: document overlapping interfaces change (update release notes)
Robert Griesemer [Thu, 30 Jan 2020 05:18:16 +0000 (21:18 -0800)]
doc/go1.14: document overlapping interfaces change (update release notes)

Updates #6977.
Updates #36878.

Change-Id: I40594be85ee0a0d4b35bacc90104568d2b8a4761
Reviewed-on: https://go-review.googlesource.com/c/go/+/216997
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc/go1.14: edit "Go command" section, move zone CPU cap note
Jay Conrod [Wed, 29 Jan 2020 22:18:13 +0000 (17:18 -0500)]
doc/go1.14: edit "Go command" section, move zone CPU cap note

Minor edits to text on go command changes.

Also, moved a note about runtime respecting zone CPU caps from
Native Client section to Runtime section.

Change-Id: Ic21e59d7ffecb4b5676a841e7f3743203a82d266
Reviewed-on: https://go-review.googlesource.com/c/go/+/216878
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agodoc/go1.14.html: describe the runtime/pprof change
Hana Kim [Wed, 29 Jan 2020 22:09:28 +0000 (17:09 -0500)]
doc/go1.14.html: describe the runtime/pprof change

golang.org/cl/204636
golang.org/cl/205097

Updates #36874

Change-Id: I773868fd027e9cc2187f0a738900f0fcb7711635
Reviewed-on: https://go-review.googlesource.com/c/go/+/216877
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agodoc/go1.14: edit "Go command" section, adding note about go test -v streaming
Jean de Klerk [Wed, 29 Jan 2020 23:09:33 +0000 (16:09 -0700)]
doc/go1.14: edit "Go command" section, adding note about go test -v streaming

Change-Id: Ie88fe441521d60a4ba54ebb418860d0f71073387
Reviewed-on: https://go-review.googlesource.com/c/go/+/216917
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agogo/build: update TestImportDirNotExist to accept more detailed error strings
Bryan C. Mills [Wed, 29 Jan 2020 14:14:50 +0000 (09:14 -0500)]
go/build: update TestImportDirNotExist to accept more detailed error strings

In CL 203820, we switched go/build to use the caller's working
directory for the main module (rather than srcDir), so that go/build
resolution now respects the requirements and replacements of the main
module. When the passed-in srcDir is empty, as of that CL we use "go
list" instead of falling back to in-process (GOPATH-mode) path lookup.

Unfortunately, that broke go/build.TestImportDirNotExist when
GO111MODULE=on: the test was looking for the specific error message
produced by the in-process lookup.

This change relaxes the test to accept the error message produced by
"go list" when srcDir is empty.

Updates #34769
Updates #34860
Updates #35734
Fixes #36867

Change-Id: Id0f7814a4b7dabe8917216eb013bb4eaee283648
Reviewed-on: https://go-review.googlesource.com/c/go/+/216817
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agocmd/internal/obj/riscv,cmd/link: shorten the riscv64 call sequence
Joel Sing [Wed, 29 Jan 2020 09:14:18 +0000 (20:14 +1100)]
cmd/internal/obj/riscv,cmd/link: shorten the riscv64 call sequence

Now that the other dependent offset has been identified, we can remove the
unnecessary ADDI instruction from the riscv64 call sequence (reducing it
to AUIPC+JALR, rather than the previous AUIPC+ADDI+JALR).

Change-Id: I348c4efb686f9f71ed1dd1d25fb9142a41230b0d
Reviewed-on: https://go-review.googlesource.com/c/go/+/216798
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocmd/compile,cmd/link: fix and re-enable open-coded defers on riscv64
Joel Sing [Wed, 29 Jan 2020 09:06:54 +0000 (20:06 +1100)]
cmd/compile,cmd/link: fix and re-enable open-coded defers on riscv64

The R_CALLRISCV relocation marker is on the JALR instruction, however the actual
relocation is currently two instructions previous for the AUIPC+ADDI sequence.
Adjust the platform dependent offset accordingly and re-enable open-coded defers.

Fixes #36786.

Change-Id: I71597c193c447930fbe94ce44b7355e89ae877bb
Reviewed-on: https://go-review.googlesource.com/c/go/+/216797
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years agodoc: add the change to json.Compact in the 1.14 changelog
Daniel Martí [Wed, 22 Jan 2020 12:20:02 +0000 (12:20 +0000)]
doc: add the change to json.Compact in the 1.14 changelog

Fixes #36690.

Change-Id: Id4234ab9467270d51f0411375b71ece7f41269b2
Reviewed-on: https://go-review.googlesource.com/c/go/+/215817
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
5 years agodoc/go1.14: document RISC-V support
Brad Fitzpatrick [Tue, 28 Jan 2020 21:40:08 +0000 (21:40 +0000)]
doc/go1.14: document RISC-V support

Fixes #36708
Updates #27532

Change-Id: I9e3bb92d15825e2c4a505e1aea41b2897f18e0ff
Reviewed-on: https://go-review.googlesource.com/c/go/+/216757
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
5 years agonet/http: don't treat an alternate protocol as a known round tripper
Ian Lance Taylor [Tue, 28 Jan 2020 00:35:28 +0000 (16:35 -0800)]
net/http: don't treat an alternate protocol as a known round tripper

As of CL 175857, the client code checks for known round tripper
implementations, and uses simpler cancellation code when it finds one.
However, this code was not considering the case of a request that uses
a user-defined protocol, where the user-defined protocol was
registered with the transport to use a different round tripper.
The effect was that round trippers that worked with earlier
releases would not see the expected cancellation semantics with tip.

Fixes #36820

Change-Id: I60e75b5d0badcfb9fde9d73a966ba1d3f7aa42b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/216618
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agocmd/dist: remove riscv64 from set of incomplete ports
Brad Fitzpatrick [Tue, 28 Jan 2020 22:57:18 +0000 (22:57 +0000)]
cmd/dist: remove riscv64 from set of incomplete ports

Fixes #27532
Fixes #36853
Updates #28944

Change-Id: I4d0f212deb361c941ce7e5999e237a951c89a296
Reviewed-on: https://go-review.googlesource.com/c/go/+/216758
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Joel Sing <joel@sing.id.au>
5 years agotest: disable the live test on riscv64
Joel Sing [Tue, 28 Jan 2020 18:30:19 +0000 (05:30 +1100)]
test: disable the live test on riscv64

This test expects that open-coded defers are enabled, which is not currently
the case on riscv64.

Updates issue #27532 and #36786.

Change-Id: I94bb558c5b0734b4cfe5ae12873be81026009bcf
Reviewed-on: https://go-review.googlesource.com/c/go/+/216777
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agoruntime: ensure that searchAddr always refers to inUse memory
Michael Anthony Knyszek [Tue, 28 Jan 2020 19:59:19 +0000 (19:59 +0000)]
runtime: ensure that searchAddr always refers to inUse memory

This change formalizes an assumption made by the page allocator, which
is that (*pageAlloc).searchAddr should never refer to memory that is not
represented by (*pageAlloc).inUse. The portion of address space covered
by (*pageAlloc).inUse reflects the parts of the summary arrays which are
guaranteed to mapped, and so looking at any summary which is not
reflected there may cause a segfault.

In fact, this can happen today. This change thus also removes a
micro-optimization which is the only case which may cause
(*pageAlloc).searchAddr to point outside of any region covered by
(*pageAlloc).inUse, and adds a test verifying that the current segfault
can no longer occur.

Change-Id: I98b534f0ffba8656d3bd6d782f6fc22549ddf1c2
Reviewed-on: https://go-review.googlesource.com/c/go/+/216697
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years agosrc/go.mod: import x/crypto/cryptobyte security fix for 32-bit archs
Dmitri Shuralyov [Tue, 28 Jan 2020 18:20:57 +0000 (13:20 -0500)]
src/go.mod: import x/crypto/cryptobyte security fix for 32-bit archs

cryptobyte: fix panic due to malformed ASN.1 inputs on 32-bit archs

When int is 32 bits wide (on 32-bit architectures like 386 and arm), an
overflow could occur, causing a panic, due to malformed ASN.1 being
passed to any of the ASN1 methods of String.

Tested on linux/386 and darwin/amd64.

This fixes CVE-2020-7919 and was found thanks to the Project Wycheproof
test vectors.

Change-Id: I8c9696a8bfad1b40ec877cd740dba3467d66ab54
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/645211
Reviewed-by: Katie Hockman <katiehockman@google.com>
Reviewed-by: Adam Langley <agl@google.com>
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/216677
Run-TryBot: Katie Hockman <katie@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

x/crypto/cryptobyte is used in crypto/x509 for parsing certificates.
Malformed certificates might cause a panic during parsing on 32-bit
architectures (like arm and 386).

Change-Id: I840feb54eba880dbb96780ef7adcade073c4c4e3
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/647741
Reviewed-by: Katie Hockman <katiehockman@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/216680
Reviewed-by: Katie Hockman <katie@golang.org>
5 years ago[dev.link] cmd/link: port xcoff to new loader syntax
Jeremy Faller [Thu, 23 Jan 2020 19:41:34 +0000 (14:41 -0500)]
[dev.link] cmd/link: port xcoff to new loader syntax

Change-Id: I074dd726640f2bcf7aa50b5e10e0b3a278489cd7
Reviewed-on: https://go-review.googlesource.com/c/go/+/216038
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years ago[dev.link] cmd/link: remove flag FlagNewLdElf
Jeremy Faller [Thu, 23 Jan 2020 15:39:13 +0000 (10:39 -0500)]
[dev.link] cmd/link: remove flag FlagNewLdElf

No real reason to keep the old code around as the new stuff is working
just fine.

Change-Id: I5e886f8274344738663a0ead181c5d58d9f5a45f
Reviewed-on: https://go-review.googlesource.com/c/go/+/215997
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years ago[dev.link] cmd/link: use new sym builders in macho loader
Jeremy Faller [Wed, 22 Jan 2020 20:24:39 +0000 (15:24 -0500)]
[dev.link] cmd/link: use new sym builders in macho loader

Change-Id: Ia055559d1eb12736d0bdd5a30103cd4b9788d36e
Reviewed-on: https://go-review.googlesource.com/c/go/+/215917
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years agocmd/compile: disable open-coded defers on riscv64
Joel Sing [Sun, 26 Jan 2020 22:32:52 +0000 (09:32 +1100)]
cmd/compile: disable open-coded defers on riscv64

Open-coded defers are currently broken on riscv64 - disable them for the
time being. All of the standard package tests now pass on linux/riscv64.

Updates issue #27532 and #36786

Change-Id: I20fc25ce91dfad48be32409ba5c64ca9a6acef1d
Reviewed-on: https://go-review.googlesource.com/c/go/+/216517
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocmd/internal/obj/riscv: use signed immediates for U-instructions
Joel Sing [Wed, 22 Jan 2020 16:38:31 +0000 (03:38 +1100)]
cmd/internal/obj/riscv: use signed immediates for U-instructions

On RISCV64, the U-instructions (AUIPC and LUI) take 20 bits, append 12 bits
of zeros and sign extend to 64-bits. As such, the 20 bit immediate value is
signed not unsigned.

Updates #27532

Change-Id: I725215a1dc500106dbfdc0a4425f3c0b2a6f411e
Reviewed-on: https://go-review.googlesource.com/c/go/+/216257
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years agocmd/compile/internal/ssa/gen: avoid importing internal riscv64 packages
Joel Sing [Mon, 27 Jan 2020 12:55:30 +0000 (23:55 +1100)]
cmd/compile/internal/ssa/gen: avoid importing internal riscv64 packages

Duplicate the register definitions and names to avoid importing the
cmd/internal/obj/riscv64 package. This makes it possible to build compiler rules
with a stable Go tool chain.

Fixes #36663

Change-Id: I09116a97bb037ca1bc00073306a82bb88862b1e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/216518
Reviewed-by: Cherry Zhang <cherryyz@google.com>
5 years agodoc/go1.14: remove TODO from Tools section of release notes
Jay Conrod [Mon, 27 Jan 2020 20:37:11 +0000 (15:37 -0500)]
doc/go1.14: remove TODO from Tools section of release notes

Change-Id: I682193eb06b55eb3e9392146579f57a928c728d0
Reviewed-on: https://go-review.googlesource.com/c/go/+/216598
Reviewed-by: Bryan C. Mills <bcmills@google.com>
5 years agodoc/go1.14: go command behavior with GO111MODULE=on outside modules
Jay Conrod [Mon, 27 Jan 2020 20:29:29 +0000 (15:29 -0500)]
doc/go1.14: go command behavior with GO111MODULE=on outside modules

Hopefully this won't affect many people, but it's a substantial change
in behavior for a specific case, so it's probably worth mentioning.

Updates #32027

Change-Id: I61cd50e93d0199e94b011cc90150e072b6bb10ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/216597
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

5 years agocmd/compile: on PPC64, fold offset into some loads/stores only when offset is 4-aligned
Cherry Zhang [Fri, 24 Jan 2020 19:11:04 +0000 (14:11 -0500)]
cmd/compile: on PPC64, fold offset into some loads/stores only when offset is 4-aligned

On PPC64, MOVWload, MOVDload, and MOVDstore are assembled to a
"DS from" instruction which requiers the offset is a multiple of
4. Only fold offset to such instructions if it is a multiple of 4.

Fixes #36723.

"GOARCH=ppc64 GOOS=linux go build -gcflags=all=-d=ssa/check/on std cmd"
passes now.

Change-Id: I67f2a6ac02f0d33d470f68ff54936c289a4c765b
Reviewed-on: https://go-review.googlesource.com/c/go/+/216379
Reviewed-by: Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
5 years agodoc/go1.14: note that module support is ready for production use
Bryan C. Mills [Fri, 24 Jan 2020 15:26:24 +0000 (10:26 -0500)]
doc/go1.14: note that module support is ready for production use

The public proxy and checksum database launched with Go 1.13 have been
running smoothly, pkg.go.dev is serving module-aware documentation,
and in 1.14 we have improved the vendoring workflow and finished
Subversion support to reach parity with GOPATH mode for users of those
features, updated documentation (including the “How to Write Go Code”
intro document) and published blog posts describing common modes of
usage, and improved the migration path for existing v2+ modules by
making version resolution less aggressive about "+incompatible" major
versions.

We (always) have more fit-and-finish work to do, but at this point we
believe that module mode will provide a better user experience than
GOPATH mode for most users, including in production use.

Change-Id: I897e0a43e3aebe4c90553c414337a46bfc9c2bef
Reviewed-on: https://go-review.googlesource.com/c/go/+/216317
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Katie Hockman <katie@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agodoc/go1.14: document the new GOINSECURE variable
Bryan C. Mills [Fri, 24 Jan 2020 19:57:41 +0000 (14:57 -0500)]
doc/go1.14: document the new GOINSECURE variable

Fixes #36746

Change-Id: Iab9eaceb743ee52c82e7645216a671362189a021
Reviewed-on: https://go-review.googlesource.com/c/go/+/216380
Reviewed-by: witchard <ben.witchard@gmail.com>
Reviewed-by: Russ Cox <rsc@golang.org>
5 years agostrconv: stop describing Unicode graphic characters as non-ASCII
Ian Lance Taylor [Sun, 26 Jan 2020 16:12:58 +0000 (08:12 -0800)]
strconv: stop describing Unicode graphic characters as non-ASCII

Fixes #36778

Change-Id: I3c4ce100fc219bda0ff1d7a086c2309ed695691d
Reviewed-on: https://go-review.googlesource.com/c/go/+/216478
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
5 years agocmd/vendor: provide riscv64 support in tools/go/analysis/passes/asmdecl
Joel Sing [Fri, 24 Jan 2020 15:55:01 +0000 (02:55 +1100)]
cmd/vendor: provide riscv64 support in tools/go/analysis/passes/asmdecl

Manually add riscv64 support.

Currently being added via https://go-review.googlesource.com/c/tools/+/216337.

Updates #27532

Change-Id: I0e1f7c0eeca4e85ae588f427eff818bb7946a851
Reviewed-on: https://go-review.googlesource.com/c/go/+/216262
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
5 years agovendor: provide golang.org/x/sys/cpu/cpu_riscv64.go
Joel Sing [Fri, 24 Jan 2020 15:39:59 +0000 (02:39 +1100)]
vendor: provide golang.org/x/sys/cpu/cpu_riscv64.go

Manually provide golang.org/x/sys/cpu/cpu_riscv64.go until such time
as this code can be updated, post release.

This already exists in x/sys/cpu via:

  https://go-review.googlesource.com/c/sys/+/206860

Update #27532

Change-Id: I57d598ef737642f9c3aa7b280c6c680477ae7633
Reviewed-on: https://go-review.googlesource.com/c/go/+/216261
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>