]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: do not use content addressable symbol for generic iface method names
authorCherry Mui <cherryyz@google.com>
Tue, 9 Aug 2022 21:10:22 +0000 (17:10 -0400)
committerCherry Mui <cherryyz@google.com>
Wed, 10 Aug 2022 00:51:41 +0000 (00:51 +0000)
commit8dc7710faeda33b03fe32d4e7c800f0dcf27c698
tree531d5ac39f682503933e9f04b9304ab655c1144b
parent3c2a3ce6d924c4d936c6a9ece63aaaa42c80107c
cmd/compile: do not use content addressable symbol for generic iface method names

When a generic interface method is used, we use a special
relocation R_USEGENERICIFACEMETHOD to tell the linker the name of
the generic interface method, so it can keep methods with that
name live. The relocation references a symbol whose content is the
name. Currently this is a string symbol, which is content
addessable and may have trailing zero bytes (for better
deduplication). The trailing bytes can cause confusion for the
linker. This symbol doesn't need to be in the final binary and
doesn't need to be deduplicated with other symbol. So we don't use
content addressable symbol but make an (unnamed) symbol
specifically for this.

May fix #54346.

Change-Id: If0c34f7844c3553a7be3846b66cf1c103bc231c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/422300
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/reflectdata/reflect.go