]> Cypherpunks repositories - gostls13.git/commit
cmd/link: fix Macho-O X86_64_RELOC_SUBTRACTOR in internal linking
authorqmuntal <quimmuntal@gmail.com>
Mon, 15 Sep 2025 12:23:44 +0000 (14:23 +0200)
committerQuim Muntal <quimmuntal@gmail.com>
Tue, 23 Sep 2025 18:48:39 +0000 (11:48 -0700)
commit61bf26a9eef5e0c1a5c319f60dfe1e3c51766474
tree17e2321ed8b769a9eab8aa3722e6be9ec903b617
parent4b787c8c2bc8c9e774bf7836adb7877e3698f9d4
cmd/link: fix Macho-O X86_64_RELOC_SUBTRACTOR in internal linking

X86_64_RELOC_SUBTRACTOR is handled as a generic R_PCREL relocations,
which gets the relocation size subtracted from the relocated value.

This is not supposed to happen for this particular relocation, so
compensate by adding the size to the addend.

Cq-Include-Trybots: luci.golang.try:gotip-darwin-amd64-race
Change-Id: I6e6889d63bb03b8076e3e409722601dfebec57e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/703776
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
src/cmd/link/internal/amd64/asm.go