Your IP : 172.28.240.42


Current Path : /usr/local/go/src/cmd/go/testdata/script/
Upload File :
Current File : //usr/local/go/src/cmd/go/testdata/script/version_gc_sections.txt

# This test checks that external linking with --gc-sections does not strip version information.

[short] skip
[!cgo] skip
[GOOS:aix] skip  # no --gc-sections
[GOOS:darwin] skip  # no --gc-sections

go build -ldflags='-linkmode=external -extldflags=-Wl,--gc-sections'
go version hello$GOEXE
! stdout 'not a Go executable'
! stderr 'not a Go executable'

-- go.mod --
module hello
-- hello.go --
package main

/*
*/
import "C"

func main() {
	println("hello")
}