]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/link: fix R_GOTOFF handling
authorCherry Zhang <cherryyz@google.com>
Wed, 29 Apr 2020 14:07:07 +0000 (10:07 -0400)
committerCherry Zhang <cherryyz@google.com>
Wed, 29 Apr 2020 15:32:58 +0000 (15:32 +0000)
commitdf2a46f85ad1e28076f639e3608ae9e2809f97a2
treee72c25ad79e8f1ef746ce0586920275cbf43e7fe
parent095d2a453265acea44bea04620258f1ae5bb12bc
[dev.link] cmd/link: fix R_GOTOFF handling

When applying relocations, we need to resolve ABI aliases.
relocsym does that. Architecture-specific archreloc also needs to
do that. The old code doesn't do that since ABI aliases are
resolved in loadlibfull, or, in the old linker, in a much earlier
stage. We don't do this in the new linker, as we want to avoid
mutating relocations.

While here, move R_CONST and R_GOTOFF handling to generic code.
They appear on several architectures and the handling are same.

Should fix 386-clang and *bsd-386 builds.

Change-Id: I6681c94f0327555d6cf329d0a518c88848773671
Reviewed-on: https://go-review.googlesource.com/c/go/+/230857
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/x86/asm.go
src/cmd/link/internal/x86/obj.go