[dev.link] cmd/link: implement symbol overwrite logic
If two defined symbols have the same name, one contentless and one with content, the one with content "wins". This is mainly for go:linkname on data symbols. Support this logic in newobj mode. Introduce an "overwrite" mechanism, letting one symbol overwrite another. This machanism could later be used for the linker overwriting symbol contents (e.g. -X flag). Change-Id: I32ee7d4b82df275f11b38c3abefc99b878ff12d7 Reviewed-on: https://go-review.googlesource.com/c/go/+/200097 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
Showing
Please register or sign in to comment