From: Rhys Hiltner Date: Thu, 18 Feb 2016 21:35:49 +0000 (-0800) Subject: cmd/link/internal/ld: remove unused call to os.Getwd X-Git-Tag: go1.7beta1~1843 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=98cc8b4cf219384792e19dec9bc17a0e49c466f6;p=gostls13.git cmd/link/internal/ld: remove unused call to os.Getwd This call to os.Getwd (or getwd) has been part of the linker since the C implementation in 7d507dc6e6. It stopped being used in 26438d4d80, and survived the conversion to Go in 1f9dbb60ef. Its return value goes unused (the linker gets the value for AT_comp_dir in dwarf.go), remove it. Change-Id: I3d4594813bb4ee0a6af31a36e19d99ec4b863677 Reviewed-on: https://go-review.googlesource.com/19655 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/link/internal/ld/sym.go b/src/cmd/link/internal/ld/sym.go index 731f3ede94..6122b85298 100644 --- a/src/cmd/link/internal/ld/sym.go +++ b/src/cmd/link/internal/ld/sym.go @@ -34,8 +34,6 @@ package ld import ( "cmd/internal/obj" "log" - "os" - "path/filepath" "strconv" ) @@ -70,13 +68,6 @@ func linknew(arch *LinkArch) *Link { log.Fatalf("invalid goarch %s (want %s)", p, arch.Name) } - var buf string - buf, _ = os.Getwd() - if buf == "" { - buf = "/???" - } - buf = filepath.ToSlash(buf) - ctxt.Headtype = headtype(obj.Getgoos()) if ctxt.Headtype < 0 { log.Fatalf("unknown goos %s", obj.Getgoos())