Skip to content

Commit

Permalink
[release-branch.go1.21] cmd/link: don't generate DYSYMTAB when extern…
Browse files Browse the repository at this point in the history
…al linking on Mach-O

When external linking, the external linker will generate it.

Updates golang#60694.
For golang#61229.

Change-Id: I086a7628dd9baa84b46315641746fc3640473f2b
Reviewed-on: https://go-review.googlesource.com/c/go/+/502617
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
(cherry picked from commit f55e7e1)
Reviewed-on: https://go-review.googlesource.com/c/go/+/513757
  • Loading branch information
cherrymui authored and bradfitz committed Aug 2, 2023
1 parent edfe402 commit db9f99c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cmd/link/internal/ld/macho.go
Original file line number Diff line number Diff line change
Expand Up @@ -833,9 +833,9 @@ func asmbMacho(ctxt *Link) {
ml.data[2] = uint32(linkoff + s1 + s2 + s3 + s4 + s5) /* stroff */
ml.data[3] = uint32(s6) /* strsize */

machodysymtab(ctxt, linkoff+s1+s2)

if ctxt.LinkMode != LinkExternal {
machodysymtab(ctxt, linkoff+s1+s2)

ml := newMachoLoad(ctxt.Arch, LC_LOAD_DYLINKER, 6)
ml.data[0] = 12 /* offset to string */
stringtouint32(ml.data[1:], "/usr/lib/dyld")
Expand Down

0 comments on commit db9f99c

Please sign in to comment.