From 66ee97590ce967c8210eedfb3194b1140740a792 Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Wed, 6 May 2020 18:57:58 -0400 Subject: [PATCH] cmd/link: don't overwrite text sections on PPC64 The code writes text sections twice, one with Codeblk, one with Datblk. The second write shouldn't be there. May fix #38898. Change-Id: I4ec70294059ec9aa0fc4cc69a3cd824f5843287b Reviewed-on: https://go-review.googlesource.com/c/go/+/232661 Run-TryBot: Cherry Zhang Run-TryBot: Lynn Boger TryBot-Result: Gobot Gobot Reviewed-by: Than McIntosh Reviewed-by: Lynn Boger Reviewed-by: Jeremy Faller --- src/cmd/link/internal/ppc64/asm.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/cmd/link/internal/ppc64/asm.go b/src/cmd/link/internal/ppc64/asm.go index 4dc50eab79a..bd4827ecb54 100644 --- a/src/cmd/link/internal/ppc64/asm.go +++ b/src/cmd/link/internal/ppc64/asm.go @@ -1098,11 +1098,6 @@ func asmb(ctxt *ld.Link, _ *loader.Loader) { } } - for _, sect := range ld.Segtext.Sections[1:] { - offset := sect.Vaddr - ld.Segtext.Vaddr + ld.Segtext.Fileoff - ld.WriteParallel(&wg, ld.Datblk, ctxt, offset, sect.Vaddr, sect.Length) - } - if ld.Segrodata.Filelen > 0 { ld.WriteParallel(&wg, ld.Datblk, ctxt, ld.Segrodata.Fileoff, ld.Segrodata.Vaddr, ld.Segrodata.Filelen) }