cmd/release: remove oldlink binary from release artifacts

The oldlink tool is used for debugging changes to the linker. While it
was useful to include in the beta, it is less useful in the general
release. Users can still build oldlink themselves for testing.

Tested by running a dry-run release on releasebot.

Fixes #39509

Change-Id: If5d14616b136e9459993cb0e6cfb989da2cf1b96
Reviewed-on: https://go-review.googlesource.com/c/build/+/242643
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
diff --git a/cmd/release/release.go b/cmd/release/release.go
index 488ef8a..df575e0 100644
--- a/cmd/release/release.go
+++ b/cmd/release/release.go
@@ -447,6 +447,14 @@
 	if err := client.RemoveAll(ctx, b.toolDir()+"/api"); err != nil {
 		return err
 	}
+	// The oldlink tool is used for debugging differences during
+	// testing of the linker rewrite, and can be built by users
+	// if necessary. See issue 39509.
+	// This can be removed when oldlink is gone, likely once Go 1.16
+	// is no longer supported.
+	if err := client.RemoveAll(ctx, b.toolDir()+"/oldlink"); err != nil {
+		return err
+	}
 	// Remove go/pkg/${GOOS}_${GOARCH}/cmd. This saves a bunch of
 	// space, and users don't typically rebuild cmd/compile,
 	// cmd/link, etc. If they want to, they still can, but they'll