From 7209150602573c53ebaa2325ec582043b8abcf4e Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 19 Feb 2014 10:01:15 -0500 Subject: cmd/go: skip writing dwarf debug info for ephemeral binaries Update issue 6853 For an ephemeral binary - one created, run, and then deleted - there is no need to write dwarf debug information, since the binary will not be used with gdb. In this case, instruct the linker not to spend time and disk space generating the debug information by passing the -w flag to the linker. Omitting dwarf information reduces the size of most binaries by 25%. We may be more aggressive about this in the future. LGTM=bradfitz, r R=r, bradfitz CC=golang-codereviews https://codereview.appspot.com/65890043 --- test/run.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/run.go') diff --git a/test/run.go b/test/run.go index e5190e4e7..9a4d794ad 100644 --- a/test/run.go +++ b/test/run.go @@ -200,7 +200,7 @@ func compileInDir(runcmd runCmd, dir string, names ...string) (out []byte, err e func linkFile(runcmd runCmd, goname string) (err error) { pfile := strings.Replace(goname, ".go", "."+letter, -1) - _, err = runcmd("go", "tool", ld, "-o", "a.exe", "-L", ".", pfile) + _, err = runcmd("go", "tool", ld, "-w", "-o", "a.exe", "-L", ".", pfile) return } -- cgit v1.2.1