]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link/internal/ld: if -v, display external linker output
authorIan Lance Taylor <iant@golang.org>
Sun, 24 May 2015 18:29:38 +0000 (11:29 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 26 May 2015 03:59:14 +0000 (03:59 +0000)
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 <minux@golang.org>
src/cmd/link/internal/ld/lib.go

index 6cf0b525e5800ac8d97da55d92e0999d60482a09..80c01538ac1a83f503df528e8cc3fbf6ab02b629 100644 (file)
@@ -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 {