From 714291f2d80bab1599a866f266a4fc6546e61632 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sun, 24 May 2015 11:29:38 -0700 Subject: [PATCH] cmd/link/internal/ld: if -v, display external linker output It can be useful when debugging to be able to see what the external linker is doing even when it succeeds. In particular this permits passing -v to the external linker to see precisely what it is doing. Change-Id: Ifed441912d97bbebea20303fdb899e140b380215 Reviewed-on: https://go-review.googlesource.com/10363 Reviewed-by: Minux Ma --- src/cmd/link/internal/ld/lib.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 6cf0b525e5..80c01538ac 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -1028,6 +1028,9 @@ func hostlink() { if out, err := exec.Command(argv[0], argv[1:]...).CombinedOutput(); err != nil { Exitf("running %s failed: %v\n%s", argv[0], err, out) + } else if Debug['v'] != 0 && len(out) > 0 { + fmt.Fprintf(&Bso, "%s", out) + Bso.Flush() } if Debug['s'] == 0 && debug_s == 0 && HEADTYPE == obj.Hdarwin { -- 2.48.1