...

Text file src/cmd/go/testdata/script/version_gc_sections.txt

Documentation: cmd/go/testdata/script

     1# This test checks that external linking with --gc-sections does not strip version information.
     2
     3[short] skip
     4[!cgo] skip
     5[GOOS:aix] skip  # no --gc-sections
     6[GOOS:darwin] skip  # no --gc-sections
     7
     8go build -ldflags='-linkmode=external -extldflags=-Wl,--gc-sections'
     9go version hello$GOEXE
    10! stdout 'not a Go executable'
    11! stderr 'not a Go executable'
    12
    13-- go.mod --
    14module hello
    15-- hello.go --
    16package main
    17
    18/*
    19*/
    20import "C"
    21
    22func main() {
    23	println("hello")
    24}

View as plain text