cmd/link: fix -a with external linker
cmd/link: fix -a with external linker

This commit fixes a panic when -a was used with external linkmode.

Fixes #29807

Change-Id: I8cd42775f2953cec620cbc9ab345421c2694c9a2
Reviewed-on: https://go-review.googlesource.com/c/158998
Reviewed-by: Matthew Dempsky <e56ac2c500064424afac424d4b5e53bd0570a731@google.com>
Run-TryBot: Matthew Dempsky <e56ac2c500064424afac424d4b5e53bd0570a731@google.com>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>

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