1
0
mirror of https://github.com/golang/go synced 2024-11-18 12:44:49 -07:00
Commit Graph

44010 Commits

Author SHA1 Message Date
Jeremy Faller
7260ad6f52 [dev.link] cmd/link: move asmb2 elf to generic handling
Change-Id: Ic3e90793f0ce49909c4f76df1272b25a1d61ebdf
Reviewed-on: https://go-review.googlesource.com/c/go/+/234887
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-05-26 17:54:41 +00:00
Jeremy Faller
0ca6098f70 [dev.link] cmd/link: remove Flag8 from amd64
It's only ever checked for plan 9 and it was irrelevantly set.

Change-Id: I225d4be645f573ceccde47ec2236bf3dbeb0ea70
Reviewed-on: https://go-review.googlesource.com/c/go/+/234886
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-05-26 17:51:40 +00:00
Jeremy Faller
c551318046 [dev.link] cmd/link: move macho asmb2 support to generic functions
Change-Id: Ic360af7c0e8de3446aa8d26d70f95f87690087ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/234883
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-05-26 17:48:40 +00:00
Jeremy Faller
25b283bf8c [dev.link] cmd/link: move plan9 header out of architectures
Change-Id: I7ccd14e8faa84085e976d23f83b822c05ee6a0ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/234877
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>
2020-05-26 17:45:23 +00:00
Than McIntosh
6265ed7452 [dev.link] cmd/compile: emit fewer R_USETYPE relocations
Background: when compiling a function, it's possible that a local
variable will be optimized away, which could potentially degrade the
debugging experience if the compiler fails to emit DWARF information
for the variable's type. To mitigate this situation, the compiler
emits R_USETYPE relocations for the function's auto/param variables as
a signal to the linker to generate DWARF for the types in question,
even if the type is not specifically attached to a DWARF param or var.

This patch change the logic in the compiler to avoid emitting a
R_USETYPE relocation if the type in question is already referenced by
a concrete DWARF param or auto record. This cuts down on the amount of
work the linker has to do, also makes object files a bit smaller on
average (about 1% for the runtime package).

Change-Id: I4d24da458d0658edf90c5dca0bf21d5ddc3961d8
Reviewed-on: https://go-review.googlesource.com/c/go/+/234837
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
2020-05-26 17:34:04 +00:00
Than McIntosh
8ca2eae206 [dev.link] cmd/link: refactor DWARF fn die processing to remove name lookups
Rework the code in the linker that visits DWARF subprorgam DIEs to
reduce number of symbol name instantiations and name lookups, by
making better use of relocation target symbol types.

Change-Id: Ifb2a4e24874b8c891d7fdf17dd749c3f9139157a
Reviewed-on: https://go-review.googlesource.com/c/go/+/234685
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-05-26 17:33:19 +00:00
Than McIntosh
96ec09da48 [dev.link] cmd/{compile,link}: split SDWARFINFO symtype into sub-types
This change splits the SDWARFINFO symbol type (a generic container of
DWARF content) into separate sub-classes. The new symbol types are

 SDWARFCUINFO    comp unit DIE, also CU info and CU packagename syms
 SDWARFCONST     constant DIE
 SDWARFFCN       subprogram DIE (default and concrete)
 SDWARFABSFCN    abstract function DIE
 SDWARFTYPE      type DIE
 SDWARFVAR       global variable DIE

Advantage of doing this: in the linker there are several places where
we have to iterate over a symbol's relocations to pick out references
to specific classes of DWARF sub-symbols (for example, looking for all
abstract function DIEs referenced by a subprogram DIE, or looking at
all the type DIEs used in a subprogram DIE). By splitting SDWARFINFO
into parts clients can now look only at the relocation target's sym
type as opposed to having to materialize the target sym name, or do a
lookup.

Change-Id: I4e0ee3216d3c8f1a78bec3d296c01e95b3d025b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/234684
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-05-26 17:31:19 +00:00
Cherry Zhang
de1f07d56d [dev.link] cmd/link: delete sym.Symbols
Now the only thing it does is to track versions. Move it to ctxt.
And delete sym.Symbols.

