]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: disable mach-o dwarf munging with -w (in addition to -s)
authorRuss Cox <rsc@golang.org>
Thu, 30 Mar 2017 00:46:20 +0000 (20:46 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 30 Mar 2017 12:28:11 +0000 (12:28 +0000)
Might as well provide a way around the mach-o munging
that doesn't require stripping all symbols.
After all, -w does mean no DWARF.

For #11887, #19734, and anyone else that needs to disable
this code path without losing the symbol table.

Change-Id: I254b7539f97fb9211fa90f446264b383e7f3980f
Reviewed-on: https://go-review.googlesource.com/38853
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/ld/lib.go

index 548b797f14bbd5f1a7d37be7a48dd505685447d2..070f3f5601af276b77759c32081031f67b5bb324 100644 (file)
@@ -1228,7 +1228,7 @@ func (l *Link) hostlink() {
                l.Logf("%s", out)
        }
 
-       if !*FlagS && !debug_s && Headtype == obj.Hdarwin {
+       if !*FlagS && !*FlagW && !debug_s && Headtype == obj.Hdarwin {
                // Skip combining dwarf on arm.
                if !SysArch.InFamily(sys.ARM, sys.ARM64) {
                        dsym := filepath.Join(*flagTmpdir, "go.dwarf")