Skip to content

Commit 0757eb5

Browse files
aykevldeadprogram
authored andcommitted
main: link with --gc-sections
This may help reduce code size in some cases.
1 parent 013a71a commit 0757eb5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

target.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ func defaultTarget(goos, goarch, triple string) (*TargetSpec, error) {
211211
BuildTags: []string{goos, goarch},
212212
Compiler: commands["clang"],
213213
Linker: "cc",
214-
LDFlags: []string{"-no-pie"}, // WARNING: clang < 5.0 requires -nopie
214+
LDFlags: []string{"-no-pie", "-Wl,--gc-sections"}, // WARNING: clang < 5.0 requires -nopie
215215
Objcopy: "objcopy",
216216
GDB: "gdb",
217217
GDBCmds: []string{"run"},

0 commit comments

Comments
 (0)