]> Cypherpunks repositories - gostls13.git/commit
cmd/link/internal/ld: pass correct offset to codesign.Sign
authorChristian Banse <christian.banse@me.com>
Fri, 21 Apr 2023 15:13:17 +0000 (15:13 +0000)
committerCherry Mui <cherryyz@google.com>
Thu, 1 Jun 2023 17:49:36 +0000 (17:49 +0000)
commit7dc8509c693c6e6dfa7bdcebdb9d62058b14b509
treedcd62639a356b1048b92b1404442da1e8b96dc41
parent73a29bad0bd24cdd70bbf468fa12fbe7760ef47d
cmd/link/internal/ld: pass correct offset to codesign.Sign

Previously, codesign.Sign was called with Segtext.Fileoff and
Segtext.Filelen. However, both variables do not contain the
complete __TEXT segment, as it excludes padding and header.
Therefore, we now store a reference to the complete segment
in mstext when it is created and pass its offset (which should
always be 0) and filesize to codesign.Sign.

Fixes #59555

Change-Id: Iad88f142705949dcc0b192b811337df9b4be08cf
GitHub-Last-Rev: 37a048d58e01a3befa4db574e5fb48ab8d6013a1
GitHub-Pull-Request: golang/go#59581
Reviewed-on: https://go-review.googlesource.com/c/go/+/484015
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
src/cmd/link/internal/ld/macho.go