1
0
mirror of https://github.com/golang/go synced 2024-11-14 23:50:28 -07:00
Commit Graph

45065 Commits

Author SHA1 Message Date
shaquilleq
813c9523a9 doc/go1.15: add release notes for fmt
Updates #37419

Change-Id: I344dd93ed7a75f88e7f937c80f5a6ad6c0327a07
Reviewed-on: https://go-review.googlesource.com/c/go/+/236417
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-06-05 22:52:06 +00:00
Cherry Zhang
6bf51c3406 [dev.link] all: merge branch 'master' into dev.link
Merge conflicts are mostly recently changed nm/objdump output
format and its tests. Resolved easily (mostly just using the
format on master branch).

Change-Id: I99d8410a9a02947ecf027d9cae5762861562baf5
2020-06-05 16:55:43 -04:00
Michael Matloob
d282b0f112 doc/go1.15: add release notes for regexp
Updates #37419

Change-Id: I340efe55b9dc41bb9ef6c9f0ec158d58a9445864
Reviewed-on: https://go-review.googlesource.com/c/go/+/236738
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-06-05 19:17:58 +00:00
Brad Fitzpatrick
3c35eec618 runtime: clarify wording/grammar on GODEBUG=invalidptr
Change-Id: Ia06b6be262922991bae3528e7b061d1db9e4c3c0
Reviewed-on: https://go-review.googlesource.com/c/go/+/236679
Reviewed-by: Austin Clements <austin@google.com>
2020-06-05 19:11:07 +00:00
Rebecca Stambler
325540922a doc: update contribution guide to make it friendlier for x/ repos
The current contributor documentation is tailored towards contributors
to golang/go, but we have a number of increasingly popular x/ repos.
In this CL, I tried to generalize the language to make it apply to any
repository.

Also, I fixed an old link I noticed in editors.html.

Change-Id: Id9d8e448262ed8c3a67f49be5d554ca29df9d3c1
Reviewed-on: https://go-review.googlesource.com/c/go/+/234899
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2020-06-05 17:27:32 +00:00
Ian Lance Taylor
b44bf986a2 doc/go1.15: mention new debug/pe constants
The constants were added in CL 222637.

For #37419

Change-Id: Iae662d677d31c44a7560399ef6771f520c1f7663
Reviewed-on: https://go-review.googlesource.com/c/go/+/236682
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-06-05 17:09:20 +00:00
Dominik Honnef
890707f88b doc/go1.15: add release notes for io/ioutil
For #37419.

Change-Id: I6c7a7e9c91f7691a6ba2a7ac4dad92c64b48962f
Reviewed-on: https://go-review.googlesource.com/c/go/+/236658
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-06-05 16:56:47 +00:00
Russ Cox
b6faed1326 cmd/asm, cmd/compile, doc: document -spectre flags
Most of the docs are in the new wiki page
https://golang.org/wiki/Spectre.

Updates #37419.

Change-Id: I6e8f76670593c089de895e1665b41d874f879df9
Reviewed-on: https://go-review.googlesource.com/c/go/+/236599
Reviewed-by: Austin Clements <austin@google.com>
2020-06-05 16:54:48 +00:00
Austin Clements
76f233fe04 doc/go1.15: exclude spaces from <code> block
Per the note at the top of go1.15.html.

Updates #37419.

Change-Id: Ia6917347ca1e3ebe8c55f9c0ec74e49ff481a64f
Reviewed-on: https://go-review.googlesource.com/c/go/+/236719
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-06-05 16:51:24 +00:00
Roland Shoemaker
60cbff6f19 crypto/x509: match cgo and Apple behavior in domain fallback of macOS roots
This change makes the direct call darwin loadSystemRoots implementation
match the existing cgo implementation, which in turn _mostly_ matches
the Apple implementation. The main change here is that when
SecTrustSettingsCopyTrustSettings the error is ignored, and can either
cause a fallback to check admin trust settings, or cause the
certificate to be marked kSecTrustSettingsResultUnspecified.

