cmd/link: pass provided ldflags when testing whether an ldflag is supported
cmd/link: pass provided ldflags when testing whether an ldflag is supported

It's possible for one of the ldflags to cause the compiler driver to
use a different linker than the default, so we need to make sure that
the flag is supported by whichever linker is specified.

Fixes #27110.

Change-Id: Ic0c51b886e34344d324e68cbf6673b168c14992f
Reviewed-on: https://go-review.googlesource.com/130316
Run-TryBot: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@golang.org>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@golang.org>

cloudflare/go,CAFxX/go,akutz/go,CAFxX/go,CAFxX/go,golang/go,cloudflare/go,akutz/go,nawawi/go,nawawi/go,nawawi/go,josharian/go,akutz/go,josharian/go,CAFxX/go,akutz/go,golang/go,josharian/go,golang/go,nawawi/go,CAFxX/go,CAFxX/go,cloudflare/go,cloudflare/go,nawawi/go,akutz/go,cloudflare/go,golang/go,josharian/go,nawawi/go,golang/go,golang/go,golang/go,josharian/go,CAFxX/go,akutz/go,josharian/go,CAFxX/go,cloudflare/go,cloudflare/go,josharian/go,golang/go,nawawi/go,akutz/go,josharian/go,akutz/go,cloudflare/go,nawawi/go