aboutsummaryrefslogtreecommitdiff
path: root/src/plugin
AgeCommit message (Collapse)Author
2021-02-20all: go fmt std cmd (but revert vendor)Russ Cox
Make all our package sources use Go 1.17 gofmt format (adding //go:build lines). Part of //go:build change (#41184). See https://golang.org/design/draft-gobuild Change-Id: Ia0534360e4957e58cd9a18429c39d0e32a6addb4 Reviewed-on: https://go-review.googlesource.com/c/go/+/294430 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-10-09all: remove the nacl port (part 1)Brad Fitzpatrick
You were a useful port and you've served your purpose. Thanks for all the play. A subsequent CL will remove amd64p32 (including assembly files and toolchain bits) and remaining bits. The amd64p32 removal will be separated into its own CL in case we want to support the Linux x32 ABI in the future and want our old amd64p32 support as a starting point. Updates #30439 Change-Id: Ia3a0c7d49804adc87bf52a4dea7e3d3007f2b1cd Reviewed-on: https://go-review.googlesource.com/c/go/+/199499 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-09-03plugin: add freebsd/amd64 plugin supportAyan George
Change-Id: I4e7b0e99fd0f6f7d6a8ef60e9d3cb5baeb80a2b6 Reviewed-on: https://go-review.googlesource.com/c/go/+/191617 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-03-18cmd/compile: reorganize init functionsKeith Randall
Instead of writing an init function per package that does the same thing for every package, just write that implementation once in the runtime. Change the compiler to generate a data structure that encodes the required initialization operations. Reduces cmd/go binary size by 0.3%+. Most of the init code is gone, including all the corresponding stack map info. The .inittask structures that replace them are quite a bit smaller. Most usefully to me, there is no longer an init function in every -S output. (There is an .inittask global there, but it's much less distracting.) After this CL we could change the name of the "init.ializers" function back to just "init". Update #6853 R=go1.13 Change-Id: Iec82b205cc52fe3ade4d36406933c97dbc9c01b1 Reviewed-on: https://go-review.googlesource.com/c/go/+/161337 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2018-11-28plugin: fix build constraint to disable test on linux/arm64Tobias Klauser
CL 151478 was suppose to fix the build failure on linux/arm64 but the build constraint didn't exclude linux/arm64 properly. Fixes #28982 Change-Id: Ia80265b0adba0384cd28bc2deb1726418664975a Reviewed-on: https://go-review.googlesource.com/c/151303 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-11-28plugin: skip building tests on linux/arm64Alex Brainman
It appears that linux/arm64 https://build.golang.org/log/6808dbded6aebadf68cb65a0e30e4d1a62cd687b fails with /workdir/go/pkg/tool/linux_arm64/link: running gcc failed: exit status 1 /usr/bin/ld.gold: internal error in global, at ../../gold/aarch64.cc:4973 collect2: error: ld returned 1 exit status FAIL plugin [build failed] error. So stop building these tests on linux/arm64. Fixes linux/arm64 build Change-Id: I41eb3d9659f7967d80136513899a5203bbf03fb1 Reviewed-on: https://go-review.googlesource.com/c/151478 Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2018-11-27cmd/link: do not use _GLOBAL_OFFSET_TABLE_ on windows/386Alex Brainman
When building windows/386 executable that imports "plugin" package, cmd/link adds reference to DLL with blank name. Running objdump -x a.exe reports ... The Import Tables (interpreted .idata section contents) ... DLL Name: vma: Hint/Ord Member-Name Bound-To 25308a 0 _GLOBAL_OFFSET_TABLE_ ... So, obviously, executable cannot run, because Windows complains that it cannot find DLL when trying to run it. Stop using _GLOBAL_OFFSET_TABLE_ on windows/386. Fixes #28789 Change-Id: Idd489eafd998f6e329f40c5d90a2a8965ab1d873 Reviewed-on: https://go-review.googlesource.com/c/151139 Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-08-22plugin: remove unused funcDiego Siqueira
Change-Id: Ife29464d581f00940af7ef9251bf99661c1350b6 GitHub-Last-Rev: d7747706584b06b619fc78a85b6b9bfe619467c8 GitHub-Pull-Request: golang/go#26740 Reviewed-on: https://go-review.googlesource.com/127195 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-05-08plugin: make stub lookup signature match dlopen versionZhou Peng
Change-Id: I64958f8f1a935adc07868362975447d0c0033084 Reviewed-on: https://go-review.googlesource.com/111716 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-12plugin: document support for macOSDavid Crawshaw
All plugins issues I would call bugs now closed, so (with some amount of optimism) update the plugin documentation. Change-Id: Ia421c18a166d7cdf599ac86f2336541c1ef42a0d Reviewed-on: https://go-review.googlesource.com/65670 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-10-26cmd/link, plugin: always encode pathDavid Crawshaw
Both the linker and the plugin package were inconsistent about when they applied the path encoding defined in objabi.PathToPrefix. As a result, only some symbols from a package path that required encoding were being found. So always encoding the path. Fixes #22295 Change-Id: Ife86c79ca20b2e9307008ed83885e193d32b7dc4 Reviewed-on: https://go-review.googlesource.com/72390 Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-09runtime, plugin: error not throw on duplicate openDavid Crawshaw
Along the way, track bad modules. Make sure they don't end up on the active modules list, and aren't accidentally reprocessed as new plugins. Fixes #19004 Change-Id: I8a5e7bb11f572f7b657a97d521a7f84822a35c07 Reviewed-on: https://go-review.googlesource.com/61171 Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-08-17{net,os/user,plugin}: eliminate unnecessary C round-tripsBryan C. Mills
We're making two extra round-trips to C to malloc and free strings that originate in Go and don't escape. Skip those round-trips by allocating null-terminated slices in Go memory instead. Change-Id: I9e4c5ad999a7924ba50b82293c52073ec75518be Reviewed-on: https://go-review.googlesource.com/56530 Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-07-28plugin: mention that there are known bugs with pluginsIan Lance Taylor
Change-Id: I9e63661cac2bebc41d7aa3cd80e1920eec22b894 Reviewed-on: https://go-review.googlesource.com/51250 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-04-26plugin: resolve plugin import path issueTodd Neal
Resolve import paths to get plugin symbol prefixes. Fixes #19534 Change-Id: Ic25d83e72465ba8f6be0337218a1627b5dc702dc Reviewed-on: https://go-review.googlesource.com/40994 Run-TryBot: Todd Neal <todd@tneal.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-04-12plugin: resolve random crash when calling exported functionsTodd Neal
open modified the plugin symbols map while ranging over it. This is normally harmless, except that the operations performed were not idempotent leading to function pointers being corrupted. Fixes #19269 Change-Id: I4b6eb1d45567161412e4a34b41f1ebf647bcc942 Reviewed-on: https://go-review.googlesource.com/40431 Run-TryBot: Todd Neal <todd@tneal.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-09plugin: remove unnecessary import "C" from exampleFrancesc Campoy
It seems that it is not needed to import the pseudo package "C" for the plugin to be built correctly. Removing it to avoid confusion. Change-Id: I62838a953ad2889881bfbfd1a36141661565f033 Reviewed-on: https://go-review.googlesource.com/36638 Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-12-15cmd/go, plugin: disable plugins on darwinDavid Crawshaw
We are seeing a bad stack map in #18190. In a copystack, it is mistaking a slot for a pointer. Presumably this is caused either by our fledgling dynlink support on darwin, or a consequence of having two copies of the runtime in the process. But I have been unable to work out which in the 1.8 window, so pushing darwin support to 1.9 or later. Change-Id: I7fa4d2dede75033d9a428f24c1837a4613bd2639 Reviewed-on: https://go-review.googlesource.com/34391 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-15cmd/link, runtime, plugin: versioningDavid Crawshaw
In plugins and every program that opens a plugin, include a hash of every imported package. There are two versions of each hash: one local and one exported. As the program starts and plugins are loaded, the first exported symbol for each package becomes the canonical version. Any subsequent plugin's local package hash symbol has to match the canonical version. Fixes #17832 Change-Id: I4e62c8e1729d322e14b1673bada40fa7a74ea8bc Reviewed-on: https://go-review.googlesource.com/33161 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-05plugin: fix doc example fmt usageLeon Klingele
Change-Id: I0520a37a48a56d231a8ac2dc58b2bf1762282760 Reviewed-on: https://go-review.googlesource.com/32795 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-01plugin: do not leak cRelName on error pathDavid Crawshaw
Fixes #17683 Change-Id: I46f45c63796b58e8a8f14e37592231cbe7cd6934 Reviewed-on: https://go-review.googlesource.com/32438 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-10-31cmd/link, plugin: use full plugin path for symbolsDavid Crawshaw
Plumb the import path of a plugin package through to the linker, and use it as the prefix on the exported symbol names. Before this we used the basename of the plugin file as the prefix, which could conflict and result in multiple loaded plugins sharing symbols that are distinct. Fixes #17155 Fixes #17579 Change-Id: I7ce966ca82d04e8507c0bcb8ea4ad946809b1ef5 Reviewed-on: https://go-review.googlesource.com/32355 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-10-19plugin: mention OS X support and concurrencyDavid Crawshaw
Change-Id: I4270bf81511a5bf80ed146f5e66e4f8aeede2aa2 Reviewed-on: https://go-review.googlesource.com/31463 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-09-23plugin: darwin supportDavid Crawshaw
Change-Id: I76981d1d83da401178226634d076371a04f5ccb7 Reviewed-on: https://go-review.googlesource.com/29392 Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-09-17plugin: cast dlerror return value for androidDavid Crawshaw
Until a few weeks ago, bionic, the Andoid libc, incorrectly returned const char* (instead of char*) from dlerror(3). https://android.googlesource.com/platform/bionic/+/5e071a18ce88d93fcffaebb9e0f62524ae504908 Change-Id: I30d33240c63a9f35b6c20ca7e3928ad33bc5e33f Reviewed-on: https://go-review.googlesource.com/29352 Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-09-16plugin: new package for loading pluginsDavid Crawshaw
Includes a linux implementation. Change-Id: Iacc2ed7da760ae9deebc928adf2b334b043b07ec Reviewed-on: https://go-review.googlesource.com/27823 Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>