Change-Id: Ie6b974f9bf79c4f33ace02213dcb89463eadd26a
Reviewed-on: https://go-review.googlesource.com/c/go/+/234884
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-05-21 21:19:17 +00:00
Jeremy Faller
49b12dcca9 [dev.link] cmd/link: remove duplicate asmb code
Lots of the architecture specific code for asmb() is very simimar. As
such, move to a common function.

Change-Id: Id1fd50ee7bfa1bc9978e3f42ad08914b04cd677b
Reviewed-on: https://go-review.googlesource.com/c/go/+/234683
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>
2020-05-21 18:40:49 +00:00
Cherry Zhang
6097f7cf7a [dev.link] all: merge branch 'master' into dev.link
Change-Id: I85b653b621ad8cb2ef27886210ea2c4b7409b60d
2020-05-21 14:08:32 -04:00
Michael Anthony Knyszek
c847589ad0 runtime: synchronize StartTrace and StopTrace with sysmon
Currently sysmon is not stopped when the world is stopped, which is
in general a difficult thing to do. The result of this is that when
tracing starts and the value of trace.enabled changes, it's possible
for sysmon to fail to emit an event when it really should. This leads to
traces which the execution trace parser deems inconsistent.

Fix this by putting all of sysmon's work behind a new lock sysmonlock.
StartTrace and StopTrace both acquire this lock after stopping the world
but before performing any work in order to ensure sysmon sees the
required state change in tracing. This change is expected to slow down
StartTrace and StopTrace, but will help ensure consistent traces are
generated.

Updates #29707.
Fixes #38794.

Change-Id: I64c58e7c3fd173cd5281ffc208d6db24ff6c0284
Reviewed-on: https://go-review.googlesource.com/c/go/+/234617
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2020-05-21 14:48:50 +00:00
Cherry Zhang
39ea0ea05d cmd/link: fix size calculation for file space preallocation on darwin
On darwin, we preallocate file storage space with fcntl
F_ALLOCATEALL in F_PEOFPOSMODE mode. This is specified as
allocating from the physical end of the file. So the size we give
it should be the increment, instead of the total size.

Fixes #39044.

Change-Id: I10c7ee8d51f237b4a7604233ac7abc6f91dcd602
Reviewed-on: https://go-review.googlesource.com/c/go/+/234481
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-05-21 14:48:43 +00:00
Than McIntosh
fed33d76bc cmd/compile: delay inlinable method compilation for -c=1
When the concurrent back end is not enabled, it is possible to have a
scenario where: we compile a specific inlinable non-pointer-receiver
method T.M, then at some point later on in the compilation we visit a
type that triggers generation of a pointer-receiver wrapper (*T).M,
which then results in an inline of T.M into (*T).M. This introduces
subtle differences in the DWARF as compared with when the concurrent
back end is enabled (in the concurrent case, by the time we run the
SSA back end on T.M is is marked as being inlined, whereas in the
non-current case it is not marked inlined).

As a fix, at the point where we would normally compile a given
function in the xtop list right away, if the function is a method AND
is inlinable AND hasn't been inlined, then delay its compilation until
compileFunctions (so as to make sure that when we do compile it, all
possible inlining has been complete). In addition, make sure that
the abstract function symbol for the inlined function gets recorded
correctly.

Fixes #38068.

Change-Id: I57410ab5658bd4ee5b4b80750518e9b20fd6ba52
Reviewed-on: https://go-review.googlesource.com/c/go/+/234178
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2020-05-21 14:45:26 +00:00
Jay Conrod
0cfe1fb878 cmd/go: rank errUseProxy lower when handling proxy errors
modfetch.TryProxies ranks errors returned by GOPROXY entries by
usefulness. It returns the error of the highest rank from the last
proxy. Errors from "direct" and "noproxy" are most useful, followed by
errors other than ErrNotExist, followed by ErrNotExist.

This change ranks errUseProxy with ErrNotExist even though it's
reported by "noproxy". There is almost always a more useful message
than "path does not match GOPRIVATE/GONOPROXY".

Fixes #39180

Change-Id: Ifa5b96462d7bf411e6d2d951888465c839d42471
Reviewed-on: https://go-review.googlesource.com/c/go/+/234687
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-05-21 14:31:37 +00:00
Cherry Zhang
c53b2bdb35 runtime: add a barrier after a new span is allocated
When copying a stack, we
1. allocate a new stack,
2. adjust pointers pointing to the old stack to pointing to the
   new stack.