As well as updating the implementation to match the cgo one, this
change also updates the documentation of how the fallbacks work and
how they match the Apple implementations. References are made to the
Apple source where appropriate. This change does not update the
existing comments in the cgo implementation, since the goal is to
delete that code once the direct call implementation is matured.

Updates #38888

Change-Id: Id0344ea9d2eede3b715f341e9cbd3c1c661b7a90
Reviewed-on: https://go-review.googlesource.com/c/go/+/233360
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2020-06-05 16:50:47 +00:00
Cherry Zhang
a38f29ad61 doc/go1.15: add release notes for RISC-V port
Change-Id: I35045925cca942980419829fe07e5e0f38cb7a91
Reviewed-on: https://go-review.googlesource.com/c/go/+/236338
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-06-05 15:35:53 +00:00
Tobias Klauser
4489f4bc84 cmd/compile/internal: gofmt
Change-Id: I67a4375d8eb976d48e4a57e482390f473658b4b8
Reviewed-on: https://go-review.googlesource.com/c/go/+/236457
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-06-05 05:00:28 +00:00
Katie Hockman
fb86c70bda crypto/tls: set CipherSuite for VerifyConnection
The ConnectionState's CipherSuite was not set prior
to the VerifyConnection callback in TLS 1.2 servers,
both for full handshakes and resumptions.

Change-Id: Iab91783eff84d1b42ca09c8df08e07861e18da30
Reviewed-on: https://go-review.googlesource.com/c/go/+/236558
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2020-06-04 20:16:53 +00:00
Cherry Zhang
78b96db04e [dev.link] cmd/link: reuse slice memory in deadcode pass
Reuse slice memory in the deadcode pass, reduce allocations.

Linking cmd/compile,

name           old alloc/op   new alloc/op   delta
Deadcode_GC      2.10MB ± 0%    1.41MB ± 0%  -32.61%  (p=0.008 n=5+5)

name           old allocs/op  new allocs/op  delta
Deadcode_GC       8.46k ± 0%     5.55k ± 0%  -34.45%  (p=0.008 n=5+5)

Change-Id: Ib9ba0928d68a65879007218697712b53acd3c5c5
Reviewed-on: https://go-review.googlesource.com/c/go/+/236566
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>
2020-06-04 19:14:12 +00:00
Cherry Zhang
7179e426e2 [dev.link] cmd/link: rewrite heap algorithm
Instead of using container/heap package, implement a simple
specialized heap algorithm for the work queue in the deadcode
pass, to avoid allocations and function pointer calls.

Linking cmd/compile,

name           old time/op    new time/op    delta
Deadcode_GC      59.8ms ± 4%    42.2ms ± 4%  -29.45%  (p=0.008 n=5+5)

name           old alloc/op   new alloc/op   delta
Deadcode_GC      3.53MB ± 0%    2.10MB ± 0%  -40.57%  (p=0.008 n=5+5)

name           old allocs/op  new allocs/op  delta
Deadcode_GC        187k ± 0%        8k ± 0%  -95.48%  (p=0.008 n=5+5)

Change-Id: Ibb21801d5b8e4a7eaf429856702e02720cd1772f
Reviewed-on: https://go-review.googlesource.com/c/go/+/236565
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>
2020-06-04 19:13:42 +00:00
Cherry Zhang
e4d6bfdbdf [dev.link] cmd/link: compare type descriptors for interface satisfaction analysis
Currently, in the deadcode pass, when checking whether a defined
method satisfies an interface, it compares the string
representation of the defined method and the interface method.
In fact, it can simply compare the method name and the type
descriptor (as we do in runtime). Make it so.

Change-Id: Ideb2b2410e5eedcd20ac31e3af41f5499fc90225
Reviewed-on: https://go-review.googlesource.com/c/go/+/236564
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>
2020-06-04 18:53:03 +00:00
Austin Clements
07ced37013 syscall: document float arguments and results on windows/amd64
Updates #6510.
Updates #37273.

