]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: set opendefer info symbol as content-addressable
authorCherry Mui <cherryyz@google.com>
Mon, 4 Oct 2021 16:51:06 +0000 (12:51 -0400)
committerCherry Mui <cherryyz@google.com>
Mon, 4 Oct 2021 22:00:53 +0000 (22:00 +0000)
Also move the logic of setting arginfo symbols content-addressable
to the place of symbol creation.

Change-Id: Ia5c3d77b1cec988c42c84d573170120948575c07
Reviewed-on: https://go-review.googlesource.com/c/go/+/353830
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/compile/internal/gc/obj.go
src/cmd/compile/internal/ssagen/ssa.go

index aae7d03ebe247cb75903eb35d90f508036be4545..432c003b9ad90cb83d4aa3898d81a3e6d540f623 100644 (file)
@@ -259,7 +259,6 @@ func addGCLocals() {
                if x := fn.ArgInfo; x != nil {
                        objw.Global(x, int32(len(x.P)), obj.RODATA|obj.DUPOK)
                        x.Set(obj.AttrStatic, true)
-                       x.Set(obj.AttrContentAddressable, true)
                }
        }
 }
index 1bfbe7ce65a83809b52ff345263d162c5ced1037..91e585748e9534fc69f946879fdb18421edf2059 100644 (file)
@@ -318,6 +318,7 @@ func dvarint(x *obj.LSym, off int, v int64) int {
 //    - Offset of the closure value to call
 func (s *state) emitOpenDeferInfo() {
        x := base.Ctxt.Lookup(s.curfn.LSym.Name + ".opendefer")
+       x.Set(obj.AttrContentAddressable, true)
        s.curfn.LSym.Func().OpenCodedDeferInfo = x
        off := 0
        off = dvarint(x, off, -s.deferBitsTemp.FrameOffset())
@@ -6544,6 +6545,7 @@ func emitArgInfo(e *ssafn, f *ssa.Func, pp *objw.Progs) {
        }
 
        x := EmitArgInfo(e.curfn, f.OwnAux.ABIInfo())
+       x.Set(obj.AttrContentAddressable, true)
        e.curfn.LSym.Func().ArgInfo = x
 
        // Emit a funcdata pointing at the arg info data.
@@ -6557,6 +6559,9 @@ func emitArgInfo(e *ssafn, f *ssa.Func, pp *objw.Progs) {
 // emit argument info (locations on stack) of f for traceback.
 func EmitArgInfo(f *ir.Func, abiInfo *abi.ABIParamResultInfo) *obj.LSym {
        x := base.Ctxt.Lookup(fmt.Sprintf("%s.arginfo%d", f.LSym.Name, f.ABI))
+       // NOTE: do not set ContentAddressable here. This may be referenced from
+       // assembly code by name (in this case f is a declaration).
+       // Instead, set it in emitArgInfo above.
 
        PtrSize := int64(types.PtrSize)
        uintptrTyp := types.Types[types.TUINTPTR]