If the GC is running on another thread concurrently, on a machine
with weak memory model, the GC could observe the adjusted pointer
(e.g. through gp._defer which could be a special heap-to-stack
pointer), but not observe the publish of the new stack span. In
this case, the GC will see the adjusted pointer pointing to an
unallocated span, and throw. Fixing this by adding a publication
barrier between the allocation of the span and adjusting pointers.

One testcase for this is TestDeferHeapAndStack in long mode. It
fails reliably on linux-mips64le-mengzhuo builder without the fix,
and passes reliably after the fix.

Fixes #35541.

Change-Id: I82b09b824fdf14be7336a9ee853f56dec1b13b90
Reviewed-on: https://go-review.googlesource.com/c/go/+/234478
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2020-05-21 14:31:36 +00:00
Ian Lance Taylor
567556d786 syscall: preserve Windows file permissions for O_CREAT|O_TRUNC
On Windows, calling syscall.Open(file, O_CREAT|O_TRUNC, 0) for a file
that already exists would change the file to be read-only.
That is not how the Unix syscall.Open behaves, so avoid it on
Windows by calling CreateFile twice if necessary.

Fixes #38225

Change-Id: I70097fca8863df427cc8a97b9376a9ffc69c6318
Reviewed-on: https://go-review.googlesource.com/c/go/+/234534
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2020-05-20 21:52:34 +00:00
Yasuhiro Matsumoto
aeab403174 cmd/go: use temporary file for output of gcc command on Windows
On Windows, some of gcc command (like msys2 native) output NUL as a file.

Fixes #36000

Change-Id: I02c632fa2d710a011d79f24d5beee4bc57ad994e
Reviewed-on: https://go-review.googlesource.com/c/go/+/233977
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-05-20 21:52:17 +00:00
David Chase
daf70d6c16 cmd/go: remove GOAMD64 environment variable
This removes the GOAMD64 environment variable and its documentation.
The value is instead supplied by a compiled-in constant.

Note that function alignment is also dependent on the value of
the (removed) flag; it is 32 for aligned jumps, 16 if not.
When the flag-dependent logic is removed, it will be 32.

Updates #35881.

Change-Id: Ic41c0b9833d2e8a31fa3ce8067d92aa2f165bf72
Reviewed-on: https://go-review.googlesource.com/c/go/+/231600
Reviewed-by: Austin Clements <austin@google.com>
2020-05-20 19:21:43 +00:00
Jeremy Faller
8e4ab9cb4c [dev.link] cmd/link: remove some x86/Darwin code
Found while looking at common code between architectures.

Recreation of CL 234680 which was accidentally on master.

Change-Id: Ib8fac3168916e8e64b2bc65fd3830c5856d77c5e
Reviewed-on: https://go-review.googlesource.com/c/go/+/234682
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2020-05-20 18:46:43 +00:00
Bryan C. Mills
f7f9c8f2fb runtime: allocate fewer bytes during TestEINTR
This will hopefully address the occasional "runtime: out of memory"
failures observed on the openbsd-arm-jsing builder:
https://build.golang.org/log/c296d866e5d99ba401b18c1a2ff3e4d480e5238c

Also make the "spin" and "winch" loops concurrent instead of
sequential to cut down the test's running time.

Finally, change Block to coordinate by closing stdin instead of
sending SIGINT. The SIGINT handler wasn't necessarily registered by
the time the signal was sent.

Updates #20400
Updates #39043

Change-Id: Ie12fc75b87e33847dc25a12edb4126db27492da6
Reviewed-on: https://go-review.googlesource.com/c/go/+/234538
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-05-20 15:57:15 +00:00
Michael Anthony Knyszek
dfd613e0e4 runtime: don't use (addrRange).subtract in removeGreaterEqual
Currently in (*addrRanges).removeGreaterEqual we use
(addrRange).subtract with a range from specified address to "infinity"
which is supposed to be maxOffAddr. However, maxOffAddr is necessarily
an inclusive bound on the address space, because on many platforms an
exclusive bound would overflow back to 0.

On some platforms like mips and mipsle, the address space is smaller
than what's representable in a pointer, so if there's a range which hits
the top of the address space (such as in the pageAlloc tests), the limit
doesn't overflow, but maxOffAddr is inclusive, so any attempt to prune
this range with (*addrRange).removeGreaterEqual causes a failure, since
the range passed to subtract is contained within the address range which
touches the top of the address space.