Change-Id: Id2732fcff0a0c5e4a324cd33ef995c7e528f5e1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/236562
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-06-04 17:50:16 +00:00
Austin Clements
7e47757324 syscall: hide internal comment from Syscall documentation
There's a comment on the Syscall function that's supposed to be an
internal implementation note, but since it's not separated from the
function definition, it appears in godoc. Add a blank line to prevent
this.

Change-Id: Iba307f1cc3844689ec3c6d82c21d441852e35bca
Reviewed-on: https://go-review.googlesource.com/c/go/+/236561
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-06-04 17:50:15 +00:00
Austin Clements
9d715e0bff doc/go1.15: 1.15 supports OpenBSD 6.7 on arm and arm64
Change-Id: Ibea6fbb73abdb7201855e80967120c07484d6460
Reviewed-on: https://go-review.googlesource.com/c/go/+/236557
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-06-04 17:50:14 +00:00
Cherry Zhang
7bc3b6e5e4 [dev.link] cmd/link: use fingerprint as package hash
Now the compiler-generated fingerprint is a hash of the export
data. We don't need to hash it ourselves in the linker. And the
linker doesn't need to read export data at all.

Fixes #33820.

Change-Id: I54bf3ebfd0f0c72aa43a352d7b2e0575dd62970d
Reviewed-on: https://go-review.googlesource.com/c/go/+/236119
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>
2020-06-04 16:06:33 +00:00
Cherry Zhang
7795523910 [dev.link] cmd/compile: use hash of export data as fingerprint
Currently, the compiler generates a fingerprint for each package,
which is used by the linker for index consistency check.

When building plugin or shared object, currently the linker also
generates a hash, by hashing the export data. At run time, when
a package is referenced by multiple DSOs, this hash is compared
to ensure consistency.

It would be good if we can unify this two hashes. This way, the
linker doesn't need to read the export data (which is intended
for the compiler only, and is not always available for the
linker). The export data hash is sufficient for both purposes.
It is consistent with the current hash geneated by the linker.
And the export data includes indices for exported symbols, so its
hash can be used to catch index mismatches.

Updates #33820.

Change-Id: I2bc0d74930746f54c683a10dfd695d50ea3f5a38
Reviewed-on: https://go-review.googlesource.com/c/go/+/236118
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2020-06-04 16:06:18 +00:00
Cherry Zhang
4cc043d883 [dev.link] cmd/link: remove safe mode
Safe mode in the compiler is removed in CL 142717 in Go 1.12. I
think we can delete safe mode from the linker as well.

Change-Id: I201e84fca3a566a1bb84434ab4d504516160ac4e
Reviewed-on: https://go-review.googlesource.com/c/go/+/236117
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>
2020-06-04 16:05:56 +00:00
joshuabezaleel
b371f189df io/ioutil: update WriteFile to clarify it does not change permissions if the file exists.
The existing documentation of WriteFile does not make it clear for
non-native English speakers that it will not change the permissions if
the file already exists before.

Fixes #35711

Change-Id: If861c3e3700957fc9ac3d5313351c57d399d3f58
Reviewed-on: https://go-review.googlesource.com/c/go/+/218417
Reviewed-by: Rob Pike <r@golang.org>
2020-06-04 10:53:46 +00:00
Tobias Klauser
bffb8818e7 all: fix dead links to inferno-os bitbucket repository
Generated using:

  perl -i -npe 's#inferno-os/src/default#inferno-os/src/master#' $(git grep -l "inferno-os/src/default" | grep -v vendor)

Change-Id: I4b6443bd09a8ea4c8aaeb40a1c73520d1f7ca648
Reviewed-on: https://go-review.googlesource.com/c/go/+/235821
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Austin Clements <austin@google.com>
2020-06-04 07:25:06 +00:00
Keith Randall
f72d7cfc8f cmd/compile: add interface equality tests
Add interfaces which differ in type. Those used so far only
differ in value, not type.

These additional tests are needed to generate a failure
before CL 236278 went in.

Update #8606

Change-Id: Icdb7647b1973c2fff7e5afe2bd8b8c1b384f583e
Reviewed-on: https://go-review.googlesource.com/c/go/+/236418
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-06-04 06:21:55 +00:00
Julie Qiu
bdf76ca045 doc/go1.15: add release notes for time
Updates #37419

