Skip to content

Commit a15ec38

Browse files
committed
cmd/link: update plt size appropriately on ppc64
When attempting to enable internal linking with cgo on ppc64 it was discovered that the plt size was not being updated after adding entries to it, which resulted in this error: .plt: initialize bounds (16 < 24) This changes fixes that problem. Updates #21961 Change-Id: Ie17539c329f5a4802e5defd93852dcdde19ded8c Reviewed-on: https://go-review.googlesource.com/c/go/+/261837 Trust: Lynn Boger <[email protected]> Run-TryBot: Lynn Boger <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Cherry Zhang <[email protected]>
1 parent 575ea5a commit a15ec38

File tree

1 file changed

+1
-0
lines changed
  • src/cmd/link/internal/ppc64

1 file changed

+1
-0
lines changed

src/cmd/link/internal/ppc64/asm.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,7 @@ func addpltsym(ctxt *ld.Link, ldr *loader.Loader, s loader.Sym) {
994994
ldr.SetPlt(s, int32(plt.Size()))
995995

996996
plt.Grow(plt.Size() + 8)
997+
plt.SetSize(plt.Size() + 8)
997998

998999
rela.AddAddrPlus(ctxt.Arch, plt.Sym(), int64(ldr.SymPlt(s)))
9991000
rela.AddUint64(ctxt.Arch, ld.ELF64_R_INFO(uint32(ldr.SymDynid(s)), uint32(elf.R_PPC64_JMP_SLOT)))

0 commit comments

Comments
 (0)