]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.8] cmd/link: disable mach-o dwarf munging with -w (in addition...
authorRuss Cox <rsc@golang.org>
Thu, 30 Mar 2017 00:46:20 +0000 (20:46 -0400)
committerAustin Clements <austin@google.com>
Wed, 5 Apr 2017 16:58:31 +0000 (16:58 +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/39602
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

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

index a6ec97a9f9b6f89b4b7634cc538345179b5093f9..6e90d7857195aede479e6dabfea9d3095d7a554f 100644 (file)
@@ -1223,7 +1223,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")