aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2017-10-26 10:15:29 -0400
committerThan McIntosh <thanm@google.com>2017-10-27 14:25:12 +0000
commit3e1e66fa05017f15b7e91307275975a6584cd205 (patch)
treeda5a8cf4ae481f50592dab89b31504a7a3adf110 /src
parent509140a549c08607cb05dbd6e10311ef1378e109 (diff)
downloadgo-3e1e66fa05017f15b7e91307275975a6584cd205.tar.xz
cmd/link: don't pass -gdwarf-2 to external linker
Don't pass -gdwarf-2 to the external linker when external linkage is requested. The Go compiler is now emitting DWARF version 4, so this doesn't seem needed any more. Fixes #22455 Change-Id: Ic4122c55e946619a266430f2d26f06d6803dd232 Reviewed-on: https://go-review.googlesource.com/73672 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/link/internal/ld/lib.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
index 377b4a4df2..81f8e4cb44 100644
--- a/src/cmd/link/internal/ld/lib.go
+++ b/src/cmd/link/internal/ld/lib.go
@@ -1073,14 +1073,14 @@ func (ctxt *Link) hostlink() {
argv = append(argv, *flagExtld)
argv = append(argv, hostlinkArchArgs(ctxt.Arch)...)
- if !*FlagS && !debug_s {
- argv = append(argv, "-gdwarf-2")
- } else if ctxt.HeadType == objabi.Hdarwin {
- // Recent versions of macOS print
- // ld: warning: option -s is obsolete and being ignored
- // so do not pass any arguments.
- } else {
- argv = append(argv, "-s")
+ if *FlagS || debug_s {
+ if ctxt.HeadType == objabi.Hdarwin {
+ // Recent versions of macOS print
+ // ld: warning: option -s is obsolete and being ignored
+ // so do not pass any arguments.
+ } else {
+ argv = append(argv, "-s")
+ }
}
switch ctxt.HeadType {