compiler: use SHA1-hash for symname for long gcbits symbols

The current scheme used by the compiler for "gcbits" symbols involves
generating a symbol name based on a 32-char encoding of the bits data.
This scheme works well in most cases but can generate very long symbol
names in rare cases. To help avoid such long symbol names, switch to a
different encoding scheme based on the SHA1 digest of the payload if
the symbol size would be too large.

Fixes golang/go#32083.

Change-Id: If7db420e96b0ff280593fdcb36ebb626cacc91af
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/177598
Reviewed-by: Ian Lance Taylor <iant@golang.org>
1 file changed