From e6181eb9e1dc4ab9e297a102ed192997582ac46c Mon Sep 17 00:00:00 2001 From: David Crawshaw Date: Thu, 7 Apr 2016 14:00:00 -0400 Subject: [PATCH] cmd/link: disable DWARF when not generating symtab Fixes #15166 Change-Id: I30284e3c0fb2c80b26a2572e2fb249b8018e85f9 Reviewed-on: https://go-review.googlesource.com/21587 Run-TryBot: David Crawshaw Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/cmd/link/internal/ld/dwarf.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cmd/link/internal/ld/dwarf.go b/src/cmd/link/internal/ld/dwarf.go index 230d146877c..db8961676c4 100644 --- a/src/cmd/link/internal/ld/dwarf.go +++ b/src/cmd/link/internal/ld/dwarf.go @@ -1915,6 +1915,9 @@ func dwarfgeneratedebugsyms() { if Debug['w'] != 0 { // disable dwarf return } + if Debug['s'] != 0 && HEADTYPE != obj.Hdarwin { + return + } if HEADTYPE == obj.Hplan9 { return }