]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: exit if runtime.a is missing
authorCherry Mui <cherryyz@google.com>
Thu, 10 Nov 2022 22:17:54 +0000 (17:17 -0500)
committerCherry Mui <cherryyz@google.com>
Fri, 11 Nov 2022 14:51:14 +0000 (14:51 +0000)
Many stages in the linker assume some runtime symbols exist.
Error out if the runtime package cannot be found.

Fixes #56685.

Change-Id: I39b2663f6d7419688e30e6d8650e5eb8fc43a2b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/449638
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/link/internal/ld/lib.go

index 89bd966f59e243179864f048469888517d1a2fd6..184ad20be4e3364ca2b0475238c5973644900f45 100644 (file)
@@ -466,6 +466,9 @@ func loadinternal(ctxt *Link, name string) *sym.Library {
                }
        }
 
+       if name == "runtime" {
+               Exitf("error: unable to find runtime.a")
+       }
        ctxt.Logf("warning: unable to find %s.a\n", name)
        return nil
 }