From 41fd4c88ad900765716d17c14eb1b48b553589e2 Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Sat, 24 Nov 2018 18:02:29 +1100 Subject: cmd/link: do not use _GLOBAL_OFFSET_TABLE_ on windows/386 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 TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/plugin/plugin_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/plugin/plugin_test.go (limited to 'src/plugin/plugin_test.go') diff --git a/src/plugin/plugin_test.go b/src/plugin/plugin_test.go new file mode 100644 index 0000000000..6dfe14854c --- /dev/null +++ b/src/plugin/plugin_test.go @@ -0,0 +1,17 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !nacl + +package plugin_test + +import ( + _ "plugin" + "testing" +) + +func TestPlugin(t *testing.T) { + // This test makes sure that executable that imports plugin + // package can actually run. See issue #28789 for details. +} -- cgit v1.3-5-g9baa