[dev.link] cmd/internal/obj: trim trailing zeros for content hashing
[dev.link] cmd/internal/obj: trim trailing zeros for content hashing

The symbol's data in the object file (sym.P) may already not
contain trailing zeros (e,g, for [10]int{1}), but sometimes it
does (e.g. for [10]int{1,0}). The linker can already handle this
case. We just always trim the trailing zeros for content hashing,
so it can deduplicate [10]int{1} and [10]int{1,0}.

Note: in theory we could just trim the zeros in the symbol data
as well. But currently the linker depends on reading symbol data
for certain symbols (e.g. type symbol decoding), and trimming
will complicates things in the linker.

Change-Id: I9e90e41e6ac808b36855b0713a85e61c33bf093a
Reviewed-on: https://go-review.googlesource.com/c/go/+/245717
Run-TryBot: Cherry Zhang <d62e63aa42ce272d7b6a5055d97e942b33a34679@google.com>
Reviewed-by: Jeremy Faller <b3f594e10a9edcf5413cf1190121d45078c62290@golang.org>

nawawi/go,CAFxX/go,nawawi/go,cloudflare/go,nawawi/go,CAFxX/go,CAFxX/go,CAFxX/go,CAFxX/go,cloudflare/go,cloudflare/go,cloudflare/go,cloudflare/go,golang/go,golang/go,nawawi/go,CAFxX/go,nawawi/go,golang/go,cloudflare/go,nawawi/go,CAFxX/go,golang/go,golang/go,nawawi/go,cloudflare/go,golang/go,nawawi/go,golang/go,golang/go,cloudflare/go,CAFxX/go