Another problem with using subtract here is that addr and
maxOffAddr.addr() may not be in the same segment which could cause
makeAddrRange to panic. While this unlikely to happen, on some platforms
such as Solaris it is possible.

Fix these issues by not using subtract at all. Create a specific
implementation of (addrRange).removeGreaterEqual which side-steps all of
this by not having to worry about the top of the address space at all.

Fixes #39128.

Change-Id: Icd5b587b1a3d32a5681fb76cec4c001401f5756f
Reviewed-on: https://go-review.googlesource.com/c/go/+/234457
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-05-20 15:15:16 +00:00
Michael Hudson-Doyle
4ec4a792f6 cmd/go: accept smart quotes when checking for missing gold in TestNoteReading
Fixes #39157

Change-Id: Ia983f5e66698519cd19c1565cfb80e86d08fdfc6
Reviewed-on: https://go-review.googlesource.com/c/go/+/234380
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-05-20 03:40:22 +00:00
Bryan C. Mills
13617380ca testing: clean up remaining TempDir issues from CL 231958
Updates #38850

Change-Id: I33f48762f5520eb0c0a841d8ca1ccdd65ecc20c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/234583
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-05-19 19:55:14 +00:00
Bryan C. Mills
2dbbc867db crypto/x509: save the temp dir in TestReadUniqueDirectoryEntries
In CL 231958, TempDir was changed to create a new temp directory on
each allocation, on the theory that it is easy to save in a variable
for callers that want the same directory repeatedly. Apply that
transformation here.

Updates #38850

Change-Id: Ibb014095426c33038e0a2c95303579cf95d5c3ba
Reviewed-on: https://go-review.googlesource.com/c/go/+/234582
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-05-19 18:43:29 +00:00
Roger Peppe
6d6e4827c0 testing: return unique directory inside same base root for TempDir
We use a single parent directory for all temporary directories
created by a test so they're all kept together.

Fixes #38850

Change-Id: If8edae10c5136efcbcf6fd632487d198b9e3a868
Reviewed-on: https://go-review.googlesource.com/c/go/+/231958
Reviewed-by: Russ Cox <rsc@golang.org>
2020-05-19 17:38:32 +00:00
Jeremy Faller
7214090180 [dev.link] cmd/link: skip TestDWARFiOS if the iOS tools aren't installed
Change-Id: I5bccb5935cdeb3a0ccf398a57eb4776f0e6aedca
Reviewed-on: https://go-review.googlesource.com/c/go/+/234578
Run-TryBot: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-05-19 16:58:43 +00:00
Tobias Klauser
8fa468d511 doc/go1.15: consolidate notes regarding package testing
Fold the descriptions of testing.T.Deadline and TestMain related changes
into the existing section for package testing.

Also link T.Deadline to its godoc.

Change-Id: I732c45fb879305099cb8a51a77ef11fba1b2f1e3
Reviewed-on: https://go-review.googlesource.com/c/go/+/234557
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2020-05-19 15:34:47 +00:00
Cherry Zhang
76a459b361 [dev.link] cmd/link: remove duplicate handling of some specially named symbols
We do it on the symtab pass. Remove duplicate.

Change-Id: I88cc8cd6e873749e0f6197f809aa812bca9dbbf9
Reviewed-on: https://go-review.googlesource.com/c/go/+/234493
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-05-19 14:54:16 +00:00
Cherry Zhang
cf3bf9959c [dev.link] cmd/internal/obj: remove asm parameter of NumberSyms
Now we have ctxt.IsAsm, use that, instead of passing in a
parameter.

Change-Id: I81dedbe6459424fa9a4c2bfbd9abd83d83f3a107
Reviewed-on: https://go-review.googlesource.com/c/go/+/234492
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-05-19 14:54:09 +00:00
Cherry Zhang
0f92cd75cf [dev.link] cmd/asm: expand package path if known
If the package path is known, pass it to the object file writer
so the symbol names are pre-expanded. (We already expand the
package path in debug info.)

