diff --git a/src/cmd/internal/obj/plist.go b/src/cmd/internal/obj/plist.go index 9dbad20589..54b035bb96 100644 --- a/src/cmd/internal/obj/plist.go +++ b/src/cmd/internal/obj/plist.go @@ -85,6 +85,13 @@ func Flushplist(ctxt *Link, plist *Plist, newprog ProgAlloc, myimportpath string // wrapper function continue } + // The current args_stackmap generation in the compiler assumes + // that the function in question is ABI0, so avoid introducing + // an args_stackmap reference if the func is not ABI0 (better to + // have no stackmap than an incorrect/lying stackmap). + if s.ABI() != ABI0 { + continue + } found := false for p := s.Func().Text; p != nil; p = p.Link { if p.As == AFUNCDATA && p.From.Type == TYPE_CONST && p.From.Offset == objabi.FUNCDATA_ArgsPointerMaps { @@ -92,7 +99,6 @@ func Flushplist(ctxt *Link, plist *Plist, newprog ProgAlloc, myimportpath string break } } - if !found { p := Appendp(s.Func().Text, newprog) p.As = AFUNCDATA