diff options
| author | Than McIntosh <thanm@google.com> | 2017-10-26 10:15:29 -0400 |
|---|---|---|
| committer | Than McIntosh <thanm@google.com> | 2017-10-27 14:25:12 +0000 |
| commit | 3e1e66fa05017f15b7e91307275975a6584cd205 (patch) | |
| tree | da5a8cf4ae481f50592dab89b31504a7a3adf110 /src | |
| parent | 509140a549c08607cb05dbd6e10311ef1378e109 (diff) | |
| download | go-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.go | 16 |
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 { |
