1
0
mirror of https://github.com/golang/go synced 2024-11-17 02:14:42 -07:00

cmd/link: support R_ADDRPOWER_GOT_PCREL34 on ppc64le

This will be generated by go code built for dynamic linking when
built with GOPPC64=power10 in a future change.

Change-Id: I9bd7ca6b2a65c360465e35ef12b10d3fa6d75745
Reviewed-on: https://go-review.googlesource.com/c/go/+/463015
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Archana Ravindar <aravind5@in.ibm.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Paul Murphy <murp@ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Paul E. Murphy 2023-01-20 17:20:07 -06:00 committed by Paul Murphy
parent 02704d5159
commit 27500d88f0

View File

@ -762,6 +762,8 @@ func elfreloc1(ctxt *ld.Link, out *ld.OutBuf, ldr *loader.Loader, s loader.Sym,
out.Write64(uint64(r.Xadd))
out.Write64(uint64(sectoff + 4))
out.Write64(uint64(elf.R_PPC64_GOT16_LO_DS) | uint64(elfsym)<<32)
case objabi.R_ADDRPOWER_GOT_PCREL34:
out.Write64(uint64(elf.R_PPC64_GOT_PCREL34) | uint64(elfsym)<<32)
case objabi.R_ADDRPOWER_PCREL:
out.Write64(uint64(elf.R_PPC64_REL16_HA) | uint64(elfsym)<<32)
out.Write64(uint64(r.Xadd))
@ -1151,7 +1153,7 @@ func archreloc(target *ld.Target, ldr *loader.Loader, syms *ld.ArchSyms, r loade
if !target.IsAIX() {
return val, nExtReloc, false
}
case objabi.R_POWER_TLS, objabi.R_POWER_TLS_IE_PCREL34, objabi.R_POWER_TLS_LE_TPREL34:
case objabi.R_POWER_TLS, objabi.R_POWER_TLS_IE_PCREL34, objabi.R_POWER_TLS_LE_TPREL34, objabi.R_ADDRPOWER_GOT_PCREL34:
nExtReloc = 1
return val, nExtReloc, true
case objabi.R_POWER_TLS_LE, objabi.R_POWER_TLS_IE:
@ -1410,6 +1412,7 @@ func extreloc(target *ld.Target, ldr *loader.Loader, r loader.Reloc, s loader.Sy
objabi.R_ADDRPOWER_TOCREL,
objabi.R_ADDRPOWER_TOCREL_DS,
objabi.R_ADDRPOWER_GOT,
objabi.R_ADDRPOWER_GOT_PCREL34,
objabi.R_ADDRPOWER_PCREL,
objabi.R_ADDRPOWER_D34,
objabi.R_ADDRPOWER_PCREL34: