]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/link: don't truncate external relocation type
authorCherry Zhang <cherryyz@google.com>
Fri, 13 Mar 2020 15:43:35 +0000 (11:43 -0400)
committerCherry Zhang <cherryyz@google.com>
Fri, 13 Mar 2020 19:28:06 +0000 (19:28 +0000)
commit0e06775eebf6d357f604a55c803aab5cc8054e67
tree509b267567fc176dce4798971c9bc0da949dbc62
parent440852c464a38036c9898dcdf22d57851a58331f
[dev.link] cmd/link: don't truncate external relocation type

In CL 222244, we store external relocations in the same format as
Go object files. In Go object file format, the relocation type is
a uint8. However, for external relocations the type may not
always fit in a uint8. Truncating it will result in a bad
relocation. Fix this by storing the external reloc type on the
side. (An alternative is to extend the Go object file format to
use a uint16, but it is not necessary for Go relocations and
will waste some binary size.)

Fix ARM build.

Change-Id: I343e240d38ee0e2cc91e0e7754d03b19b525a014
Reviewed-on: https://go-review.googlesource.com/c/go/+/223338
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/link/internal/loader/loader.go