]> Cypherpunks repositories - gostls13.git/commit
cmd/link: do size fixups after symbol references are loaded
authorCherry Mui <cherryyz@google.com>
Thu, 10 Jul 2025 04:46:00 +0000 (00:46 -0400)
committerCherry Mui <cherryyz@google.com>
Fri, 11 Jul 2025 14:32:16 +0000 (07:32 -0700)
commit88cf0c5d55a8c18da515485f4a3fcf008b96cb07
tree5a3b3712ea31a205009c0e85c8d4e34df5a40742
parent7a38975a48ac735e62b389957bfc898437d628dc
cmd/link: do size fixups after symbol references are loaded

When we do a size fixup, we need to clone the symbol to an
external symbol so we can modify it. This includes cloning the
relocations, which includes resolving the relocations. If the
symbol being fixed has a relocation referencing a non-Go symbol,
that symbol has not yet been created, it will be resolved to an
empty symbol. Load the references first, so the referenced symbol,
even if it is a non-Go symbol, exists.

Fixes #74537.

Change-Id: I81525bd7c3e232b80eefeb0f18e13ba5331e1510
Reviewed-on: https://go-review.googlesource.com/c/go/+/687315
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/link/internal/loader/loader.go