Change-Id: I2018b55f335400070bfa3573adab9549a5bf6a1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/236158
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-06-04 03:50:46 +00:00
Julie Qiu
cb5fad79d0 doc/go1.15: add release notes for strconv
Updates #37419

Change-Id: Ic72bf0da914fa8a56570750b8fd4b4d09d2ed075
Reviewed-on: https://go-review.googlesource.com/c/go/+/236157
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-06-04 03:50:41 +00:00
David Chase
429d2c548d runtime: make runtime-gdb.py tolerant of creatively-named gdb versions
"Fedora" and "Red Hat" are not numbers, it turns out.
Don't rely on version numbers, instead use a regexp to
handle variation across the 2 patterns thus far observed
for gdb-generated Go type names.

Change-Id: I18c81aa2848265a47daf1180d8f6678566ae3f19
Reviewed-on: https://go-review.googlesource.com/c/go/+/236280
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-06-03 22:07:42 +00:00
Katie Hockman
23dcee6464 crypto/tls: test that Clone copies session ticket key fields
Updates #25256

Change-Id: If16c42581f1cf3500fd7fd01c915e487f8025e55
Reviewed-on: https://go-review.googlesource.com/c/go/+/235922
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2020-06-03 19:23:34 +00:00
Cherry Zhang
73dd74a9fe cmd/internal/goobj2: add referenced symbol names to object file
Currently, for symbols defined in other packages and referenced
by index, we don't record its name in the object file, as the
linker doesn't need the name, only the index. As a consequence,
tools like objdump and nm also don't know the referenced symbol
names and cannot dump it properly.

This CL adds referenced symbol names to the object file. So the
object file is self-contained. And tools can retrieve referenced
symbol names properly.

Tools now should work as good for new object files as for old
object files.

Fixes #38875.

Change-Id: I16c685c1fd83273ab1faef474e19acf4af46396f
Reviewed-on: https://go-review.googlesource.com/c/go/+/236168
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2020-06-03 19:20:56 +00:00
Cherry Zhang
b7717e4634 Revert "cmd/internal/goobj: add index to symbol name for indexed symbols"
This reverts CL 229246.

For new indexed object files, in CL 229246 we added symbol index
to tools (nm, objdump) output. This affects external tools that
parse those outputs. And the added index doesn't look very nice.
In this release we take it out. For future releases we may
introduce a flag to tools (nm, objdump) and optionally dump the
symbol index.

For refererenced (not defined) indexed symbols, currently the
symbol is still referenced only by index, not by name. The next
CL will make the object file self-contained, so tools can dump
the symbol names properly (as before).

For #38875.

Change-Id: I07375e85a8e826e15c82fa452d11f0eaf8535a00
Reviewed-on: https://go-review.googlesource.com/c/go/+/236167
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-06-03 19:20:41 +00:00
Keith Randall
9984ef824c cmd/compile: test that equality is evaluated in order
Make sure that we compare fields of structs and elements of arrays in order,
with proper short-circuiting.

Update #8606

Change-Id: I0a66ad92ea0af7bcc56dfdb275dec2b8d7e8b4fe
Reviewed-on: https://go-review.googlesource.com/c/go/+/236147
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-06-03 19:07:55 +00:00
Katie Hockman
66e35c995b crypto/tls: fix duplicate calls to VerifyConnection
Also add a test that could reproduce this error and
ensure it doesn't occur in other configurations.

Fixes #39012

Change-Id: If792b5131f312c269fd2c5f08c9ed5c00188d1af
Reviewed-on: https://go-review.googlesource.com/c/go/+/233957
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2020-06-03 19:01:50 +00:00
Than McIntosh
09e791feb1 cmd/link: new DWARF line table test case
Add a test case for an issue with how Go emits DWARF line tables,
specifically relating to the line table "end sequence" operator.

Updates #38192.

Change-Id: I878b262e6ca6c550c0e460c3d5a1969ac4a2c31b
Reviewed-on: https://go-review.googlesource.com/c/go/+/235917
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2020-06-03 18:03:41 +00:00
Keith Randall
f98b9ae07c Revert "cmd/compile: improve equality algs for arrays of interfaces"
This reverts commit 7eab9506c9.

