]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.21] cmd/link: don't generate DYSYMTAB when external linking on...
authorCherry Mui <cherryyz@google.com>
Mon, 12 Jun 2023 17:46:08 +0000 (13:46 -0400)
committerCherry Mui <cherryyz@google.com>
Thu, 27 Jul 2023 20:07:01 +0000 (20:07 +0000)
When external linking, the external linker will generate it.

Updates #60694.
For #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 f55e7e104bbef911f1495b39c3c2ff366ad3be4d)
Reviewed-on: https://go-review.googlesource.com/c/go/+/513757

src/cmd/link/internal/ld/macho.go

index e43a1aa002eaff29be4e33472d35fe1113a1a0b5..88ff787af52b940520ae9a5abca296fc44817246 100644 (file)
@@ -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")