main: link with --gc-sections

This may help reduce code size in some cases.
This commit is contained in:
Ayke van Laethem
2019-02-01 17:29:14 +01:00
committed by Ron Evans
parent 013a71aa3d
commit 0757eb5919
+1 -1
View File
@@ -211,7 +211,7 @@ func defaultTarget(goos, goarch, triple string) (*TargetSpec, error) {
BuildTags: []string{goos, goarch},
Compiler: commands["clang"],
Linker: "cc",
LDFlags: []string{"-no-pie"}, // WARNING: clang < 5.0 requires -nopie
LDFlags: []string{"-no-pie", "-Wl,--gc-sections"}, // WARNING: clang < 5.0 requires -nopie
Objcopy: "objcopy",
GDB: "gdb",
GDBCmds: []string{"run"},