mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile, cmd/link: avoid ABI aliases
In the past we introduced ABI aliases, in preparation for ABI wrappers. Now that we have ABI wrappers implemented, we don't need ABI aliases. If ABI wrappers are not enabled, ABI0 and ABIInternal are actually identical, so we can resolve symbol references without distinguish them. This CL does so by normalizing ABIInternal to ABI0 at link time. This way, we no longer need to generate ABI aliases. This CL doesn't clean up everything related to ABI aliases, which will be done in followup CLs. Change-Id: I5b5db43370d29b8ad153078c70a853e3263ae6f7 Reviewed-on: https://go-review.googlesource.com/c/go/+/351271 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
parent
e925c4640d
commit
98989f2a74
9 changed files with 29 additions and 49 deletions
|
|
@ -96,8 +96,10 @@ func (d *deadcodePass) init() {
|
|||
for _, name := range names {
|
||||
// Mark symbol as a data/ABI0 symbol.
|
||||
d.mark(d.ldr.Lookup(name, 0), 0)
|
||||
// Also mark any Go functions (internal ABI).
|
||||
d.mark(d.ldr.Lookup(name, sym.SymVerABIInternal), 0)
|
||||
if abiInternalVer != 0 {
|
||||
// Also mark any Go functions (internal ABI).
|
||||
d.mark(d.ldr.Lookup(name, abiInternalVer), 0)
|
||||
}
|
||||
}
|
||||
|
||||
// All dynamic exports are roots.
|
||||
|
|
@ -327,8 +329,8 @@ func deadcode(ctxt *Link) {
|
|||
d.init()
|
||||
d.flood()
|
||||
|
||||
methSym := ldr.Lookup("reflect.Value.Method", sym.SymVerABIInternal)
|
||||
methByNameSym := ldr.Lookup("reflect.Value.MethodByName", sym.SymVerABIInternal)
|
||||
methSym := ldr.Lookup("reflect.Value.Method", abiInternalVer)
|
||||
methByNameSym := ldr.Lookup("reflect.Value.MethodByName", abiInternalVer)
|
||||
|
||||
if ctxt.DynlinkingGo() {
|
||||
// Exported methods may satisfy interfaces we don't know
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue