]> Cypherpunks repositories - gostls13.git/commit
cmd/link: do not prefix external symbols with underscore on windows/386/cgo
authorAlex Brainman <alex.brainman@gmail.com>
Fri, 13 Jan 2017 07:02:07 +0000 (18:02 +1100)
committerAlex Brainman <alex.brainman@gmail.com>
Sat, 4 Feb 2017 05:56:45 +0000 (05:56 +0000)
commitc7a7c5a9b425259e17976b978b60651b636b8979
treeba6c46d0f31b44c963690022c552a582eb50a753
parentafa0247c5d28eb9558311729c8edf3f0c898644f
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>
src/cmd/link/internal/ld/pe.go
src/cmd/nm/nm_cgo_test.go [new file with mode: 0644]
src/cmd/nm/nm_test.go