]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: enable checklinkname by default
authorCherry Mui <cherryyz@google.com>
Wed, 15 May 2024 18:52:35 +0000 (14:52 -0400)
committerCherry Mui <cherryyz@google.com>
Fri, 17 May 2024 16:59:50 +0000 (16:59 +0000)
Fixes #67401.

Change-Id: Ia8e091c77414cd1281cadc524215ef89ba9184b2
Reviewed-on: https://go-review.googlesource.com/c/go/+/585556
Reviewed-by: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
src/cmd/link/internal/ld/main.go
src/cmd/link/link_test.go

index e6608fd791aab710045e36c5e689c8341e4aa98b..9f50ad183acbca01ed8cdd2e15cdb69623b79614 100644 (file)
@@ -96,7 +96,7 @@ var (
        FlagS             = flag.Bool("s", false, "disable symbol table")
        flag8             bool // use 64-bit addresses in symbol table
        flagInterpreter   = flag.String("I", "", "use `linker` as ELF dynamic linker")
-       flagCheckLinkname = flag.Bool("checklinkname", false, "check linkname symbol references")
+       flagCheckLinkname = flag.Bool("checklinkname", true, "check linkname symbol references")
        FlagDebugTramp    = flag.Int("debugtramp", 0, "debug trampolines")
        FlagDebugTextSize = flag.Int("debugtextsize", 0, "debug text section max size")
        flagDebugNosplit  = flag.Bool("debugnosplit", false, "dump nosplit call graph")
index e33494f7f1f5f71fe06a40b3523609e9c5b8e925..ea377e77cc8fe160afd963513c3540224034fa6f 100644 (file)
@@ -1448,7 +1448,7 @@ func TestCheckLinkname(t *testing.T) {
                        t.Parallel()
                        src := filepath.Join("testdata", "linkname", test.src)
                        exe := filepath.Join(tmpdir, test.src+".exe")
-                       cmd := testenv.Command(t, testenv.GoToolPath(t), "build", "-ldflags=-checklinkname=1", "-o", exe, src)
+                       cmd := testenv.Command(t, testenv.GoToolPath(t), "build", "-o", exe, src)
                        out, err := cmd.CombinedOutput()
                        if test.ok && err != nil {
                                t.Errorf("build failed unexpectedly: %v:\n%s", err, out)