]> Cypherpunks repositories - gostls13.git/commit
cmd/link: attempt to rationalize linkmode init
authorDavid Crawshaw <crawshaw@golang.org>
Fri, 9 Sep 2016 21:34:07 +0000 (17:34 -0400)
committerDavid Crawshaw <crawshaw@golang.org>
Fri, 16 Sep 2016 17:57:53 +0000 (17:57 +0000)
commit6007c8c76beb6e9d8bccc966f0a1cc0f7518c539
tree08a0cc24d34b748d9d3eaafbbfef5f7ec2fb405d
parent1df438f79c440ddf9bdd342f089a55567254bc9a
cmd/link: attempt to rationalize linkmode init

This CL gives Linkmode a type, switches it to the standard flag
handling mechanism, and deduplicates some logic.

There is a semantic change in this CL. Previously if a link was
invoked explicitly with -linkmode=internal, any condition that forced
external linking would silently override this and use external
linking. Instead it now fails with a reason why. I believe this is an
improvement, but will change it back if there's disagreement.

Fixes #12848

Change-Id: Ic80e341fff65ecfdd2b6fdd6079674cc7210fc5f
Reviewed-on: https://go-review.googlesource.com/28971
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
13 files changed:
src/cmd/link/internal/amd64/obj.go
src/cmd/link/internal/arm/obj.go
src/cmd/link/internal/arm64/obj.go
src/cmd/link/internal/ld/config.go [new file with mode: 0644]
src/cmd/link/internal/ld/go.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/ld/link.go
src/cmd/link/internal/ld/main.go
src/cmd/link/internal/ld/sym.go
src/cmd/link/internal/mips64/obj.go
src/cmd/link/internal/ppc64/obj.go
src/cmd/link/internal/s390x/obj.go
src/cmd/link/internal/x86/obj.go