Reason for revert: Undoing to get back to semantics discussed in #8606.

Change-Id: If0cd7518c10c37a81fdbb4ae112239e04c0b1448
Reviewed-on: https://go-review.googlesource.com/c/go/+/236278
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-06-03 17:38:23 +00:00
Keith Randall
7f349e82a2 Revert "cmd/compile: improve generated eq algs for structs containing interfaces"
This reverts commit 1cc7be89a9.

Reason for revert: Undoing to get back to semantics discussed in #8606.

Change-Id: Ib44a2e79cf113b3d15c3546cd8aa6fc27860819e
Reviewed-on: https://go-review.googlesource.com/c/go/+/236146
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-06-03 17:38:12 +00:00
Than McIntosh
7a2632e11d doc/go1.15: add release notes for plugin
Add a blurb to the release notes mentioning that the
linker now supports DWARF generation for -buildmode=plugin,
and that plugin builds work now for freebsd/amd64.

Updates #37419.

Change-Id: I84da7a52af84a9d765f73ca7ea525e7af8d64f05
Reviewed-on: https://go-review.googlesource.com/c/go/+/236162
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-06-03 17:30:11 +00:00
David Chase
3949cae441 runtime: repair gdb printing fix for 7.12, 8.{1,2,3}.1, 9.2
Hand-verified for listed gdb versions.  Gdb (apparently)
changed the way it names certain Go types, and this change
broke the pretty-printer-activating code in runtime-gdb.py

runtime-gdb_test.go now checks channel, map, string, and slice
printing unconditionally (i.e., no opt-out for old versions).

Updates #39368.

Change-Id: I98d72e1291c66bd40d970990e1a377ff2ed0c5d2
Reviewed-on: https://go-review.googlesource.com/c/go/+/236164
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-06-03 16:27:49 +00:00
Austin Clements
9e56bcb9fe doc/go1.15: runtime release notes
Change-Id: Ie37e993e840df2c063dee98fa3f6eca8e8713ca3
Reviewed-on: https://go-review.googlesource.com/c/go/+/236177
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-06-03 16:05:37 +00:00
Jeremy Faller
086828ac55 [dev.link] cmd/link: make addgotsym architecture agnostic
Change-Id: Icb64df32ef6599260a0cd3987a8afe98024da539
Reviewed-on: https://go-review.googlesource.com/c/go/+/235277
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2020-06-03 15:52:53 +00:00
fanzha02
5aaeda19c1 cmd/internal/obj/arm64: fix typos in document
The current document mismatches Go syntax loads a signed-byte
instruction "MOVB" with GNU syntax loads an 64bit double-word
instruction "ldr". This is just a typo in the document, the
assembler has the correct encoding. This patch fix this error.

Fixes #39367

Change-Id: Idb8f65ca540514ee5bc8f07073e756838710ba93
Reviewed-on: https://go-review.googlesource.com/c/go/+/236217
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-06-03 14:51:34 +00:00
Than McIntosh
58f017bcea cmd/{compile,link}: fix problem with DWARF end_sequence ops
During DWARF line table emission in the linker, prior to issuing a
DW_LNE_end_sequence op to mark the end of the line table for a
compilation unit, advance the PC to produce an address beyond the last
text address in the unit (this is required by the DWARF standard).
Because of the way that GDB interprets end-sequence ops, we were
effectively losing the last row in the line table for each unit, which
degraded the debugging experience.

This problem has been around for a while, but has surfaced recently
due to changes in line table generation. Prior to Go 1.14, the DWARF
line table was emitted entirely in the linker, and a single monolithic
line table was created for each Go package (including functions from
assembly). In 1.14 we moved to having the compiler emit line table
fragments for each function, and having the linker stitch together the
fragments. As part of this change we moved to a model in which each
"go tool compile/asm" output has its own DWARF line table instance,
meaning that there are many more "end sequence" ops, which made the
problem more visible.

