• Russ Cox's avatar
    cmd/go: skip writing dwarf debug info for ephemeral binaries · ae38b03f
    Russ Cox authored
    Update #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://golang.org/cl/65890043
    ae38b03f
run.go 2.74 KB