aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/nm/nm_cgo_test.go
diff options
context:
space:
mode:
authorAlex Brainman <alex.brainman@gmail.com>2017-01-13 18:02:07 +1100
committerAlex Brainman <alex.brainman@gmail.com>2017-02-04 05:56:45 +0000
commitc7a7c5a9b425259e17976b978b60651b636b8979 (patch)
treeba6c46d0f31b44c963690022c552a582eb50a753 /src/cmd/nm/nm_cgo_test.go
parentafa0247c5d28eb9558311729c8edf3f0c898644f (diff)
downloadgo-c7a7c5a9b425259e17976b978b60651b636b8979.tar.xz
cmd/link: do not prefix external symbols with underscore on windows/386/cgo
CL 18057 added underscore to most external pe symbols on windows/386/cgo. The CL changed runtime.epclntab and runtime.pclntab pe symbols into _runtime.pclntab and _runtime.epclntab, and now cmd/nm cannot find them. Revert correspondent CL 18057 changes, because most pe symbols do not need underscore prefix. This CL also removes code that added obj.SHOSTOBJ symbols explicitly, because each of those was also added via genasmsym call. These created duplicate pe symbols (like _GetProcAddress@8 and __GetProcAddress@8), and external linker would complain. This CL adds new test in cmd/nm to verify go programs built with cgo. Fixes #18416 Change-Id: I68b1be8fb631d95ec69bd485c77c79604fb23f26 Reviewed-on: https://go-review.googlesource.com/35076 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/nm/nm_cgo_test.go')
-rw-r--r--src/cmd/nm/nm_cgo_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/cmd/nm/nm_cgo_test.go b/src/cmd/nm/nm_cgo_test.go
new file mode 100644
index 0000000000..633f9c0406
--- /dev/null
+++ b/src/cmd/nm/nm_cgo_test.go
@@ -0,0 +1,19 @@
+// Copyright 2017 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 cgo
+
+package main
+
+import (
+ "testing"
+)
+
+func TestInternalLinkerCgoFile(t *testing.T) {
+ testGoFile(t, true, false)
+}
+
+func TestExternalLinkerCgoFile(t *testing.T) {
+ testGoFile(t, true, true)
+}