Fixes #38192.

Change-Id: Ic29e2f6e0ac952360c81fcba5268ad70b2b44184
Reviewed-on: https://go-review.googlesource.com/c/go/+/235739
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-06-03 14:08:41 +00:00
Than McIntosh
9326d71874 doc/go1.15: add release notes for new linker
Add a blurb to the release notes describing improvements made to the
Go linker in the most recent development cycle.

Updates #37419.

Change-Id: I3b870f0c00efc0b7b33aab2631d8c4e1c273922d
Reviewed-on: https://go-review.googlesource.com/c/go/+/236159
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-06-03 12:20:34 +00:00
Ian Lance Taylor
9b90491e4a runtime: steal timers from running P's
Previously we did not steal timers from running P's, because that P
should be responsible for running its own timers. However, if the P
is running a CPU-bound G, this can cause measurable delays in running
ready timers. Also, in CL 214185 we avoided taking the timer lock of a P
with no ready timers, which reduces the chances of timer lock contention.

So, if we can't find any ready timers on sleeping P's, try stealing
them from running P's.

Fixes #38860

Change-Id: I0bf1d5dc56258838bdacccbf89493524e23d7fed
Reviewed-on: https://go-review.googlesource.com/c/go/+/232199
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2020-06-03 05:33:54 +00:00
Andrew G. Morgan
9bbe899576 cmd/go: add -Wl,-wrap,symbol to linker flag whitelist
This is needed for cgo support for libpsx.

Fixes: #39361
Change-Id: I500f5614ea4b82b085322af1f1ffeb1f55270a05
Reviewed-on: https://go-review.googlesource.com/c/go/+/236139
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-06-03 02:59:25 +00:00
Jean de Klerk
ba6ccf3b04 testing: capture testname on --- PASS and --- FAIL lines
This fixes an issue raised at https://github.com/golang/go/issues/38458#issuecomment-635617670
in which --- PASS and --- FAIL lines would not trigger --- CONT lines
of other tests.

Change-Id: I0d8cc54d682a370d0a6ea6816a11b2e462a92efe
Reviewed-on: https://go-review.googlesource.com/c/go/+/235997
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2020-06-02 22:57:03 +00:00
David Golden
a9cc1051c1 time: note that formats may parse invalid strings
The existing documentation for time format constants doesn't mention
that they may parse technically-invalid strings, such as single-digit
hours when a two-digit hour is required by a specification.  This commit
adds a short warning note to that effect.

Fixes #37616

Change-Id: I6e5e12bd42dc368f8ca542b4c0527a2b7d30acaf
Reviewed-on: https://go-review.googlesource.com/c/go/+/229460
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-06-02 22:20:47 +00:00
David Chase
ee776b4126 runtime: repair slice, string, and channel printing in gdb
"Something" changed the names of types in gdb, causing the
pretty-printer matchers to fail to match.  This tracks that
change.

Updated runtime-gdb_test.go to include a slice and a channel printing test.

(The straightforward printing of a slicevar doesn't work because
of compiler DWARF problems describing the slicevar, not gdb problems).

Change-Id: I21607a955b9c894f11ecf3763aea2a6dd59a3f42
Reviewed-on: https://go-review.googlesource.com/c/go/+/235926
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2020-06-02 21:19:07 +00:00
Ian Lance Taylor
1193958d6b cmd: update golang.org/x/tools to v0.0.0-20200601175630-2caf76543d99
This teaches vet to recognize %O in a fmt.Printf format string.
O has been supported since the 1.13 release, but vet would warn about it.

Fixes #29986

Change-Id: I3a7a1fc8141f32888c081c5d92620461624371f6
Reviewed-on: https://go-review.googlesource.com/c/go/+/236138
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-06-02 20:59:16 +00:00
Jay Conrod
c082c1fea3 doc/go1.15: remove TODOs for tools and go command sections
For #37419

Change-Id: I35a5cf86ff09a3962959627dce58155b26ad4748
Reviewed-on: https://go-review.googlesource.com/c/go/+/236160
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
2020-06-02 20:44:05 +00:00