From: Cherry Mui Date: Mon, 4 Oct 2021 16:51:06 +0000 (-0400) Subject: cmd/compile: set opendefer info symbol as content-addressable X-Git-Tag: go1.18beta1~1071 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d9952ff5119d35751d44d5cd66c7164c7bc21ce0;p=gostls13.git cmd/compile: set opendefer info symbol as content-addressable 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 Run-TryBot: Cherry Mui TryBot-Result: Go Bot Reviewed-by: Than McIntosh --- diff --git a/src/cmd/compile/internal/gc/obj.go b/src/cmd/compile/internal/gc/obj.go index aae7d03ebe..432c003b9a 100644 --- a/src/cmd/compile/internal/gc/obj.go +++ b/src/cmd/compile/internal/gc/obj.go @@ -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) } } } diff --git a/src/cmd/compile/internal/ssagen/ssa.go b/src/cmd/compile/internal/ssagen/ssa.go index 1bfbe7ce65..91e585748e 100644 --- a/src/cmd/compile/internal/ssagen/ssa.go +++ b/src/cmd/compile/internal/ssagen/ssa.go @@ -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]