cmd/link: delete dead flags

Also fix the interaction between -buildmode and -shared.
It's okay for -shared to change the default build mode,
but it's not okay for it to silently override an explicit -buildmode=exe.

Change-Id: Id40f93d140cddf75b19e262b3ba4856ee09a07ba
Reviewed-on: https://go-review.googlesource.com/10315
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
Russ Cox 2015-05-21 14:42:14 -04:00
parent 12795c02f3
commit aefa6cd1f9
2 changed files with 11 additions and 24 deletions

View file

@ -276,7 +276,8 @@ func Lflag(arg string) {
type BuildMode uint8
const (
BuildmodeExe BuildMode = iota
BuildmodeUnset BuildMode = iota
BuildmodeExe
BuildmodeCArchive
BuildmodeCShared
BuildmodeShared
@ -316,6 +317,8 @@ func (mode *BuildMode) Set(s string) error {
func (mode *BuildMode) String() string {
switch *mode {
case BuildmodeUnset:
return "" // avoid showing a default in usage message
case BuildmodeExe:
return "exe"
case BuildmodeCArchive: