]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/link: resolve ABI aliases for external symbols
authorCherry Zhang <cherryyz@google.com>
Fri, 1 Nov 2019 01:53:49 +0000 (21:53 -0400)
committerCherry Zhang <cherryyz@google.com>
Fri, 1 Nov 2019 13:51:36 +0000 (13:51 +0000)
commit63815923fc7ef8dd9b6ae04b791e2811d74f9c1b
tree0a40a4e909bce4f60ab914ce062fbbb13041c808
parent4a43a5079184f9a4cff355fbf8c6d3145e253bb2
[dev.link] cmd/link: resolve ABI aliases for external symbols

ABI alias references in Go symbols are resolved during
loadObjFull. But for external symbols they are not resolved. If
there is a reference from an external symbol to a Go ABIInternal
symbol, this reference will be invalid as it is not resolved.

The old code resolve ABI aliases in the deadcode pass. But the
new deadcode pass doesn't do it, as it works with indices instead
of Symbols. We do this in LoadFull.

This makes all internal cgo linking tests pass on Mach-O.

Change-Id: Iac6c084c03f5ddbcc9455527800ce7ed7313f9a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/204698
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/loader/loader.go