Change-Id: I2b2b71edbb98924cbf3c4f9142b7e109e5b7501a
Reviewed-on: https://go-review.googlesource.com/c/go/+/234491
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-05-19 14:53:54 +00:00
Cherry Zhang
586d0755e2 [dev.link] cmd/link: only do name expansion when needed
Most Go objects are compiled with known package path, so the
symbol name is already fully expanded. Nevertheless, currently
in the linker strings.Replace is called unconditionally, and most
of the time it doesn't do anything.

This CL records a per-object flag in the object file, and do the
name expansion only when the name is not expanded at compile time.

This gives small speedups for the linker. Linking cmd/compile:

name                    old time/op    new time/op    delta
Loadlib                   35.1ms ± 2%    32.8ms ± 4%   -6.43%  (p=0.008 n=5+5)
Symtab                    15.8ms ± 2%    14.0ms ± 8%  -11.45%  (p=0.008 n=5+5)
TotalTime                  399ms ± 1%     385ms ± 2%   -3.63%  (p=0.008 n=5+5)

Change-Id: I735084971a051cd9be4284ad294c284cd5b545f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/234490
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-05-19 14:53:39 +00:00
Ian Lance Taylor
c88f6989e1 doc: require macOS 10.12 or later
For #23011

Change-Id: I3137820af975301e251b0a23a9349c544b42c70b
Reviewed-on: https://go-review.googlesource.com/c/go/+/234521
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-05-19 04:10:43 +00:00
Katie Hockman
185c3d4610 crypto/tls: remove version check when unmarshaling sessionState
This was causing issues when fuzzing with
TestMarshalUnmarshal since the test would
occassionally set the version to VersionTLS13,
which would fail when unmarshaling. The check
doesn't add much in practice, and there is no
harm in removing it to de-flake the test.

Fixes #38902

Change-Id: I0906c570e9ed69c85fdd2c15f1b52f9e372c62e3
Reviewed-on: https://go-review.googlesource.com/c/go/+/234486
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2020-05-18 23:09:31 +00:00
Ian Lance Taylor
0d39dba6de doc/go1.15: mention vet warning for impossible type assertions
For #4483

Change-Id: Iab76baf50b79eda1e3acfd662d0e7830c7962f5d
Reviewed-on: https://go-review.googlesource.com/c/go/+/234518
Reviewed-by: Robert Griesemer <gri@golang.org>
2020-05-18 23:05:20 +00:00
Ian Lance Taylor
b0bc18d5bc doc/go1.15: mention vet warning for string(x)
For #32479

Change-Id: I974709d471021d370aa9bdc5f24b02afa8bd9b54
Reviewed-on: https://go-review.googlesource.com/c/go/+/234517
Reviewed-by: Robert Griesemer <gri@golang.org>
2020-05-18 23:04:48 +00:00
Katie Hockman
3b0882e838 crypto/tls: persist the createdAt time when re-wrapping session tickets
Change-Id: I33fcde2d544943fb04c2599810cf7fb773aeba1f
Reviewed-on: https://go-review.googlesource.com/c/go/+/234483
Run-TryBot: Katie Hockman <katie@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-05-18 20:53:36 +00:00
Cherry Zhang
b8c5d6871f [dev.link] cmd/link: delete SCONST symbol type
After CL 233998, we don't produce SCONST symbols anywhere. Remove
the type.

Change-Id: I0f52de5242b8fd0ffec63370eef612511e1087ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/234437
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2020-05-18 16:18:27 +00:00
Cherry Zhang
1ccd585e94 [dev.link] cmd/link: remove "2" from names
Change-Id: I203caaf9cbe7136cf2060de7dc91c28f6ced1ee2
Reviewed-on: https://go-review.googlesource.com/c/go/+/234038
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>
2020-05-18 15:14:38 +00:00
Cherry Zhang
4e974292d4 [dev.link] cmd/link: delete sym.Attribute
Change-Id: I1a3ad5e02e9586168a0c5cd37bee37ab5b65e501
Reviewed-on: https://go-review.googlesource.com/c/go/+/234039
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>
2020-05-18 15:06:32 +00:00
Cherry Zhang
7f872be02f [dev.link] cmd/link: delete some deadcode
Change-Id: Ic4ca89ced19bf91e3d3ee10b7522d7ebe6b7c7fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/234116
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>
2020-05-18 15:06:22 +00:00
Jay Conrod
afd477f2ba cmd: update golang.org/x/mod to v0.3.0 (same commit)
v0.3.0 is a tag on 859b3ef565e2, the version that was already being
used. This change is a no-op, except for letting us use a release
version instead of a pseudo-version.

