aboutsummaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
authorPaul E. Murphy <murp@ibm.com>2021-03-15 15:21:57 -0500
committerLynn Boger <laboger@linux.vnet.ibm.com>2021-04-13 13:54:51 +0000
commit3e5bba0a44b880541fb72220a883e259d0f34a83 (patch)
treee46197b7dc5f36222ceebcd73cc765f12bdff1a9 /src/debug
parentd948b8633d4ae3d4501d0a5382b24431a96c0cba (diff)
downloadgo-3e5bba0a44b880541fb72220a883e259d0f34a83.tar.xz
cmd/link: support 32b TLS_LE offsets on PPC64
When using the GCC thread sanitizer, it links in additional code which uses TLS, which causes us to exceed the range of the 16 bit TLS relocation used by statically compiled go code. Rewrite objabi.R_POWER_TLS_LE to handle 32b offsets when linking internally or externally into an ELF binary. The elf relocation translation is changed to generate a pair of R_PPC64_TPREL16_HA/LO relocations instead of a single R_PPC64_TPREL16. Likewise, updating the above exposed some behavioral differences in gnu ld which can rewrite TLS sequences. It expects the sequence to generate a valid TLS address, not offset. This was exposed when compiling PIC code. The proper fix is to generate the full TLS address in the destination register of the "MOVD tlsaddr, $Rx" pseudo-op. This removes the need to insert special objabi.R_POWER_TLS relocations elsewhere. Unfortunately, XCOFF (used by aix) doesn't appear to support 32 bit offsets, so we rewrite this back into a 16b relocation when externally linking a static binary. Fixes #45040 Change-Id: I1ee9afd0b427cd79888032aa1f60d3e265073e1d Reviewed-on: https://go-review.googlesource.com/c/go/+/302209 Run-TryBot: Paul Murphy <murp@ibm.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/debug')
0 files changed, 0 insertions, 0 deletions