aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/link
AgeCommit message (Collapse)Author
2022-09-06cmd/link,runtime: remove unused fields from inlinedCallMichael Pratt
The parent, file, and line fields are no longer used now that we have parentPc to find the parent and NOPs in the parent to attach file/line pcdata to. Removing these fields reduces the binary size of cmd/go on linux-amd64 by 1.1%. Fixes #54849. Change-Id: If58f08622736b2b322288608776f8bedf0c3fd17 Reviewed-on: https://go-review.googlesource.com/c/go/+/427960 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-09-02cmd/link: only add dummy XCOFF reference if the symbol existsCherry Mui
On AIX when external linking, for some symbols we need to add dummy references to prevent the external linker from discarding them. Currently we add the reference unconditionally. But if the symbol doesn't exist, the linking fails in a later stage for generating external relocation of a nonexistent symbol. The symbols are special symbols that almost always exist, except that go:buildid may not exist if the linker is invoked without the -buildid flag. The go command invokes the linker with the flag, so this can only happen with manual linker invocation. Specifically, test/run.go does this in some cases. Fix this by checking the symbol existence before adding the reference. Re-enable tests on AIX. Perhaps the linker should always emit a dummy buildid even if the flag is not set... Fixes #54814. Change-Id: I43d81587151595309e189e38960cbda9a1c5ca32 Reviewed-on: https://go-review.googlesource.com/c/go/+/427620 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2022-08-18cmd/compile/internal/noder: set ir.Name.DictIndex for unified IRMatthew Dempsky
For local variables of derived type, Delve relies on ir.Name.DictIndex being set to the type's rtype index within the function's dictionary. This CL implements that functionality within unified IR. Manually double checked that Delve behaves correctly, at least as far as I can tell from casual use. Specifically, I confirmed that running the test program from TestDictIndex, stepping into testfn, and then running `print mapvar` prints `map[int]main.CustomInt []`, which matches the behavior under GOEXPERIMENT=nounified. (Also compare that when ir.Name.DictIndex is *not* set by unified IR, `print mapvar` instead prints `map[int]go.shape.int []`.) Fixes #54514. Change-Id: I90d443945895abfba04dc018f15e00217930091c Reviewed-on: https://go-review.googlesource.com/c/go/+/424735 Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-18all: remove duplicate "the" words in commentsAbirdcfly
Following CL 424454, using command rg --multiline " the\s{1,}the " * rg --multiline " the\s{1,}//\s{1,}the " * all the words "the" that are repeated in comments are found. Change-Id: I60b769b98f04c927b4c228e10f37faf190964069 Reviewed-on: https://go-review.googlesource.com/c/go/+/423836 Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Filippo Valsorda <filippo@golang.org>
2022-08-15cmd/link: recognize the new R_LARCH_32_PCREL type on loong64WANG Xuerui
Due to the latest binutils change [1], at least for certain 32-bit relocs in .eh_frame section, this new type of relocation record is emitted, leading to breakage on systems with bleeding-edge toolchain when trying to link with object(s) with such new-style relocs. Simply treating it the same as the existing reloc types seems enough. Fixes #54222 [1]: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=f09482a8747b6fd4c2d59a6a64677d3a3fe1e092 Change-Id: I876d6711d5d4a674bead37e57f9503f1622d1136 Reviewed-on: https://go-review.googlesource.com/c/go/+/420983 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: abner chenc <chenguoqi@loongson.cn> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-08-11cmd/link: fix trampolines breaking DWARF line infoJeremy Quirke
When trampolines are needed (e.g. Darwin ARM64), the DWARF LPT (Line Program Table - see DWARF section 6.1) generation fails because the replacement symbols are marked as external symbols and skipped during the DWARF LPT generation phase. Fixes #54320 Change-Id: I6c93f5378f50e5edf30d5121402a48214abb1ce2 GitHub-Last-Rev: 085bbc55dbc95d55456cc2acc46a0d02416c2848 GitHub-Pull-Request: golang/go#54321 Reviewed-on: https://go-review.googlesource.com/c/go/+/422154 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Than McIntosh <thanm@google.com> Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-09all: use ":" for compiler generated symbolsCuong Manh Le
As it can't appear in user package paths. There is a hack for handling "go:buildid" and "type:*" on windows/386. Previously, windows/386 requires underscore prefix on external symbols, but that's only applied for SHOSTOBJ/SUNDEFEXT or cgo export symbols. "go.buildid" is STEXT, "type.*" is STYPE, thus they are not prefixed with underscore. In external linking mode, the external linker can't resolve them as external symbols. But we are lucky that they have "." in their name, so the external linker see them as Forwarder RVA exports. See: - https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#export-address-table - https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=ld/pe-dll.c;h=e7b82ba6ffadf74dc1b9ee71dc13d48336941e51;hb=HEAD#l972) This CL changes "." to ":" in symbols name, so theses symbols can not be found by external linker anymore. So a hacky way is adding the underscore prefix for these 2 symbols. I don't have enough knowledge to verify whether adding the underscore for all STEXT/STYPE symbols are fine, even if it could be, that would be done in future CL. Fixes #37762 Change-Id: I92eaaf24c0820926a36e0530fdb07b07af1fcc35 Reviewed-on: https://go-review.googlesource.com/c/go/+/317917 Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-08cmd/link: detect glibc vs musl ldso at link timeRuss Cox
Doing the test at link time lets us distribute one Linux toolchain that works on both glibc-based and musl-based Linux systems. The old way built a toolchain that only ran on one or the other. Fixes #54197. Change-Id: Iaae8c274c78e1091eee828a720b49646be9bfffe Reviewed-on: https://go-review.googlesource.com/c/go/+/420774 Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Russ Cox <rsc@golang.org>
2022-08-08cmd/compile, cmd/link: enable Duff's device on darwin/arm64Cherry Mui
Duff's device was disabled on darwin/arm64 because the darwin linker couldn't handle a branch relocation with non-zero addend. This is no longer the case now. The darwin linker can handle it just fine. So enable it. Fixes #54189. Change-Id: Ida7ebafe6eb01db1af5bb8ae60a62491da5eabdf Reviewed-on: https://go-review.googlesource.com/c/go/+/420894 Reviewed-by: Eric Fang <eric.fang@arm.com> Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-08all: use io.Seek* instead of deprecated os.SEEK_*Tobias Klauser
These are available since Go 1.7. The version used for bootstrap is Go 1.17 for Go 1.20. For #44505 Change-Id: I497c9f617baefdeb273cd115b08b6e31bd10aad2 Reviewed-on: https://go-review.googlesource.com/c/go/+/421634 Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-08-05cmd/link: use correct path for dynamic loader on ppc64leLynn Boger
The setting of the path for the dynamic loader when building for linux/ppc64le ELF v2 was incorrectly set to the path for PPC64 ELF v1. This has not caused issues in the common cases because this string can be set based on the default GO_LDSO setting. It does result in an incorrect value when cross compiling binaries with -buildmode=pie. Updates #53813 Change-Id: I84de1c97b42e0434760b76a57c5a05e055fbb730 Reviewed-on: https://go-review.googlesource.com/c/go/+/417614 Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
2022-07-07cmd/link: explicitly disable PIE for windows/amd64 -race modeThan McIntosh
Turn off PIE explicitly for windows/amd64 when -race is in effect, since at the moment the race detector runtime doesn't seem to handle PIE binaries correctly. Note that newer C compilers on windows produce PIE binaries by default, so the Go linker needs to explicitly turn off PIE when invoking the external linker in this case. Updates #53539. Change-Id: Ib990621f22cf61a5fa383584bab81d3dfd7552e8 Reviewed-on: https://go-review.googlesource.com/c/go/+/415676 Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Than McIntosh <thanm@google.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2022-06-27cmd/link: link against libsynchronization.a for -race on windowsThan McIntosh
As of LLVM rev 41cb504b7c4b18ac15830107431a0c1eec73a6b2, the race detector runtime now refers to things in the windows synchronization library, hence when doing windows internal linking, at that library to the list of host archives that we visit. The tsan code that makes the reference is here: https://github.com/llvm/llvm-project/blob/41cb504b7c4b18ac15830107431a0c1eec73a6b2/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp#L48 https://github.com/llvm/llvm-project/blob/41cb504b7c4b18ac15830107431a0c1eec73a6b2/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp#L834 Note that libsynchronization.a is not guaranteed to be available on all windows systems, so in the external linking case, check for its existence before adding "-lsynchronization" to the external linker args. Updates #53539. Change-Id: I433c95c869915693d59e9c1082d5b8a11da1fc8c Reviewed-on: https://go-review.googlesource.com/c/go/+/413817 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Than McIntosh <thanm@google.com>
2022-06-22cmd/go, cmd/link: support failure to create _cgo_import.goIan Lance Taylor
For a package that uses cgo, the file _cgo_import.go is created to record information required for internal linking: the non-Go dynamic symbols and libraries that the package depends on. Generating this information sometimes fails, because it can require recreating all the dependencies of all transitively imported packages. And the information is rarely needed, since by default we use external linking when there are packages outside of the standard library that use cgo. With this CL, if generating _cgo_import.go fails, we don't report an error. Instead, we mark the package as requiring external linking, by adding an empty file named "dynimportfail" into the generated archive. If the linker sees a file with that name, it rejects an attempt to use internal linking. Fixes #52863 Change-Id: Ie586e6753a5b67e49bb14533cd7603d9defcf0ea Reviewed-on: https://go-review.googlesource.com/c/go/+/413460 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-06-16cmd/link: consider alignment in carrier symbol size calculationCherry Mui
Currently, when we calculate the size of a carrier symbol, we use the previous symbol's end address as the start. But the symbol actually starts after applying the alignment. Do this in the size calculation. Should fix AIX build. Updates #53372. Change-Id: I17942b1fe8027dce12b78c8e8c80ea6cebcee240 Reviewed-on: https://go-review.googlesource.com/c/go/+/412734 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2022-06-15cmd/link: set alignment for carrier symbolsCherry Mui
For carrier symbols like type.*, currently we don't set its alignment. Normally it doesn't actually matter as we still align the inner symbols. But in some cases it does make the symbol table a bit weird, e.g. on darwin/arm64, 0000000000070000 s _runtime.types 0000000000070001 s _type.* The address of the symbol _type.* is a bit weird. And the new darwin linker from Xcode 14 beta doesn't like that (see issue 53372). This CL aligns them. Fixes #53372. Change-Id: I1cb19dcf172e9a6bca248d85a7e54da76cbbc8a4 Reviewed-on: https://go-review.googlesource.com/c/go/+/411912 Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-06-14cmd/compile,runtime,reflect: move embedded bit from offset to nameKeith Randall
Previously we stole a bit from the field offset to encode whether a struct field was embedded. Instead, encode that bit in the name field, where we already have some unused bits to play with. The bit associates naturally with the name in any case. This leaves a full uintptr to specify field offsets. This will make the fix for #52740 cleaner. Change-Id: I0bfb85564dc26e8c18101bc8b432f332176d7836 Reviewed-on: https://go-review.googlesource.com/c/go/+/412138 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com>
2022-06-07cmd/link: specify -Wl,-z params as documentedMotiejus Jakštys
Both GNU and LLVM linkers de facto accept `-zPARAM`, and Go sometimes does it. Inconsistently: there are more uses of `-z PARAM` than `-zPARAM`: $ git grep -E -- '-Wl,-z[^,]' master | wc -l 4 $ git grep -E -- '-Wl,-z,' master | wc -l 7 However, not adding a space between `-z` and the param is not documented: llvm-13: $ man ld.lld-13 | grep -E -A1 -w -- "^ +-z" -z option Linker option extensions. gnu ld: $ man ld | grep -E -A1 -w -- "^ +-z" -z keyword The recognized keywords are: -- -z defs Report unresolved symbol references from regular object files. This is done even if the linker is creating a non-symbolic -- -z muldefs Normally when a symbol is defined multiple times, the linker will report a fatal error. These options allow multiple definitions -- -z --imagic ... and thus should be avoided. `zig cc`, when used as the C compiler (`CC="zig cc" go build ...`), will bark, because `zig cc` accepts only `-z PARAM`, as documented. Closes ziglang/zig#11669 Change-Id: I758054ecaa3ce01a72600bf65d7f7b5c3ec46d09 GitHub-Last-Rev: e068e007da9f2b0441ee0aa8b198a7ba3cd93ed3 GitHub-Pull-Request: golang/go#53030 Reviewed-on: https://go-review.googlesource.com/c/go/+/407834 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com>
2022-06-06cmd/link/internal/loadpe: handle _main reference properlyThan McIntosh
When building CGO internal linking on windows 386, make sure to avoid rewriting references to "_main" to "main" when reading symbols during host object loading; the main routine defined by the Go runtime is still named "_main" (not "main"). If we don't do this, we wind up with an SXREF symbol named "main", which can then cause the loader to pull an actual "main" symbol out of a host archive, which is undesirable. Updates #35006. Change-Id: I3768e3617b560552f4522e9e72af879c6adf7705 Reviewed-on: https://go-review.googlesource.com/c/go/+/410124 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Auto-Submit: Than McIntosh <thanm@google.com> Run-TryBot: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-06-03cmd/link: fix TestLargeTexteric fang
Do not need to add single quotes '' when passing the parameter value of the -ldflags option, otherwise the following error will be reported: invalid value "'-linkmode=external'" for flag -ldflags: parameter may not start with quote character. Change-Id: I322fa7079ac24c8a68d9cb0872b0a20dbc4893d1 Reviewed-on: https://go-review.googlesource.com/c/go/+/410074 Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Benny Siegert <bsiegert@gmail.com> Run-TryBot: Eric Fang <eric.fang@arm.com>
2022-05-31cmd/link: call syscall.FlushFileBuffers on outbuf UnmapThan McIntosh
In the windows version of OutBuf.munmap, call syscall.FlushFileBuffers after the call to syscall.FlushViewOfFile, on the theory that this will help flush all associated meta-data for the file the linker is writing. Updates #44817. Change-Id: Ibff7d05008a91eeed7634d2760153851e15e1c18 Reviewed-on: https://go-review.googlesource.com/c/go/+/406814 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2022-05-23cmd/link: set coverage counters as expected by the fuzz packageKhaled Yakdan
Set _counters and _ecounters to the start and end locations of libfuzzer's 8-bit counters section Change-Id: Icadb503af1ba22495b1d88b69aad26d89843baa4 GitHub-Last-Rev: 4ca6216b7600a3187732ae6d0dc7a5ce60cd5655 GitHub-Pull-Request: golang/go#53022 Reviewed-on: https://go-review.googlesource.com/c/go/+/407674 Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-20cmd/compile, cmd/link: use libFuzzer 8-bit instead of extra countersKhaled Yakdan
By using libFuzzer’s 8-bit counters instead of extra counters, the coverage instrumentation in libFuzzer mode is improved in three ways: 1- 8-bit counters are supported on all platforms, including macOS and Windows, with all relevant versions of libFuzzer, whereas extra counters are a Linux-only feature that only recently received support on Windows. 2- Newly covered blocks are now properly reported as new coverage by libFuzzer, not only as new features. 3- The NeverZero strategy is used to ensure that coverage counters never become 0 again after having been positive once. This resolves issues encountered when fuzzing loops with iteration counts that are multiples of 256 (e.g., larger powers of two). Change-Id: I9021210d7fbffd07c891ad08750402ee91cb3df5 GitHub-Last-Rev: 9057e4b21d146ce9ffb3993982bfb84b96705989 GitHub-Pull-Request: golang/go#51318 Reviewed-on: https://go-review.googlesource.com/c/go/+/387334 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Keith Randall <khr@golang.org>
2022-05-17all: fix spellingJohn Bampton
Change-Id: Iee18987c495d1d4bde9da888d454eea8079d3ebc GitHub-Last-Rev: ff5e01599ddf7deb3ab6ce190ba92eb02ae2cb15 GitHub-Pull-Request: golang/go#52949 Reviewed-on: https://go-review.googlesource.com/c/go/+/406915 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-05-17all: fix spellingJohn Bampton
Change-Id: I68538a50c22b02cdb5aa2a889f9440fed7b94c54 GitHub-Last-Rev: aaac9e78340ac482e9cd1b506a035f271c29648c GitHub-Pull-Request: golang/go#52944 Reviewed-on: https://go-review.googlesource.com/c/go/+/406835 Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com>
2022-05-17cmd/link: support linker for linux/loong64Xiaodong Liu
The basic arch-specific hooks are implemented, which are used for internal and external linker. Contributors to the loong64 port are: Weining Lu <luweining@loongson.cn> Lei Wang <wanglei@loongson.cn> Lingqin Gong <gonglingqin@loongson.cn> Xiaolin Zhao <zhaoxiaolin@loongson.cn> Meidan Li <limeidan@loongson.cn> Xiaojuan Zhai <zhaixiaojuan@loongson.cn> Qiyuan Pu <puqiyuan@loongson.cn> Guoqi Chen <chenguoqi@loongson.cn> This port has been updated to Go 1.15.6: https://github.com/loongson/go Updates #46229 Change-Id: I4680eb0635dd0fa3d6ea8348a2488da9c7e33d3b Reviewed-on: https://go-review.googlesource.com/c/go/+/349514 Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com>
2022-05-16cmd/compile: set LocalPkg.Path to -p flagMatthew Dempsky
Since CL 391014, cmd/compile now requires the -p flag to be set the build system. This CL changes it to initialize LocalPkg.Path to the provided path, rather than relying on writing out `"".` into object files and expecting cmd/link to substitute them. However, this actually involved a rather long tail of fixes. Many have already been submitted, but a few notable ones that have to land simultaneously with changing LocalPkg: 1. When compiling package runtime, there are really two "runtime" packages: types.LocalPkg (the source package itself) and ir.Pkgs.Runtime (the compiler's internal representation, for synthetic references). Previously, these ended up creating separate link symbols (`"".xxx` and `runtime.xxx`, respectively), but now they both end up as `runtime.xxx`, which causes lsym collisions (notably inittask and funcsyms). 2. test/codegen tests need to be updated to expect symbols to be named `command-line-arguments.xxx` rather than `"".foo`. 3. The issue20014 test case is sensitive to the sort order of field tracking symbols. In particular, the local package now sorts to its natural place in the list, rather than to the front. Thanks to David Chase for helping track down all of the fixes needed for this CL. Updates #51734. Change-Id: Iba3041cf7ad967d18c6e17922fa06ba11798b565 Reviewed-on: https://go-review.googlesource.com/c/go/+/393715 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2022-05-12cmd/link: remove name expansion logicCherry Mui
Now both the compiler and the assembler require the -p flag and emit full package path in symbol names, we no longer need to do the name expansion in the linker. Delete it. Change-Id: I771d4d97987a0a17414881b52806d600ef4cc351 Reviewed-on: https://go-review.googlesource.com/c/go/+/404300 Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cherry Mui <cherryyz@google.com>
2022-05-11cmd/asm: require -p flagCherry Mui
CL 391014 requires the compiler to be invoked with the -p flag, to specify the package path. Later, CL 394217 makes the compiler to produce an unlinkable object file, so "go tool compile x.go" can still be used on the command line. This CL does the same for the assembler, requiring -p, otherwise generating an unlinkable object. No special case for the main package, as the main package cannot be only assembly code, and there is no way to tell if it is the main package from an assembly file. Now we guarantee that we always have an expanded package path in the object file. A later CL will delete the name expansion code in the linker. Change-Id: I8c10661aaea2ff794614924ead958d80e7e2487d Reviewed-on: https://go-review.googlesource.com/c/go/+/404298 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2022-05-10cmd/link: more cleanups for visibility hidden symbol handlingCherry Mui
CL 404296 removes the hidden visibility checks, but a few of them were left. Remove them as well. Change-Id: Idbcf37429709c91403803d32684239d398e43543 Reviewed-on: https://go-review.googlesource.com/c/go/+/404303 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
2022-05-06cmd/link: resolve relocations to .TOC. symbolCherry Mui
CL 404296 breaks the PPC64LE build because the .TOC. symbol is visibility hidden and was skipped from the "unresolved symbol" check (the check needs to be fix). In face, the .TOC. symbol is special in that it doesn't have a type but we have special logic to assign a value to it in the address pass. So we can actually resolve a relocation to .TOC.. We already have a special case for PIE. It also applies to non-PIE as well. Fix PPC64LE builds. Change-Id: Iaf7e36f10c4d0a40fc56b2135e5ff38815e203b1 Reviewed-on: https://go-review.googlesource.com/c/go/+/404302 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-06cmd/link: generate PPC64 ABI register save/restore functions if neededPaul E. Murphy
They are usually needed when internally linking gcc code compiled with -Os. These are typically generated by ld or gold, but are missing when linking internally. The PPC64 ELF ABI describes a set of functions to save/restore non-volatile, callee-save registers using R1/R0/R12: _savegpr0_n: Save Rn-R31 relative to R1, save LR (in R0), return _restgpr0_n: Restore Rn-R31 from R1, and return to saved LR _savefpr_n: Save Fn-F31 based on R1, and save LR (in R0), return _restfpr_n: Restore Fn-F31 from R1, and return to 16(R1) _savegpr1_n: Save Rn-R31 based on R12, return _restgpr1_n: Restore Rn-R31 based on R12, return _savevr_m: Save VRm-VR31 based on R0, R12 is scratch, return _restvr_m: Restore VRm-VR31 based on R0, R12 is scratch, return m is a value 20<=m<=31 n is a value 14<=n<=31 Add several new functions similar to those suggested by the PPC64 ELFv2 ABI. And update the linker to scan external relocs for these calls, and redirect them to runtime.elf_<func>+offset in runtime/asm_ppc64x.go. Similarly, code which generates plt stubs is moved into a dedicated function. This avoids an extra scan of relocs. fixes #52336 Change-Id: I2f0f8b5b081a7b294dff5c92b4b1db8eba9a9400 Reviewed-on: https://go-review.googlesource.com/c/go/+/400796 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Paul Murphy <murp@ibm.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-06cmd/link: fix handling of visibility hidden symbolsCherry Mui
There is a TODO comment that checking hidden visibility is probably not the right thing to do. I think it is indeed not. Here we are not referencing symbols across DSO boundaries, just within an executable binary. The hidden visibility is for references from another DSO. So it doesn't actually matter. This makes cgo internal linking tests work on ARM64 with newer GCC. It failed and was disabled due to a visibility hidden symbol in libgcc.a that we didn't handle correctly. Specifically, the problem is that we didn't mark visibility hidden symbol references SXREF, which caused the loader to not think it is an unresolved external symbol, which in turn made it not loading an object file from the libgcc.a archive which contains the actual definition. Later stage when we try to resolve the relocation, we couldn't resolve it. Enable the test as it works now. Fixes #39466. Change-Id: I2759e3ae15e7a7a1ab9a820223b688ad894509ed Reviewed-on: https://go-review.googlesource.com/c/go/+/404296 Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-02all: REVERSE MERGE dev.boringcrypto (cdcb4b6) into masterRuss Cox
This commit is a REVERSE MERGE. It merges dev.boringcrypto back into its parent branch, master. This marks the end of development on dev.boringcrypto. Manual Changes: - git rm README.boringcrypto.md - git rm -r misc/boring - git rm src/cmd/internal/notsha256/sha256block_arm64.s - git cherry-pick -n 5856aa74 # remove GOEXPERIMENT=boringcrypto forcing in cmd/dist There are some minor cleanups like merging import statements that I will apply in a follow-up CL. Merge List: + 2022-04-29 cdcb4b6ef3 [dev.boringcrypto] cmd/compile: remove the awful boringcrypto kludge + 2022-04-29 e845f572ec [dev.boringcrypto] crypto/ecdsa, crypto/rsa: use boring.Cache + 2022-04-29 a840bf871e [dev.boringcrypto] crypto/internal/boring: add GC-aware cache + 2022-04-29 0184fe5ece [dev.boringcrypto] crypto/x509: remove VerifyOptions.IsBoring + 2022-04-29 9e9c7a0aec [dev.boringcrypto] crypto/..., go/build: align deps test with standard rules + 2022-04-29 0ec08283c8 [dev.boringcrypto] crypto/internal/boring: make SHA calls allocation-free + 2022-04-29 3cb10d14b7 [dev.boringcrypto] crypto/internal/boring: avoid allocation in big.Int conversion + 2022-04-29 509776be5d [dev.boringcrypto] cmd/dist: default to use of boringcrypto + 2022-04-29 f4c0f42f99 [dev.boringcrypto] all: add boringcrypto build tags + 2022-04-29 1f0547c4ec [dev.boringcrypto] cmd/go: pass dependency syso to cgo too + 2022-04-29 e5407501cb [dev.boringcrypto] cmd: use notsha256 instead of md5, sha1, sha256 + 2022-04-29 fe006d6410 [dev.boringcrypto] cmd/internal/notsha256: add new package + 2022-04-27 ec7f5165dd [dev.boringcrypto] all: merge master into dev.boringcrypto + 2022-04-22 ca6fd39cf6 [dev.boringcrypto] misc/boring: skip long tests during build.release + 2022-04-21 19e4b10f2f [dev.boringcrypto] all: merge master into dev.boringcrypto + 2022-04-20 e07d63964b [dev.boringcrypto] all: merge master into dev.boringcrypto + 2022-04-13 1f11660f54 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2022-04-13 bc3e5d0ab7 [dev.boringcrypto] misc/boring: remove -trust and individual reviewers + 2022-04-05 4739b353bb [dev.boringcrypto] all: merge master into dev.boringcrypto + 2022-03-30 9d6ab825f6 [dev.boringcrypto] make.bash: disable GOEXPERIMENT when using bootstrap toolchain + 2022-03-30 d1405d7410 [dev.boringcrypto] crypto/internal/boring: update build instructions to use podman + 2022-03-29 50b8f490e1 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2022-03-15 0af0e19368 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2022-03-07 f492793839 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2022-03-07 768804dfdd [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2022-02-11 8521d1ea34 [dev.boringcrypto] misc/boring: use go install cmd@latest for installing command + 2022-02-11 b75258fdd8 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2022-02-08 74d25c624c [dev.boringcrypto] all: merge master into dev.boringcrypto + 2022-02-03 e14fee553a [dev.boringcrypto] all: merge master into dev.boringcrypto + 2022-01-14 d382493a20 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2021-12-09 069bbf5434 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2021-12-06 21fa0b2199 [dev.boringcrypto] crypto/internal/boring: add -pthread linker flag + 2021-12-03 a38b43e4ab [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2021-11-09 16215e5340 [dev.boringcrypto] cmd/compile: disable version test on boringcrypto + 2021-11-08 c9858c7bdc [dev.boringcrypto] all: merge master into dev.boringcrypto + 2021-11-05 ed07c49cb6 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2021-11-05 dc2658558d [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2021-10-28 69d5e469a4 [dev.boringcrypto] all: convert +build to //go:build lines in boring-specific files + 2021-10-08 2840ccbc05 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2021-10-08 114aa69932 [dev.boringcrypto] misc/boring: fix Docker Hub references + 2021-10-08 7d26add6d5 [dev.boringcrypto] misc/boring: publish to Artifact Registry + 2021-08-27 5ae200d526 [dev.boringcrypto] crypto/tls: permit P-521 in FIPS mode + 2021-08-26 083811d079 [dev.boringcrypto] crypto/tls: use correct config in TestBoringClientHello + 2021-08-16 c7e7ce5ec1 [dev.boringcrypto] all: merge commit 57c115e1 into dev.boringcrypto + 2021-08-10 1fb58d6cad [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2021-07-14 934db9f0d6 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2021-06-08 a890a4de30 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2021-05-13 ed1f812cef [dev.boringcrypto] all: merge commit 9d0819b27c (CL 314609) into dev.boringcrypto + 2021-05-10 ad1b6f3ee0 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2021-04-21 11061407d6 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2021-03-23 b397e0c028 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2021-03-15 128cecc70b [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2021-03-10 5e2f5a38c4 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2021-02-26 42089e72fd [dev.boringcrypto] api: add crypto/boring.Enabled + 2021-02-24 03cd666173 [dev.boringcrypto] all: merge master (5b76343) into dev.boringcrypto + 2021-02-17 0f210b75f9 [dev.boringcrypto] all: merge master (2f0da6d) into dev.boringcrypto + 2021-02-12 1aea1b199f [dev.boringcrypto] misc/boring: support codereview.cfg in merge.sh + 2021-02-07 0d34d85dee [dev.boringcrypto] crypto/internal/boring: remove .llvm_addrsig section + 2021-02-07 325e03a64f [dev.boringcrypto] all: add codereview.cfg + 2021-02-05 d4f73546c8 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2021-01-20 cf8ed7cca4 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2021-01-20 f22137d785 [dev.boringcrypto] misc/boring: add -trust and roland@ to merge.sh and release.sh + 2020-12-12 e5c7bd0efa [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2020-12-02 5934c434c1 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2020-12-01 dea96ada17 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2020-11-18 906d6e362b [dev.boringcrypto] all: merge master into dev.boringcrypto + 2020-11-18 95ceba18d3 [dev.boringcrypto] crypto/hmac: merge up to 2a206c7 and skip test + 2020-11-17 0985c1bd2d [dev.boringcrypto] all: merge master into dev.boringcrypto + 2020-11-16 af814af6e7 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2020-11-05 f42bd50779 [dev.boringcrypto] crypto/internal/boring: update BoringCrypto module to certificate 3678 + 2020-10-19 ceda58bfd0 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2020-09-29 af85c47233 [dev.boringcrypto] misc/boring: bump version to b6 + 2020-09-29 f9b86a6562 [dev.boringcrypto] go/build: satisfy the boringcrypto build tag + 2020-09-29 ef2b318974 [dev.boringcrypto] crypto/boring: expose boring.Enabled() + 2020-09-14 3782421230 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2020-08-18 6bbe47ccb6 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2020-07-21 6e6e0b73d6 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2020-07-09 d85ef2b979 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2020-07-09 a91ad4250c [dev.boringcrypto] all: merge master into dev.boringcrypto + 2020-06-10 5beb39baf8 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2020-05-07 dd98c0ca3f [dev.boringcrypto] all: merge master into dev.boringcrypto + 2020-05-07 a9d2e3abf7 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2020-05-07 c19c0a047b [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2020-05-07 36c94f8421 [dev.boringcrypto] crypto/internal/boring: reject short signatures in VerifyRSAPKCS1v15 + 2020-05-07 ee159d2f35 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2020-04-08 e067ce5225 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2020-03-03 79284c2873 [dev.boringcrypto] crypto/internal/boring: make accesses to RSA types with finalizers safer + 2020-03-02 6c64b188a5 [dev.boringcrypto] crypto/internal/boring: update BoringCrypto module to certificate 3318 + 2020-02-28 13355c78ff [dev.boringcrypto] misc/boring: add go1.14b4 to RELEASES file + 2020-02-28 4980c6b317 [dev.boringcrypto] misc/boring: x/build/cmd/release doesn't take subrepo flags anymore + 2020-02-28 601da81916 [dev.boringcrypto] misc/boring: make merge.sh and release.sh a little more robust + 2020-02-14 09bc5e8723 [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2020-02-06 f96dfe6b73 [dev.boringcrypto] misc/boring: add go1.13.7b4 and go1.12.16b4 releases to RELEASES file + 2020-02-05 2f9b2e75c4 [dev.boringcrypto] misc/docker: update Dockerfile to match recent Buster based golang images + 2020-02-05 527880d05c [dev.boringcrypto] misc/boring: update default CL reviewer to katie@golang.org + 2019-11-25 50ada481fb [dev.boringcrypto] misc/boring: add new releases to RELEASES file + 2019-11-20 6657395adf [dev.boringcrypto] all: merge master into dev.boringcrypto + 2019-11-20 ab0a649d44 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2019-11-19 62ce702c77 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2019-10-25 e8f14494a0 [dev.boringcrypto] misc/boring: add go1.13.3b4 and go1.12.12b4 to RELEASES file + 2019-10-17 988e4d832e [dev.boringcrypto] misc/boring: add go1.13.2b4 and go1.12.11b4 to RELEASES file + 2019-10-11 974fd1301a [dev.boringcrypto] misc/boring: publish to Docker Hub all releases, not only the latest + 2019-09-27 62ce8cd3ad [dev.boringcrypto] misc/boring: add go1.13.1b4 and go1.12.10b4 to RELEASES file + 2019-09-10 489d268683 [dev.boringcrypto] misc/boring: add Go+BoringCrypto 1.13b4 to RELEASES file + 2019-09-04 e0ee09095c [dev.boringcrypto] all: merge master into dev.boringcrypto + 2019-09-03 ff197f326f [dev.boringcrypto] all: merge master into dev.boringcrypto + 2019-08-21 5a1705286e [dev.boringcrypto] misc/boring: add go1.12.9b4 to RELEASES + 2019-08-15 1ebc594b3c [dev.boringcrypto] misc/boring: add go1.12.8b4 and go1.11.13b4 to RELEASES + 2019-08-13 9417029290 [dev.boringcrypto] misc/boring: remove download of releaselet.go in build.release + 2019-08-05 2691091a4a misc/boring: add Go 1.11.12b4 and 1.12.7b4 to RELEASES + 2019-07-19 6eccf6a6cd [dev.boringcrypto] misc/boring: add scripts to automate merges and releases + 2019-06-27 98188f3001 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2019-06-13 5c354e66d1 [dev.boringcrypto] misc/boring: add go1.12.6b4 and go1.11.11b4 releases + 2019-06-09 9bf9e7d4b2 [dev.boringcrypto] crypto: move crypto/internal/boring imports to reduce merge conflicts + 2019-06-05 324f8365be [dev.boringcrypto] all: merge master into dev.boringcrypto + 2019-05-28 e48f228c9b [dev.boringcrypto] all: merge master into dev.boringcrypto + 2019-05-14 42e353245c [dev.boringcrypto] misc/boring: add go1.12.5b4 release + 2019-03-29 211a13fd44 [dev.boringcrypto] misc/boring: add go1.11.6b4 to RELEASES + 2019-03-28 347af7f060 [dev.boringcrypto] misc/boring: add go1.12.1b4 and update build scripts + 2019-02-27 a10558f870 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2019-02-08 4ed8ad4d69 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2019-01-24 14c64dbc4a [dev.boringcrypto] misc/boring: add go1.10.8b4 and go1.11.5b4 + 2018-12-15 3f9e53f346 [dev.boringcrypto] misc/boring: add go1.10.7b4 and go1.11.4b4 releases + 2018-12-14 92d975e906 [dev.boringcrypto] misc/boring: add go1.11.2b4 release + 2018-11-14 c524da4917 [dev.boringcrypto] crypto/tls: test for TLS 1.3 to be disabled in FIPS mode + 2018-11-14 bfd6d30118 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2018-11-14 0007017f96 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2018-11-14 3169778c15 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2018-11-14 ab37582eb0 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2018-11-14 e8b3500d5c [dev.boringcrypto] all: merge master into dev.boringcrypto + 2018-11-14 de153ac2a1 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2018-11-14 0cbb11c720 [dev.boringcrypto] cmd/compile: by default accept any language + 2018-11-13 11e916773e [dev.boringcrypto] all: merge master into dev.boringcrypto + 2018-11-13 af07f7734b [dev.boringcrypto] all: merge master into dev.boringcrypto + 2018-10-25 13bf5b80e8 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2018-10-15 623650b27a [dev.boringcrypto] all: merge master into dev.boringcrypto + 2018-10-01 36c789b1fd [dev.boringcrypto] misc/boring: add go1.10.4b4 and go1.11b4 releases + 2018-09-07 693875e3f2 [dev.boringcrypto] crypto/internal/boring: avoid an allocation in AES-GCM Seal and Open + 2018-09-06 4d1aa482b8 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2018-08-04 7eb1677c01 [dev.boringcrypto] crypto/internal/boring: fix aesCipher implementation of gcmAble + 2018-07-11 eaa3e94eb8 [dev.boringcrypto] misc/boring: add go1.9.7b4 and go1.10.3b4 releases + 2018-07-11 5f0402a26b [dev.boringcrypto] misc/boring: support build.release on macOS + 2018-07-03 77db076129 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2018-06-13 b77f5e4c85 [dev.boringcrypto] crypto/rsa: drop random source reading emulation + 2018-06-08 a4b7722ffa [dev.boringcrypto] all: merge master into dev.boringcrypto + 2018-05-29 18db93d7e6 [dev.boringcrypto] crypto/tls: restore AES-GCM priority when BoringCrypto is enabled + 2018-05-25 3d9a6ac709 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2018-05-18 019a994e32 [dev.boringcrypto] crypto/rsa: fix boringFakeRandomBlind to work with (*big.Int).ModInverse + 2018-05-17 a3f9ce3313 [dev.boringcrypto] all: merge master into dev.boringcrypto + 2018-02-09 528dad8c72 [dev.cryptoboring] misc/boring: update README for Bazel + 2018-02-06 c3d83ee31c [dev.boringcrypto] misc/boring: add go1.9.3b4 to RELEASES + 2017-12-13 f62a24349d [dev.boringcrypto] all: merge go1.10beta1 into dev.boringcrypto + 2017-12-06 3e52f22ece [dev.boringcrypto] crypto/internal/boring: add MarshalBinary/UnmarshalBinary to hashes + 2017-12-06 5379f7847f [dev.boringcrypto] all: merge master (more nearly Go 1.10 beta 1) into dev.boringcrypto + 2017-12-06 185e6094fd [dev.boringcrypto] all: merge master (nearly Go 1.10 beta 1) into dev.boringcrypto + 2017-11-20 c36033a379 [dev.boringcrypto] misc/boring: add go1.9.2b4 release + 2017-11-20 cda3c6f91d [dev.boringcrypto] all: merge go1.9.2 into dev.boringcrypto + 2017-10-25 2ea7d3461b [release-branch.go1.9] go1.9.2 + 2017-10-25 d93cb46280 [release-branch.go1.9] runtime: use simple, more robust fastrandn + 2017-10-25 78952c06c5 [release-branch.go1.9] cmd/compile: fix sign-extension merging rules + 2017-10-25 79996e4a1d [release-branch.go1.9] cmd/compile: avoid generating large offsets + 2017-10-25 f36b12657c [release-branch.go1.9] runtime: in cpuProfile.addExtra, set p.lostExtra to 0 after flush + 2017-10-25 dffc9319f1 [release-branch.go1.9] cmd/cgo: support large unsigned macro again + 2017-10-25 33ce1682c7 [release-branch.go1.9] cmd/cgo: avoid using common names for sniffing + 2017-10-25 f69668e1d0 [release-branch.go1.9] os: skip TestPipeThreads as flaky for 1.9 + 2017-10-25 9be38a15e4 [release-branch.go1.9] runtime: avoid monotonic time zero on systems with low-res timers + 2017-10-25 8bb333a9c0 [release-branch.go1.9] doc: document Go 1.9.2 + 2017-10-25 0758d2b9da [release-branch.go1.9] cmd/go: clean up x.exe properly in TestImportMain + 2017-10-25 d487b15a61 [release-branch.go1.9] cmd/compile: omit ICE diagnostics after normal error messages + 2017-10-25 fd17253587 [release-branch.go1.9] database/sql: prevent race in driver by locking dc in Next + 2017-10-25 7e7cb30475 [release-branch.go1.9] internal/poll: only call SetFileCompletionNotificationModes for sockets + 2017-10-25 f259aed082 [release-branch.go1.9] internal/poll: do not call SetFileCompletionNotificationModes if it is broken + 2017-10-25 39d4bb9c0f [release-branch.go1.9] cmd/go: correct directory used in checkNestedVCS test + 2017-10-25 bfc22319aa [release-branch.go1.9] crypto/x509: reject intermediates with unknown critical extensions. + 2017-10-25 a1e34abfb3 [release-branch.go1.9] net/smtp: NewClient: set tls field to true when already using a TLS connection + 2017-10-25 7dadd8d517 [release-branch.go1.9] net: increase expected time to dial a closed port on all Darwin ports + 2017-10-25 d80889341c [release-branch.go1.9] cmd/compile: fix merge rules for panic calls + 2017-10-25 87b3a27839 [release-branch.go1.9] net: bump TestDialerDualStackFDLeak timeout on iOS + 2017-10-25 ebfcdef901 [release-branch.go1.9] runtime: make runtime.GC() trigger GC even if GOGC=off + 2017-10-25 0ab99b396d [release-branch.go1.9] cmd/compile: fix regression in PPC64.rules move zero + 2017-10-25 8d4279c111 [release-branch.go1.9] internal/poll: be explicit when using runtime netpoller + 2017-10-25 1ded8334f7 [release-branch.go1.9] cmd/compile/internal/syntax: fix source buffer refilling + 2017-10-25 ff8289f879 [release-branch.go1.9] reflect: fix pointer past-the-end in Call with zero-sized return value + 2017-10-25 bd34e74134 [release-branch.go1.9] log: fix data race on log.Output + 2017-10-25 0b55d8dbfc [release-branch.go1.9] cmd/compile: replace GOROOT in //line directives + 2017-10-25 5c48811aec [release-branch.go1.9] cmd/compile: limit the number of simultaneously opened files to avoid EMFILE/ENFILE errors + 2017-10-25 8c7fa95ad3 [release-branch.go1.9] expvar: make (*Map).Init clear existing keys + 2017-10-25 ccd5abc105 [release-branch.go1.9] cmd/compile: simplify "missing function body" error message + 2017-10-25 2e4358c960 [release-branch.go1.9] time: fix documentation of Round, Truncate behavior for d <= 0 + 2017-10-25 c6388d381e [release-branch.go1.9] runtime: capture runtimeInitTime after nanotime is initialized + 2017-10-25 724638c9d8 [release-branch.go1.9] crypto/x509: skip TestSystemRoots + 2017-10-25 ed3b0d63b7 [release-branch.go1.9] internal/poll: add tests for Windows file and serial ports + 2017-10-04 93322a5b3d [release-branch.go1.9] doc: add missing "Minor revisions" header for 1.9 + 2017-10-04 7f40c1214d [release-branch.go1.9] go1.9.1 + 2017-10-04 598433b17a [release-branch.go1.9] doc: document go1.9.1 and go1.8.4 + 2017-10-04 815cad3ed0 [release-branch.go1.9] doc/1.9: add mention of net/http.LocalAddrContextKey + 2017-10-04 1900d34a10 [release-branch.go1.9] net/smtp: fix PlainAuth to refuse to send passwords to non-TLS servers + 2017-10-04 a39bcecea6 [release-branch.go1.9] cmd/go: reject update of VCS inside VCS + 2017-10-04 d9e64910af [release-branch.go1.9] runtime: deflake TestPeriodicGC + 2017-09-28 adc1f587ac [dev.boringcrypto] misc/boring: add src releases + 2017-09-25 4038503543 [dev.boringcrypto] misc/boring: add go1.8.3b4 + 2017-09-25 d724c60b4d [dev.boringcrypto] misc/boring: update README + 2017-09-22 70bada9db3 [dev.boringcrypto] misc/boring: add go1.9b4 release + 2017-09-22 e6ad24cde7 [dev.boringcrypto] all: merge go1.9 into dev.boringcrypto + 2017-09-22 431e071eed [dev.boringcrypto] misc/boring: add go1.9rc2b4 release + 2017-09-22 cc6e26b2e1 [dev.boringcrypto] api: add crypto/x509.VerifyOptions.IsBoring to make release builder happy + 2017-09-22 bac02b14b5 [dev.boringcrypto] misc/boring: update VERSION + 2017-09-22 3ed08db261 [dev.boringcrypto] crypto/tls/fipsonly: new package to force FIPS-allowed TLS settings + 2017-09-20 2ba76155cd [dev.boringcrypto] crypto/internal/boring: fix finalizer-induced crashes + 2017-09-18 32dc9b247f [dev.boringcrypto] cmd/go: exclude SysoFiles when using -msan + 2017-09-18 9f025cbdeb [dev.boringcrypto] crypto/internal/boring: fall back to standard crypto when using -msan + 2017-09-18 89ba9e3541 [dev.boringcrypto] crypto/aes: panic on invalid dst, src overlap + 2017-09-18 a929f3a04d [dev.boringcrypto] crypto/rsa: fix boring GenerateKey to set non-nil Precomputed.CRTValues + 2017-09-18 aa4a4a80ff [dev.boringcrypto] crypto/internal/boring: fix detection of tests to allow *.test and *_test + 2017-09-18 c9e2d9eb06 [dev.boringcrypto] crypto/rsa: add test for, fix observable reads from custom randomness + 2017-09-18 e773ea9aa3 [dev.boringcrypto] crypto/hmac: add test for Write/Sum after Sum + 2017-09-18 8fa8f42cb3 [dev.boringcrypto] crypto/internal/boring: allow hmac operations after Sum + 2017-09-18 07f6ce9d39 [dev.boringcrypto] crypto/internal/boring: handle RSA verification of short signatures + 2017-09-14 e8eec3fbdb [dev.boringcrypto] cmd/compile: refine BoringCrypto kludge + 2017-08-30 7b49445d0f [dev.boringcrypto] cmd/compile: hide new boring fields from reflection + 2017-08-30 81b9d733b0 [dev.boringcrypto] crypto/hmac: test empty key + 2017-08-30 f6358bdb6c [dev.boringcrypto] crypto/internal/boring: fix NewHMAC with empty key + 2017-08-30 9c307d8039 [dev.boringcrypto] crypto/internal/cipherhw: fix AESGCMSupport for BoringCrypto + 2017-08-26 f48a9fb815 [dev.boringcrypto] misc/boring: release packaging + 2017-08-25 94fb8224b2 [dev.boringcrypto] crypto/internal/boring: disable for android & non-cgo builds + 2017-08-25 7ff9fcafbd [dev.boringcrypto] crypto/internal/boring: clear "executable stack" bit from syso + 2017-08-24 c8aec4095e [release-branch.go1.9] go1.9 + 2017-08-24 b8c9ef9f09 [release-branch.go1.9] doc: add go1.9 to golang.org/project + 2017-08-24 136f4a6b2a [release-branch.go1.9] doc: document go1.9 + 2017-08-24 867be4c60c [release-branch.go1.9] doc/go1.9: fix typo in Moved GOROOT + 2017-08-24 d1351fbc31 [dev.boringcrypto] cmd/link: allow internal linking for crypto/internal/boring + 2017-08-24 991652dcf0 [dev.boringcrypto] cmd/link: work around DWARF symbol bug + 2017-08-22 9a4e7942ea [release-branch.go1.9] cmd/compile: remove gc.Sysfunc calls from 387 backend + 2017-08-22 ff38035a62 [release-branch.go1.9] doc/go1.9: fix typo in crypto/x509 of "Minor changes to the library". + 2017-08-19 7e9e3a06cb [dev.boringcrypto] crypto/rsa: use BoringCrypto + 2017-08-19 bc38fda367 [dev.boringcrypto] crypto/ecdsa: use unsafe.Pointer instead of atomic.Value + 2017-08-18 42046e8989 [release-branch.go1.9] runtime: fix false positive race in profile label reading + 2017-08-18 fbf7e1f295 [release-branch.go1.9] testing: don't fail all tests after racy test failure + 2017-08-18 21312a4b5e [release-branch.go1.9] cmd/dist: update deps.go for current dependencies + 2017-08-18 5927854f7d [release-branch.go1.9] cmd/compile: add rules handling unsigned div/mod by constant 1<<63 + 2017-08-18 65717b2dca [release-branch.go1.9] runtime: fix usleep by correctly setting nanoseconds parameter for pselect6 + 2017-08-17 b1f201e951 [dev.boringcrypto] crypto/ecdsa: use BoringCrypto + 2017-08-17 2efded1cd2 [dev.boringcrypto] crypto/tls: use TLS-specific AES-GCM mode if available + 2017-08-17 335a0f87bf [dev.boringcrypto] crypto/aes: implement TLS-specific AES-GCM mode from BoringCrypto + 2017-08-17 8d05ec9e58 [dev.boringcrypto] crypto/aes: use BoringCrypto + 2017-08-17 74e33c43e9 [dev.boringcrypto] crypto/hmac: use BoringCrypto + 2017-08-17 96d6718e4f [dev.boringcrypto] crypto/sha1,sha256,sha512: use BoringCrypto + 2017-08-17 e0e2bbdd00 [dev.boringcrypto] runtime/race: move TestRaceIssue5567 from sha1 to crc32 + 2017-08-17 fe02ba30f1 [dev.boringcrypto] crypto/rand: use BoringCrypto + 2017-08-17 6e70f88f84 [dev.boringcrypto] crypto/internal/boring: add initial BoringCrypto access + 2017-08-16 dcdcc38440 [dev.boringcrypto] add README.boringcrypto.md, update VERSION + 2017-08-16 19b89a22df [dev.boringcrypto] cmd/link: implement R_X86_64_PC64 relocations + 2017-08-07 048c9cfaac [release-branch.go1.9] go1.9rc2 + 2017-08-07 cff0de3da3 [release-branch.go1.9] all: merge master into release-branch.go1.9 + 2017-07-31 196492a299 [release-branch.go1.9] runtime: map bitmap and spans during heap initialization + 2017-07-31 1a6d87d4bf [release-branch.go1.9] runtime: fall back to small mmaps if we fail to grow reservation + 2017-07-27 7320506bc5 [release-branch.go1.9] cmd/dist: skip moved GOROOT on Go's Windows builders when not sharding tests + 2017-07-24 65c6c88a94 [release-branch.go1.9] go1.9rc1 + 2017-07-24 fbc9b49790 [release-branch.go1.9] cmd/compile: consider exported flag in namedata Change-Id: I5344e8e4813a9a0900f6633499a3ddf22895a4d5
2022-05-02all: use os/exec instead of internal/execabsRuss Cox
We added internal/execabs back in January 2021 in order to fix a security problem caused by os/exec's handling of the current directory. Now that os/exec has that code, internal/execabs is superfluous and can be deleted. This commit rewrites all the imports back to os/exec and deletes internal/execabs. For #43724. Change-Id: Ib9736baf978be2afd42a1225e2ab3fd5d33d19df Reviewed-on: https://go-review.googlesource.com/c/go/+/381375 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-04-29[dev.boringcrypto] all: add boringcrypto build tagsRuss Cox
A plain make.bash in this tree will produce a working, standard Go toolchain, not a BoringCrypto-enabled one. The BoringCrypto-enabled one will be created with: GOEXPERIMENT=boringcrypto ./make.bash For #51940. Change-Id: Ia9102ed993242eb1cb7f9b93eca97e81986a27b3 Reviewed-on: https://go-review.googlesource.com/c/go/+/395881 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-04-29[dev.boringcrypto] cmd: use notsha256 instead of md5, sha1, sha256Russ Cox
When we add GOEXPERIMENT=boringcrypto, the bootstrap process will not converge if the compiler itself depends on the boringcrypto cgo-based implementations of sha1 and sha256. Using notsha256 avoids boringcrypto and makes bootstrap converge. Removing md5 is not strictly necessary but it seemed worthwhile to be consistent. For #51940. Change-Id: Iba649507e0964d1a49a1d16e463dd23c4e348f14 Reviewed-on: https://go-review.googlesource.com/c/go/+/402595 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-04-27[dev.boringcrypto] all: merge master into dev.boringcryptoChressie Himpel
Change-Id: Ic5f71c04f08c03319c043f35be501875adb0a3b0
2022-04-20cmd/link: fix StackCheckOutput on AIXAustin Clements
This test forces GOARCH to amd64, but currently uses the default GOOS. This works on every OS that supports amd64, which is every OS we support except AIX. Hence, on AIX this fails with an unsupported GOOS/GOARCH combination. Fix this by forcing GOOS to linux. Fixes #52451. Change-Id: I9321dd6386c7ef0fe2b47d77ed900aafc53f2a46 Reviewed-on: https://go-review.googlesource.com/c/go/+/401334 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Auto-Submit: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-04-20[dev.boringcrypto] all: merge master into dev.boringcryptoChressie Himpel
Change-Id: I52009bf809dda4fbcff03aa82d0ea8aa2a978fa2
2022-04-19cmd/link: faster algorithm for nosplit stack checking, better errorsAustin Clements
The linker performs a global analysis of all nosplit call chains to check they fit in the stack space ensured by splittable functions. That analysis has two problems right now: 1. It's inefficient. It performs a top-down analysis, starting with every nosplit function and the nosplit stack limit and walking *down* the call graph to compute how much stack remains at every call. As a result, it visits the same functions over and over, often with different remaining stack depths. This approach is historical: this check was originally written in C and this approach avoided the need for any interesting data structures. 2. If some call chain is over the limit, it only reports a single call chain. As a result, if the check does fail, you often wind up playing whack-a-mole by guessing where the problem is in the one chain, trying to reduce the stack size, and then seeing if the link works or reports a different path. This CL completely rewrites the nosplit stack check. It now uses a bottom-up analysis, computing the maximum stack height required by every function's call tree. This visits every function exactly once, making it much more efficient. It uses slightly more heap space for intermediate storage, but still very little in the scheme of the overall link. For example, when linking cmd/go, the new algorithm virtually eliminates the time spent in this pass, and reduces overall link time: │ before │ after │ │ sec/op │ sec/op vs base │ Dostkcheck 7.926m ± 4% 1.831m ± 6% -76.90% (p=0.000 n=20) TotalTime 301.3m ± 1% 296.4m ± 3% -1.62% (p=0.040 n=20) │ before │ after │ │ B/op │ B/op vs base │ Dostkcheck 40.00Ki ± 0% 212.15Ki ± 0% +430.37% (p=0.000 n=20) Most of this time is spent analyzing the runtime, so for larger binaries, the total time saved is roughly the same, and proportionally less of the overall link. If the new implementation finds an error, it redoes the analysis, switching to preferring quality of error reporting over performance. For error reporting, it computes stack depths top-down (like the old algorithm), and reports *all* paths that are over the stack limit, presented as a tree for compactness. For example, this is the output from a simple test case from test/nosplit with two over-limit paths from f1: main.f1: nosplit stack overflow main.f1 grows 768 bytes, calls main.f2 grows 56 bytes, calls main.f4 grows 48 bytes 80 bytes over limit grows 768 bytes, calls main.f3 grows 104 bytes 80 bytes over limit While we're here, we do a few nice cleanups: - We add a debug output flag, which will be useful for understanding what our nosplit chains look like and which ones are close to running over. - We move the implementation out of the fog of lib.go to its own file. - The implementation is generally more Go-like and less C-like. Change-Id: If1ab31197f5215475559b93695c44a01bd16e276 Reviewed-on: https://go-review.googlesource.com/c/go/+/398176 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-04-19cmd/compile,cmd/internal/obj: replace Ctxt.FixedFrameSize method with Arch fieldAustin Clements
And delete now-unused FixedFrameSize methods. Change-Id: Id257e1647dbeb4eb4ab866c53744010c4efeb953 Reviewed-on: https://go-review.googlesource.com/c/go/+/400819 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-04-19internal/sys: add LR and fixed frame size to sys.ArchAustin Clements
Storing this information in the Arch eliminates some code duplication between the compiler and linker. This information is entirely determined by the Arch, so the current approach of attaching it to an entire Ctxt is a little silly. This will also make it easier to use this information from tests. The next CL will be a rote refactoring to eliminate the Ctxt.FixedFrameSize methods. Change-Id: I315c524fa66a0ea99f63ae5a2a6fdc367d843bad Reviewed-on: https://go-review.googlesource.com/c/go/+/400818 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-04-19cmd/link: use TOC-relative trampolines on PPC64 when neededPaul E. Murphy
When linking a PIE binary with the internal linker, TOC relative relocations need to be generated. Update trampolines to indirect call using R12 to more closely match the AIX/ELFv2 regardless of buildmode, and work with position-indepdent code. Likewise, update the check for offseting R_CALLPOWER relocs to make a local call. It should be checking ldr.AttrExternal, not ldr.IsExternal. This offset should not be adjusted for external (non-go) object files, it is handled when ELF reloc are translated into go relocs. And, update trampoline tests to verify these are generated correctly and produce a working binary using -buildmode=pie on ppc64le. Fixes #52337 Change-Id: I8a2dea06c3237bdf0e87888b56a17b6c4c99a7de Reviewed-on: https://go-review.googlesource.com/c/go/+/400234 Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Paul Murphy <murp@ibm.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-04-15cmd/link: preserve symbol attributes when cloning to externalCherry Mui
There are some symbol attributes that are encoded in the object file. Currently, they are lost when cloning a symbol to external. Copy them over. Also delete CopyAttributes as it is no longer called anywhere. Change-Id: I1497e3223a641704bf35aa3e904dd0eda2f8ec3e Reviewed-on: https://go-review.googlesource.com/c/go/+/400574 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2022-04-12cmd/link: mangle symbol ABI name for linker-generated symbolsCherry Mui
The ABI mangling code skips symbols that are not loaded from Go objects. Usually that is fine, as other symbols don't need name mangling. But trampolines are linker generated and have the same symbol version (ABI) as the underlying symbol. We need to avoid symbol name collisions for trampolines, such as a trampoline to f<ABI0> and a trampoline to f<ABIInternal>. We could explicitly incorportate the ABI into the trampoline name. But as we already have the name mangling scheme we could just use that. The original code excludes external symbols probably because symbols from C object don't need mangling. But a C symbol and a Go symbol shouldn't have same name, and so the condition won't apply. Also exclude static symbols as they don't need mangling. Change-Id: I298eb1d64bc0c3da0154f0146b95c4d26ca2f47a Reviewed-on: https://go-review.googlesource.com/c/go/+/399894 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2022-04-12cmd/link: don't sort pclntab entriesKeith Randall
They are already in a good order. The sort here does nothing, as all the SymValues are 0. Sorting just arbitrarily permutes items because everything is equal and the sort isn't stable. Not sure why the ordering of these symbols matter. That ordering was added in CL 243223. Change-Id: Iee153394afdb39387701cfe0375bc022cf4bd489 Reviewed-on: https://go-review.googlesource.com/c/go/+/399540 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Keith Randall <khr@google.com>
2022-04-11all: gofmt main repoRuss Cox
[This CL is part of a sequence implementing the proposal #51082. The design doc is at https://go.dev/s/godocfmt-design.] Run the updated gofmt, which reformats doc comments, on the main repository. Vendored files are excluded. For #51082. Change-Id: I7332f099b60f716295fb34719c98c04eb1a85407 Reviewed-on: https://go-review.googlesource.com/c/go/+/384268 Reviewed-by: Jonathan Amsterdam <jba@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-04-05all: separate doc comment from //go: directivesRuss Cox
A future change to gofmt will rewrite // Doc comment. //go:foo to // Doc comment. // //go:foo Apply that change preemptively to all comments (not necessarily just doc comments). For #51082. Change-Id: Iffe0285418d1e79d34526af3520b415a12203ca9 Reviewed-on: https://go-review.googlesource.com/c/go/+/384260 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-04-05all: replace `` and '' with “ (U+201C) and ” (U+201D) in doc commentsRuss Cox
go/doc in all its forms applies this replacement when rendering the comments. We are considering formatting doc comments, including doing this replacement as part of the formatting. Apply it to our source files ahead of time. For #51082. Change-Id: Ifcc1f5861abb57c5d14e7d8c2102dfb31b7a3a19 Reviewed-on: https://go-review.googlesource.com/c/go/+/384262 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>