]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.link] cmd/link: ignore undefined symbols in trampoline generation
authorCherry Zhang <cherryyz@google.com>
Wed, 8 Apr 2020 15:54:11 +0000 (11:54 -0400)
committerCherry Zhang <cherryyz@google.com>
Wed, 8 Apr 2020 17:18:29 +0000 (17:18 +0000)
Don't emit an error for undefined symbol in trampoline
generation pass, which will be duplicate as we'll emit a better
one later.

Fix TestUndefinedRelocErrors on PPC64.

Change-Id: I964d4bd63ec4b4c6eb5d98caf68db93ce6488bf5
Reviewed-on: https://go-review.googlesource.com/c/go/+/227617
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

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

index 3a1f355056e0b7cb627f14520fbd22af3bfd4a1b..f72262cf4d10e511f830f8402758e8e1f8d6aa51 100644 (file)
@@ -101,7 +101,7 @@ func trampoline(ctxt *Link, s loader.Sym) {
                        continue
                }
                rs := r.Sym()
-               if !ldr.AttrReachable(rs) {
+               if !ldr.AttrReachable(rs) || ldr.SymType(rs) == sym.Sxxx {
                        continue // something is wrong. skip it here and we'll emit a better error later
                }
                rs = ldr.ResolveABIAlias(rs)