From 850a4ffb6346dd53f6f5624c13410d99e6509cae Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Mon, 27 Sep 2021 13:52:53 -0400 Subject: [PATCH] cmd/internal/goobj: remove Pcdata from object file As of CL 247399 we use separate symbols for PCDATA. There is no more need for writing PCDATA directly into the object file as a separate block. Change-Id: I942d1a372540415e0cc07fb2a01f79718a264142 Reviewed-on: https://go-review.googlesource.com/c/go/+/352610 Trust: Cherry Mui Trust: Josh Bleecher Snyder Run-TryBot: Cherry Mui TryBot-Result: Go Bot Reviewed-by: Josh Bleecher Snyder --- src/cmd/internal/goobj/objfile.go | 2 -- src/cmd/internal/obj/objfile.go | 19 ------------------- 2 files changed, 21 deletions(-) diff --git a/src/cmd/internal/goobj/objfile.go b/src/cmd/internal/goobj/objfile.go index 20bf0eba89..fc6dbb8af6 100644 --- a/src/cmd/internal/goobj/objfile.go +++ b/src/cmd/internal/goobj/objfile.go @@ -100,7 +100,6 @@ import ( // } // // Data [...]byte -// Pcdata [...]byte // // // blocks only used by tools (objdump, nm) // @@ -204,7 +203,6 @@ const ( BlkReloc BlkAux BlkData - BlkPcdata BlkRefName BlkEnd NBlk diff --git a/src/cmd/internal/obj/objfile.go b/src/cmd/internal/obj/objfile.go index 8a094df91a..3e5cf0e243 100644 --- a/src/cmd/internal/obj/objfile.go +++ b/src/cmd/internal/obj/objfile.go @@ -193,25 +193,6 @@ func WriteObjFile(ctxt *Link, b *bio.Writer) { } } - // Pcdata - h.Offsets[goobj.BlkPcdata] = w.Offset() - for _, s := range ctxt.Text { // iteration order must match genFuncInfoSyms - // Because of the phase order, it's possible that we try to write an invalid - // object file, and the Pcln variables haven't been filled in. As such, we - // need to check that Pcsp exists, and assume the other pcln variables exist - // as well. Tests like test/fixedbugs/issue22200.go demonstrate this issue. - if fn := s.Func(); fn != nil && fn.Pcln.Pcsp != nil { - pc := &fn.Pcln - w.Bytes(pc.Pcsp.P) - w.Bytes(pc.Pcfile.P) - w.Bytes(pc.Pcline.P) - w.Bytes(pc.Pcinline.P) - for i := range pc.Pcdata { - w.Bytes(pc.Pcdata[i].P) - } - } - } - // Blocks used only by tools (objdump, nm). // Referenced symbol names from other packages -- 2.51.0