For #36905

Change-Id: I70b8ce2a3f1451f5602c469501362d7a6a673b12
Reviewed-on: https://go-review.googlesource.com/c/go/+/234002
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
2020-05-18 13:11:11 +00:00
Richard Miller
bb59a1360a runtime: don't enable notes (=signals) too early in Plan 9
The Plan 9 runtime startup was enabling notes (like Unix signals)
before the gsignal stack was allocated. This left a small window
of time where an interrupt (eg by the parent killing a subprocess
quickly after exec) would cause a null pointer dereference in
sigtramp. This would leave the interrupted process suspended in
'broken' state instead of exiting. We've observed this on the
builders, where it can make a test time out waiting for the broken
process to terminate.

Updates #38772

Change-Id: I54584069fd3109595f06c78724c1f6419e028aab
Reviewed-on: https://go-review.googlesource.com/c/go/+/234397
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David du Colombier <0intro@gmail.com>
2020-05-18 09:13:38 +00:00
Cherry Zhang
2b70ffe930 cmd/link: detect trampoline of deferreturn call
The runtime needs to find the PC of the deferreturn call in a few
places. So for functions that have defer, we record the PC of
deferreturn call in its funcdata.

For very large binaries, the deferreturn call could be made
through a trampoline. The current code of finding deferreturn PC
fails in this case. This CL handles the trampoline as well.

Fixes #39049.

Change-Id: I929be54d6ae436f5294013793217dc2a35f080d4
Reviewed-on: https://go-review.googlesource.com/c/go/+/234105
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-05-15 16:15:25 +00:00
Cherry Zhang
b97212d1f1 [dev.link] cmd/link: delete sym.Symbol and sym.Reloc
This deletes all sym.Symbol and sym.Reloc references. This is
certainly not complete, and there are more cleanups to do. But I
feel this makes a good first round.

Change-Id: I7621d016957f7ef114be5f0606fcb3ad6aee71c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/234097
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-05-14 21:42:03 +00:00
Cherry Zhang
881d540540 cmd/link: fix SLIBFUZZER_EXTRA_COUNTER symbol handling
Found this while deleting the old code. This should be data2.

Change-Id: I1232fac22ef63bb3a3f25a0558537cc371af3bd9
Reviewed-on: https://go-review.googlesource.com/c/go/+/234098
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>
2020-05-14 21:41:46 +00:00
Jeremy Faller
4e03dac77c [dev.link] cmd/link: move xcoff to loader represenatation
Change-Id: I5b260493ffd7945f665c466e892be18d81e7940a
Reviewed-on: https://go-review.googlesource.com/c/go/+/233340
Run-TryBot: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-05-14 19:18:37 +00:00
Dan Scales
f474e9e549 runtime: add a lock partial order edge (assistQueue -> mspanSpecial)
From interesting stack trace from GC assist through memory profiling to
addspecial().

Fixes #39022

Change-Id: Ia0506b820fe29ae91490b61c4e9c2fffcad9f7d6
Reviewed-on: https://go-review.googlesource.com/c/go/+/233599
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2020-05-14 18:58:17 +00:00
Jeremy Faller
ff1a2d02dc [dev.link] cmd/link: remove dependence on dodatastate on symalign2
Needed for xcoff.

Change-Id: I17d4675a01651b799dfaef92644fdc8267996f10
Reviewed-on: https://go-review.googlesource.com/c/go/+/233339
Run-TryBot: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-05-14 18:50:08 +00:00
Josh Bleecher Snyder
5c802c13e8 runtime: remove flaky "goroutine 2 bt" from gdb test
This part of the test has been flaky despite repeated attempts to fix it,
and it is unclear what exactly it is testing. Remove it.

Fixes #24616.

Change-Id: If7234f99dd3d3e92f15ccb94ee13e75c6da12537
Reviewed-on: https://go-review.googlesource.com/c/go/+/233942
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2020-05-14 17:50:18 +00:00
Jeremy Faller
ad91591f34 [dev.link] all: merge master to dev.link
Change-Id: Ia30d70096e740d012e4d9e070bbc4347805527a7
2020-05-14 13:45:27 -04:00