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 <cherryyz@google.com>
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
Cherry Mui 2021-09-27 13:52:53 -04:00
parent 12e8ffc18e
commit 850a4ffb63
2 changed files with 0 additions and 21 deletions

View File

@ -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

View File

@ -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