• Alex Brainman's avatar
    cmd/link: do not prefix external symbols with underscore on windows/386/cgo · c7a7c5a9
    Alex Brainman authored
    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/35076Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    c7a7c5a9
pe.go 31.3 KB