]> Cypherpunks repositories - gostls13.git/commit
cmd/link: fix up more zero-sized local symbols on darwin dynamic linking
authorCherry Mui <cherryyz@google.com>
Wed, 14 Jun 2023 21:09:30 +0000 (17:09 -0400)
committerCherry Mui <cherryyz@google.com>
Mon, 31 Jul 2023 17:37:16 +0000 (17:37 +0000)
commite417698e84bcb2b44b263773ff3d69af9354f577
tree0d1c5ee1d8b213b379e0eba4461d4c2f6946ab75
parent463887d5cc3e4cc30347f350f6cdc93f42766340
cmd/link: fix up more zero-sized local symbols on darwin dynamic linking

When dynamic linking on darwin, the darwin linker doesn't link
relocations pointing to zero-sized local symbols, like our
start/end marker symbols, e.g. runtime.text and runtime.etext.
It will choose to resolve to another symbol on the same address
that may not be local, therefore that reference may point to a
different DSO, which is not what we want. We already fix up some
marker symbols, like text/etext, data/edata, bss/ebss. But we
currently don't fix up noptrdata and noptrbss. With the new
darwin linker ld-prime, this causes problems when building a
plugin. Fix up those symbols.

For #61229.

Change-Id: I2181bb9184b85af9a3c3f5dc6d78e4d5a1d56d53
Reviewed-on: https://go-review.googlesource.com/c/go/+/503538
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/link/internal/ld/data.go