]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/goobj: remove Pcdata from object file
authorCherry Mui <cherryyz@google.com>
Mon, 27 Sep 2021 17:52:53 +0000 (13:52 -0400)
committerCherry Mui <cherryyz@google.com>
Tue, 28 Sep 2021 00:35:10 +0000 (00:35 +0000)
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>
src/cmd/internal/goobj/objfile.go
src/cmd/internal/obj/objfile.go

index 20bf0eba89be1e80f1b55663738eae43fe151207..fc6dbb8af6e699b1f24c3e310f9039aa10720e96 100644 (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
index 8a094df91a451955725361f67c81b924c3b1b7e7..3e5cf0e24358cf513c24020c116b2c6ef3ee1103 100644 (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